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.6.4 lib/cc/cli/engines/engine_command.rb
codeclimate-0.6.3 lib/cc/cli/engines/engine_command.rb
codeclimate-0.6.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.6.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.6.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.5.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.4.4 lib/cc/cli/engines/engine_command.rb
codeclimate-0.4.3 lib/cc/cli/engines/engine_command.rb
codeclimate-0.4.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.4.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.3.2 lib/cc/cli/engines/engine_command.rb
codeclimate-0.3.1 lib/cc/cli/engines/engine_command.rb
codeclimate-0.3.0 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2.12 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2.11 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2.9 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2.7 lib/cc/cli/engines/engine_command.rb
codeclimate-0.2.6 lib/cc/cli/engines/engine_command.rb