Class: PolishGeeks::DevTools::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/polishgeeks/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(
  readme
  expires_in
  brakeman
  rubocop
  final_blank_line
  empty_method
  haml_lint
  allowed_extensions
  yml_parser
  rspec_files_names
  rspec_files_structure
  tasks_files_names
  rspec
  simplecov
  yard
  examples_comparator
  rubycritic
)

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Initializes configuration and turn on by default all the commands



67
68
69
70
71
72
73
# File 'lib/polishgeeks/dev-tools/config.rb', line 67

def initialize
  COMMANDS.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:

  • config for dev tools



18
19
20
# File 'lib/polishgeeks/dev-tools/config.rb', line 18

def config
  @config
end

Instance Attribute Details

#simplecov_thresholdObject

Returns the value of attribute simplecov_threshold.



23
24
25
# File 'lib/polishgeeks/dev-tools/config.rb', line 23

def simplecov_threshold
  @simplecov_threshold
end

Class Method Details

.setup(&block) ⇒ Object

Configurating method



76
77
78
79
80
81
# File 'lib/polishgeeks/dev-tools/config.rb', line 76

def self.setup(&block)
  self.config = new

  block.call(config)
  config.freeze
end