Sha256: 54a3ca16e7fe4fe68362db5a58057e47a10c35d999552965e96b3a0f49925eb7

Contents?: true

Size: 861 Bytes

Versions: 25

Compression:

Stored size: 861 Bytes

Contents

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

25 entries across 25 versions & 8 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/lib/simplecov/profiles.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/simplecov-0.13.0/lib/simplecov/profiles.rb
tdiary-5.0.9 vendor/bundle/gems/simplecov-0.14.1/lib/simplecov/profiles.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/profiles.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/profiles.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/profiles.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/profiles.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/simplecov-0.13.0/lib/simplecov/profiles.rb
simplecov-0.15.1 lib/simplecov/profiles.rb
simplecov-0.15.0 lib/simplecov/profiles.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/profiles.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/profiles.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/profiles.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/simplecov-0.14.1/lib/simplecov/profiles.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/simplecov-0.14.1/lib/simplecov/profiles.rb
simplecov-patched-0.14.3 lib/simplecov/profiles.rb
simplecov-patched-0.14.2 lib/simplecov/profiles.rb
simplecov-0.14.1 lib/simplecov/profiles.rb
simplecov-0.14.0 lib/simplecov/profiles.rb
simplecov-0.13.0 lib/simplecov/profiles.rb