Class: RuboCop::Gusto::Init
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- RuboCop::Gusto::Init
- Includes:
- Thor::Actions
- Defined in:
- lib/rubocop/gusto/init.rb
Constant Summary collapse
- PLUGINS =
%w(rubocop-gusto rubocop-rspec rubocop-performance rubocop-rake rubocop-rails).freeze
- SIDEKIQ_GEM_PATTERN =
/\A\s*gem\s+['"]sidekiq['"]/- SIDEKIQ_LOCKFILE_PATTERN =
/\A\s+sidekiq\s+\(/
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
18 19 20 |
# File 'lib/rubocop/gusto/init.rb', line 18 def self.source_root File.("templates", __dir__) end |
Instance Method Details
#add_dependencies ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/rubocop/gusto/init.rb', line 22 def add_dependencies if rails? # we don't want rubocop-rails to be a dependency of the gem so that we can use this in non-rails gems run "bundle show rubocop-rails >/dev/null || bundle add rubocop-rails --group development", capture: true end run "bundle binstub rubocop", capture: true end |
#copy_config_files ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/rubocop/gusto/init.rb', line 31 def copy_config_files config = ConfigYml.load_file([:rubocop_yml]) if config.empty? template "rubocop.yml", [:rubocop_yml] config = ConfigYml.load_file([:rubocop_yml]) end config.add_inherit_gem("rubocop-gusto", *inherit_gem_configs) config.add_plugin(rails? ? PLUGINS : PLUGINS - %w(rubocop-rails)) config.sort! config.write([:rubocop_yml]) say_status "update", [:rubocop_yml] create_file(".rubocop_todo.yml", skip: true) end |