Sha256: 1994c89a5f89779c4b3cd9d45121b05efd1242741d39f46870c29fc7b5d52b3e

Contents?: true

Size: 743 Bytes

Versions: 20

Compression:

Stored size: 743 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module RSpec
    # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
    # bit of our configuration.
    module Inject
      def self.defaults!
        project_root = Pathname.new(__dir__).parent.parent.parent.expand_path
        config_default = project_root.join('config', 'default.yml')
        path = config_default.to_s
        hash = ConfigLoader.send(:load_yaml_configuration, path)
        config = RuboCop::Config.new(hash, path)
        puts "configuration from #{path}" if ConfigLoader.debug?
        config = ConfigLoader.merge_with_default(config, path)
        ConfigLoader.instance_variable_set(:@default_configuration, config)
      end
    end
  end
end

Version data entries

20 entries across 18 versions & 2 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.12.1/lib/rubocop/rspec/inject.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-rspec-2.9.0/lib/rubocop/rspec/inject.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.12.1/lib/rubocop/rspec/inject.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.9.0/lib/rubocop/rspec/inject.rb
rubocop-rspec-2.12.1 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.12.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.11.1 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.11.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.10.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.9.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.8.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.7.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.6.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.5.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.4.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.3.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.2.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.1.0 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.0.1 lib/rubocop/rspec/inject.rb
rubocop-rspec-2.0.0 lib/rubocop/rspec/inject.rb