Class: RuboCop::Capybara::ConfigFormatter
- Inherits:
-
Object
- Object
- RuboCop::Capybara::ConfigFormatter
- Defined in:
- lib/rubocop/capybara/config_formatter.rb
Overview
Builds a YAML config file from two config hashes
Constant Summary collapse
- EXTENSION_ROOT_DEPARTMENT =
%r{^(Capybara/)}.freeze
- SUBDEPARTMENTS =
%(Capybara/RSpec)
- AMENDMENTS =
[].freeze
- COP_DOC_BASE_URL =
'https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/'
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(config, descriptions) ⇒ ConfigFormatter
constructor
A new instance of ConfigFormatter.
Constructor Details
#initialize(config, descriptions) ⇒ ConfigFormatter
Returns a new instance of ConfigFormatter.
14 15 16 17 |
# File 'lib/rubocop/capybara/config_formatter.rb', line 14 def initialize(config, descriptions) @config = config @descriptions = descriptions end |
Instance Method Details
#dump ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/rubocop/capybara/config_formatter.rb', line 19 def dump YAML.dump(unified_config) .gsub(EXTENSION_ROOT_DEPARTMENT, "\n\\1") .gsub(/^(\s+)- /, '\1 - ') .gsub('"~"', '~') # .gsub(*AMENDMENTS, "\n\\0") end |