Sha256: 2e7ecb99dd2d53dfbd00cd6cd76f82086bc3fdf070dc269eb253432b63d8e1fd

Contents?: true

Size: 931 Bytes

Versions: 37

Compression:

Stored size: 931 Bytes

Contents

require "cc/analyzer"

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

        abstract!

        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

37 entries across 37 versions & 1 rubygems

Version Path
codeclimate-0.69.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.68.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.67.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.66.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.65.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.64.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.7 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.6 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.5 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.4 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.3 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.63.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.62.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.61.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.61.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.60.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.60.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.59.1 lib/cc/cli/engines/engine_command.rb