module Gem
Extend Gem
module
Public Class Methods
fire_unversioned_hooks(name, version)
click to toggle source
Dispatch unversioned hooks
# File lib/gem_pre_unversioned_install.rb, line 27 def self.fire_unversioned_hooks(name, version) rval = nil # pre_install hooks can cause gem install to abort if they return false # so we allow our plugins to do the same and trigger this behaviour @_unversioned_hooks.each do |hook| break if (rval = hook.call(name, version)) == false end rval end
pre_unversioned_install(&hook)
click to toggle source
Method to register our new hook type
# File lib/gem_pre_unversioned_install.rb, line 22 def self.pre_unversioned_install(&hook) @_unversioned_hooks |= [hook] end
unversioned(name)
click to toggle source
Add unversioned name
# File lib/gem_pre_unversioned_install.rb, line 12 def self.unversioned(name) @_unversioned_gems |= [name] end
unversioned?(name)
click to toggle source
Check unversioned names
# File lib/gem_pre_unversioned_install.rb, line 17 def self.unversioned?(name) @_unversioned_gems.include?(name) end