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.59.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.58.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.57.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.56.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.55.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.54.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.53.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.52.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.51.3 lib/cc/cli/engines/engine_command.rb
codeclimate-0.51.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.51.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.51.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.50.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.49.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.48.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.47.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.46.0 lib/cc/cli/engines/engine_command.rb