Class: CC::CLI::UpgradeConfigGenerator

Inherits:
ConfigGenerator show all
Defined in:
lib/cc/cli/upgrade_config_generator.rb

Constant Summary

Constants inherited from ConfigGenerator

ConfigGenerator::AUTO_EXCLUDE_PATHS, ConfigGenerator::CODECLIMATE_YAML, ConfigGenerator::ConfigGeneratorError

Instance Method Summary collapse

Methods inherited from ConfigGenerator

#codeclimate_checks, #eligible_engines, for, #initialize

Constructor Details

This class inherits a constructor from CC::CLI::ConfigGenerator

Instance Method Details

#can_generate?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/cc/cli/upgrade_config_generator.rb', line 6

def can_generate?
  errors.blank?
end

#errorsObject



10
11
12
# File 'lib/cc/cli/upgrade_config_generator.rb', line 10

def errors
  existing_yaml.errors
end

#exclude_pathsObject



14
15
16
# File 'lib/cc/cli/upgrade_config_generator.rb', line 14

def exclude_paths
  (existing_yaml.exclude_paths || []).map(&:to_s)
end

#post_generation_verbObject



18
19
20
# File 'lib/cc/cli/upgrade_config_generator.rb', line 18

def post_generation_verb
  "upgraded"
end