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

Instance Method Details

#hg(cmd, options = {}) ⇒ Object



5
6
7
# File 'lib/mercurial-ruby/helper.rb', line 5

def hg(cmd, options={})
  repository.shell.hg(cmd, options)
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, options={}, cmd_options={}, &block)
  separator = options[:separator] || "\n"
  [].tap do |returning|
    hg(cmd, cmd_options).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, options={})
  repository.shell.run(cmd, options)
end