Class: PolishGeeks::DevTools::Config
- Inherits:
-
Object
- Object
- PolishGeeks::DevTools::Config
- Defined in:
- lib/polish_geeks/dev_tools/config.rb
Overview
Note:
No commands are enabled by default
Configurator for enabling specific command runners Config.configure do |conf|
conf.rubocop = true
end
Constant Summary collapse
- COMMANDS =
Available commands All commands will be executed in this order (first rubocop, then rspec, etc)
%i( required_files gemfile expires_in examples_comparator allowed_extensions yml_parser final_blank_line brakeman rubocop bundler_audit empty_methods haml_lint rspec_files_names rspec_files_structure tasks_files_names rspec simplecov yard rubycritic ).freeze
- COMMANDS_OPTIONS =
Additional options for commands
%i( rubocop_rspec rspec_disallow_pending ).freeze
Class Attribute Summary collapse
-
.config ⇒ PolishGeeks::DevTools::Config
Config for dev tools.
Class Method Summary collapse
-
.setup(&block) ⇒ Object
Configurating method.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
Initializes configuration and turn on by default all the commands.
Constructor Details
#initialize ⇒ Config
Initializes configuration and turn on by default all the commands
75 76 77 78 79 80 81 |
# File 'lib/polish_geeks/dev_tools/config.rb', line 75 def initialize (COMMANDS + COMMANDS_OPTIONS).each do |attr_name| public_send(:"#{attr_name}=", true) end self.simplecov_threshold = 100 end |
Class Attribute Details
.config ⇒ PolishGeeks::DevTools::Config
Note:
We check if it initialized, because if user wants to use it with all the commands enabled and without any changes, he won’t create a polishgeeks_dev_tools.rb initializer file so we need to configure it with defaults
Returns config for dev tools.
18 19 20 |
# File 'lib/polish_geeks/dev_tools/config.rb', line 18 def config @config end |
Class Method Details
.setup(&block) ⇒ Object
Configurating method
84 85 86 87 88 89 |
# File 'lib/polish_geeks/dev_tools/config.rb', line 84 def self.setup(&block) self.config = new block.call(config) config.freeze end |