Sha256: afec13324e2a94f8dbaf856e9ff29fd17d4981779c028352d4b78a4251121e17

Contents?: true

Size: 892 Bytes

Versions: 35

Compression:

Stored size: 892 Bytes

Contents

# frozen_string_literal: true

#
# 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
#
module SimpleCov
  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

35 entries across 23 versions & 3 rubygems

Version Path
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/simplecov-0.17.1/lib/simplecov/profiles.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb
tdiary-5.1.3 vendor/bundle/ruby/2.6.0/gems/simplecov-0.16.1/lib/simplecov/profiles.rb