lib/mercurial-ruby/helper.rb in mercurial-ruby-0.5.0 vs lib/mercurial-ruby/helper.rb in mercurial-ruby-0.6.0
- old
+ new
@@ -1,19 +1,20 @@
module Mercurial
module Helper
- def hg(cmd)
- repository.shell.hg(cmd)
+ def hg(cmd, options={})
+ repository.shell.hg(cmd, options)
end
- def shell(cmd)
- repository.shell.run(cmd)
+ def shell(cmd, options={})
+ repository.shell.run(cmd, options)
end
- def hg_to_array(cmd, separator="\n", &block)
+ def hg_to_array(cmd, options={}, cmd_options={}, &block)
+ separator = options[:separator] || "\n"
[].tap do |returning|
- hg(cmd).split(separator).each do |line|
+ hg(cmd, cmd_options).split(separator).each do |line|
returning << block.call(line)
end
end.compact
end
\ No newline at end of file