Class: PolishGeeks::DevTools::Config

Inherits:
Object
  • Object
show all
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

Examples:

Enable only rubocop

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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

.configPolishGeeks::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.

Returns:



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