Sha256: 02cbd7f23cc30dcd1d121abbe471dfa5c3ee245c934b30c0613a97cffe4cc092

Contents?: true

Size: 498 Bytes

Versions: 15

Compression:

Stored size: 498 Bytes

Contents

module Mercurial
  
  module Helper
    
    def hg(cmd, options={})
      repository.shell.hg(cmd, options)
    end
    
    def shell(cmd, options={})
      repository.shell.run(cmd, options)
    end
    
    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
    
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mercurial-ruby-0.7.12 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.11 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.10 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.9 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.8 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.7 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.6 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.5 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.4 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.3 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.2 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.1 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.7.0 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.6.1 lib/mercurial-ruby/helper.rb
mercurial-ruby-0.6.0 lib/mercurial-ruby/helper.rb