lib/dagger/generator.rb in ruby-dagger-0.2.1 vs lib/dagger/generator.rb in ruby-dagger-0.3.0
- old
+ new
@@ -58,16 +58,16 @@
# update(key: value, ...)
def update(**kwargs)
kwargs.each { |key, value| @context[key] = value }
end
- # Make an array of a value unless it is already enumerable
+ # Make an array of a value unless it is already an array
#
# :call-seq:
- # enumerable(value) => value || [value]
- def enumerable(value)
- value.respond_to?(:each) ? value : [value]
+ # array(value) => value || [value]
+ def array(value)
+ value.respond_to?(:to_ary) ? value : [value]
end
# Format a +string+ with values from a +dictionary+
#
# :call-seq:
@@ -83,6 +83,6 @@
format(string, hash)
end
end
end
-Dir[__dir__ + '/generator/*.rb'].each { |file| load(file) }
+Dir[__dir__ + '/generate/*.rb'].each { |file| load(file) }