Sha256: 07c8dfca60be421dcf3cb00cd87cdf5589c0d484ded059269df497e6e70c32db

Contents?: true

Size: 908 Bytes

Versions: 21

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

module SimpleCov
  #
  # Profiles are SimpleCov configuration procs that can be easily
  # loaded using SimpleCov.start :rails and defined using
  #   SimpleCov.profiles.define :foo do
  #     # SimpleCov configuration here, same as in  SimpleCov.configure
  #   end
  #
  class Profiles < Hash
    #
    # Define a SimpleCov profile:
    #   SimpleCov.profiles.define 'rails' do
    #     # Same as SimpleCov.configure do .. here
    #   end
    #
    def define(name, &blk)
      name = name.to_sym
      raise "SimpleCov Profile '#{name}' is already defined" unless self[name].nil?

      self[name] = blk
    end

    #
    # Applies the profile of given name on SimpleCov.configure
    #
    def load(name)
      name = name.to_sym
      raise "Could not find SimpleCov Profile called '#{name}'" unless key?(name)

      SimpleCov.configure(&self[name])
    end
  end
end

Version data entries

21 entries across 21 versions & 6 rubygems

Version Path
strongmind-simplecov-0.23.0 lib/simplecov/profiles.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov/profiles.rb
simplecov-0.22.0 lib/simplecov/profiles.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/simplecov-0.21.2/lib/simplecov/profiles.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/simplecov-0.21.2/lib/simplecov/profiles.rb
simplecov-0.21.2 lib/simplecov/profiles.rb
simplecov-0.21.1 lib/simplecov/profiles.rb
simplecov-0.21.0 lib/simplecov/profiles.rb
simplecov-0.20.0 lib/simplecov/profiles.rb
simplecov-0.19.1 lib/simplecov/profiles.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/simplecov-0.19.0/lib/simplecov/profiles.rb
simplecov-0.19.0 lib/simplecov/profiles.rb
simplecov-0.18.5 lib/simplecov/profiles.rb
simplecov-0.18.4 lib/simplecov/profiles.rb
simplecov-0.18.3 lib/simplecov/profiles.rb
simplecov-0.18.2 lib/simplecov/profiles.rb
simplecov-0.18.1 lib/simplecov/profiles.rb
simplecov-0.18.0 lib/simplecov/profiles.rb
simplecov-0.18.0.beta3 lib/simplecov/profiles.rb
simplecov-0.18.0.beta2 lib/simplecov/profiles.rb