class Flipflop::FeatureLoader
Public Class Methods
current()
click to toggle source
# File lib/flipflop/feature_loader.rb, line 6 def current @current or @@lock.synchronize { @current ||= new } end
new()
click to toggle source
# File lib/flipflop/feature_loader.rb, line 16 def initialize @paths = [] end
Public Instance Methods
append(engine)
click to toggle source
# File lib/flipflop/feature_loader.rb, line 20 def append(engine) @paths.concat(engine.paths.add("config/features.rb".freeze).existent) end
Private Instance Methods
checker()
click to toggle source
# File lib/flipflop/feature_loader.rb, line 26 def checker @checker or @@lock.synchronize do @checker ||= ActiveSupport::FileUpdateChecker.new(@paths) { reload! } end end
reload!()
click to toggle source
# File lib/flipflop/feature_loader.rb, line 32 def reload! @@lock.synchronize do Flipflop::FeatureSet.current.replace do @paths.each { |path| Kernel.load(path) } end end end