class Codestyle::ConfigGenerator
Public Instance Methods
add_gem()
click to toggle source
# File lib/generators/codestyle/config/config_generator.rb, line 10 def add_gem gem 'rubocop', group: %i[test development] end
create_rubocop_config()
click to toggle source
# File lib/generators/codestyle/config/config_generator.rb, line 14 def create_rubocop_config directory('rubocop_config', '.rubocop_config') template 'rubocop_todo.yml', '.rubocop_todo.yml' template 'rubocop.yml', '.rubocop.yml' end
ruby_version()
click to toggle source
# File lib/generators/codestyle/config/config_generator.rb, line 24 def ruby_version (/\d\.\d/.match `ruby -v`)[0] end
run_bundle()
click to toggle source
# File lib/generators/codestyle/config/config_generator.rb, line 20 def run_bundle run('bundle install') end
setup()
click to toggle source
# File lib/generators/codestyle/config/config_generator.rb, line 6 def setup @rubyversion = ruby_version end