模块 Bundler::Plugin::Events
公共类方法
defined_event?(event) 点击切换源代码
检查是否已定义事件 @param event [String] 要检查的事件 @return [Boolean] 指示是否已定义事件的布尔值
# File bundler/plugin/events.rb, line 28 def self.defined_event?(event) @events ||= {} @events.key?(event) end
私有类方法
define(const, event) 点击切换源代码
# File bundler/plugin/events.rb, line 6 def self.define(const, event) const = const.to_sym.freeze if const_defined?(const) && const_get(const) != event raise ArgumentError, "Attempting to reassign #{const} to a different value" end const_set(const, event) unless const_defined?(const) @events ||= {} @events[event] = const end
reset() 点击切换源代码
# File bundler/plugin/events.rb, line 17 def self.reset @events.each_value do |const| remove_const(const) end @events = nil end