Sha256: 2fbbceb00cb3a65735aff9b4b5d5ec48f61fe2f686928dc5b1f0cda0fb1c3708

Contents?: true

Size: 1006 Bytes

Versions: 37

Compression:

Stored size: 1006 Bytes

Contents

require "cc/analyzer"
require "cc/cli/engines/engine_command"

module CC
  module CLI
    module Engines
      class Disable < EngineCommand
        ARGUMENT_LIST = "<engine_name>".freeze
        SHORT_HELP = "Disable an engine in your codeclimate.yml.".freeze
        HELP = "#{SHORT_HELP}\n" \
          "\n"\
          "    <engine_name>    Engine to disable in your codeclimate.yml".freeze

        def run
          require_codeclimate_yml

          if !engine_exists?
            say "Engine not found. Run 'codeclimate engines:list' for a list of valid engines."
          elsif !engine_present_in_yaml?
            say "Engine not found in .codeclimate.yml."
          elsif !engine_enabled?
            say "Engine already disabled."
          else
            disable_engine
            update_yaml
            say "Engine disabled."
          end
        end

        private

        def disable_engine
          parsed_yaml.disable_engine(engine_name)
        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/disable.rb
codeclimate-0.68.0 lib/cc/cli/engines/disable.rb
codeclimate-0.67.0 lib/cc/cli/engines/disable.rb
codeclimate-0.66.0 lib/cc/cli/engines/disable.rb
codeclimate-0.65.0 lib/cc/cli/engines/disable.rb
codeclimate-0.64.0 lib/cc/cli/engines/disable.rb
codeclimate-0.63.7 lib/cc/cli/engines/disable.rb
codeclimate-0.63.6 lib/cc/cli/engines/disable.rb
codeclimate-0.63.5 lib/cc/cli/engines/disable.rb
codeclimate-0.63.4 lib/cc/cli/engines/disable.rb
codeclimate-0.63.3 lib/cc/cli/engines/disable.rb
codeclimate-0.63.2 lib/cc/cli/engines/disable.rb
codeclimate-0.63.1 lib/cc/cli/engines/disable.rb
codeclimate-0.63.0 lib/cc/cli/engines/disable.rb
codeclimate-0.62.0 lib/cc/cli/engines/disable.rb
codeclimate-0.61.1 lib/cc/cli/engines/disable.rb
codeclimate-0.61.0 lib/cc/cli/engines/disable.rb
codeclimate-0.60.1 lib/cc/cli/engines/disable.rb
codeclimate-0.60.0 lib/cc/cli/engines/disable.rb
codeclimate-0.59.1 lib/cc/cli/engines/disable.rb