Sha256: 2fb881ef4ada88c39c7498f401f9612739311d68a326f5e94ff39d2dd1fab70f

Contents?: true

Size: 969 Bytes

Versions: 23

Compression:

Stored size: 969 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?
          engines_registry_list.keys.include?(engine_name)
        end

        def engines_registry_list
          @engines_registry_list ||= CC::Analyzer::EngineRegistry.new.list
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
codeclimate-0.2.4 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.1.5 lib/cc/cli/engines/engine_command.rb
codeclimate-0.1.4 lib/cc/cli/engines/engine_command.rb
codeclimate-0.1.3 lib/cc/cli/engines/engine_command.rb
codeclimate-0.1.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.1.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.25 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.24 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.23 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.22 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.21 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.18 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.17 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.16 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.15 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.14 lib/cc/cli/engines/engine_command.rb
codeclimate-0.0.13 lib/cc/cli/engines/engine_command.rb