lib/gitenv/action.rb in gitenv-0.0.4 vs lib/gitenv/action.rb in gitenv-0.0.5

- old
+ new

@@ -2,17 +2,23 @@ module Gitenv class Action include Context - def initialize config, type, files - @type, @files = type, files + def initialize config, type, files, options + @type, @files, @options = type, files, options copy! config end - def each &block - @files.each File.join(*[repository, from_path].compact) do |f| - block.call @type.new(self, f) + def each options = {}, &block + @files.each from_path do |f| + block.call @type.new(self, f, @options.merge(options)) + end + end + + def each_file &block + @files.each from_path do |f| + block.call File.join(from_path, f) end end end end