lib/chanko/function.rb in chanko-2.0.4 vs lib/chanko/function.rb in chanko-2.0.5
- old
+ new
@@ -1,11 +1,13 @@
module Chanko
class Function
attr_reader :block, :unit, :label
+ THREAD_LOCAL_UNITS_KEY = 'Chanko::Function.units'
+
class << self
def units
- @units ||= []
+ Thread.current[THREAD_LOCAL_UNITS_KEY] ||= []
end
def current_unit
units.last
end