Module: Mercurial::Helper
- Included in:
- BlameFactory, BranchFactory, Commit, CommitFactory, DiffFactory, FileIndex, Manifest, Node, TagFactory
- Defined in:
- lib/mercurial-ruby/helper.rb
Instance Method Summary collapse
- #hg(cmd, options = {}) ⇒ Object
- #hg_to_array(cmd, options = {}, cmd_options = {}, &block) ⇒ Object
- #shell(cmd, options = {}) ⇒ Object
Instance Method Details
#hg(cmd, options = {}) ⇒ Object
5 6 7 |
# File 'lib/mercurial-ruby/helper.rb', line 5 def hg(cmd, ={}) repository.shell.hg(cmd, ) end |
#hg_to_array(cmd, options = {}, cmd_options = {}, &block) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/mercurial-ruby/helper.rb', line 13 def hg_to_array(cmd, ={}, ={}, &block) separator = [:separator] || "\n" [].tap do |returning| hg(cmd, ).split(separator).each do |line| returning << block.call(line) end end.compact end |
#shell(cmd, options = {}) ⇒ Object
9 10 11 |
# File 'lib/mercurial-ruby/helper.rb', line 9 def shell(cmd, ={}) repository.shell.run(cmd, ) end |