Sha256: 6438b9a2d33ad18697fd7a6391f34a157b332bc8a3327095ac6819ade10ee984

Contents?: true

Size: 638 Bytes

Versions: 405

Compression:

Stored size: 638 Bytes

Contents

class Module
  # Check for an existing method in the current class before extending.  If
  # the method already exists, then a warning is printed and the extension is
  # not added.  Otherwise the block is yielded and any definitions in the
  # block will take effect.
  #
  # Usage:
  #
  #   class String
  #     rake_extension("xyz") do
  #       def xyz
  #         ...
  #       end
  #     end
  #   end
  #
  def rake_extension(method) # :nodoc:
    if method_defined?(method)
      $stderr.puts "WARNING: Possible conflict with Rake extension: " +
        "#{self}##{method} already exists"
    else
      yield
    end
  end
end

Version data entries

405 entries across 342 versions & 87 rubygems

Version Path
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/rake-12.0.0/lib/rake/ext/core.rb
jscop-0.1.2 vendor/cache/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/core.rb
talon_one-2.0.0 vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/ext/core.rb
talon_one-2.0.0 vendor/bundle/ruby/2.7.0/gems/rake-12.0.0/lib/rake/ext/core.rb
cloudsmith-api-0.49.118 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
cloudsmith-api-0.49.98 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
cloudsmith-api-0.49.94 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/rake-10.5.0/lib/rake/ext/core.rb
cloudsmith-api-0.49.21 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
cloudsmith-api-0.49.15 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
cloudsmith-api-0.49.13 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
cloudsmith-api-0.49.9 vendor/bundle/ruby/2.3.0/gems/rake-12.0.0/lib/rake/ext/core.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rake-11.3.0/lib/rake/ext/core.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/rake-12.0.0/lib/rake/ext/core.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/core.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/rake-12.0.0/lib/rake/ext/core.rb
spec_fill-0.1.2 vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/core.rb
spec_fill-0.1.1 vendor/bundle/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/core.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/rake-10.5.0/lib/rake/ext/core.rb