Sha256: 9650b9df7b172f59629ddb64ec435eccf96de5c732dc640d8e3c5a1d1e43ad0f

Contents?: true

Size: 912 Bytes

Versions: 118

Compression:

Stored size: 912 Bytes

Contents

require "cc/analyzer"

module CC
  module CLI
    module Engines
      class EngineCommand < Command
        include CC::Analyzer

        private

        def engine_name
          @engine_name ||= @args.first
        end

        def parsed_yaml
          @parsed_yaml ||= CC::Analyzer::Config.new(yaml_content)
        end

        def yaml_content
          filesystem.read_path(CODECLIMATE_YAML).freeze
        end

        def update_yaml
          filesystem.write_path(CODECLIMATE_YAML, parsed_yaml.to_yaml)
        end

        def engine_present_in_yaml?
          parsed_yaml.engine_present?(engine_name)
        end

        def engine_enabled?
          parsed_yaml.engine_enabled?(engine_name)
        end

        def engine_exists?
          engine_registry.exists?(engine_name)
        end

        def engine_registry_list
          engine_registry.list
        end
      end
    end
  end
end

Version data entries

118 entries across 118 versions & 1 rubygems

Version Path
codeclimate-0.24.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.24.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.23.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.22.3 lib/cc/cli/engines/engine_command.rb
codeclimate-0.22.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.22.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.22.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.21.4 lib/cc/cli/engines/engine_command.rb
codeclimate-0.21.3 lib/cc/cli/engines/engine_command.rb
codeclimate-0.21.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.21.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.21.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.20.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.20.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.20.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.19.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.19.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.19.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.18.6 lib/cc/cli/engines/engine_command.rb
codeclimate-0.18.5 lib/cc/cli/engines/engine_command.rb