Class: RuboCop::RSpec::ConfigFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/rspec/config_formatter.rb

Overview

Builds a YAML config file from two config hashes

Constant Summary collapse

NAMESPACE =
'RSpec'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(config, descriptions) ⇒ ConfigFormatter

Returns a new instance of ConfigFormatter.



9
10
11
12
# File 'lib/rubocop/rspec/config_formatter.rb', line 9

def initialize(config, descriptions)
  @config       = config
  @descriptions = descriptions
end

Instance Method Details

#dumpObject



14
15
16
# File 'lib/rubocop/rspec/config_formatter.rb', line 14

def dump
  YAML.dump(unified_config).gsub(/^#{NAMESPACE}/, "\n#{NAMESPACE}")
end