Module: Braid::Operations

Extended by:
Git, Svn
Defined in:
lib/braid/operations.rb

Defined Under Namespace

Modules: Git, Helpers, Mirror, Svn

Class Method Summary collapse

Methods included from Git

git_checkout, git_commit, git_fetch, git_merge_base, git_merge_ours, git_merge_subtree, git_read_tree, git_remote_add, git_reset_hard, git_rev_parse, git_rm_r, local_changes?

Methods included from Svn

git_svn_fetch, git_svn_init, svn_git_commit_hash, svn_remote_head_revision

Class Method Details

.exec(cmd) ⇒ Object



272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/braid/operations.rb', line 272

def self.exec(cmd)
  #puts cmd
  out = ""
  err = ""
  cmd.strip!

  ENV['LANG'] = 'C' unless ENV['LANG'] == 'C'
  status = Open4::popen4(cmd) do |pid, stdin, stdout, stderr|
    out = stdout.read.strip
    err = stderr.read.strip
  end
  [status.exitstatus, out, err]
end

.exec!(cmd) ⇒ Object



286
287
288
289
290
# File 'lib/braid/operations.rb', line 286

def self.exec!(cmd)
  status, out, err = exec(cmd)
  raise Braid::Commands::ShellExecutionError, err unless status == 0
  return status, out, err
end

.invoke(*args) ⇒ Object



268
269
270
# File 'lib/braid/operations.rb', line 268

def self.invoke(*args)
  send(*args)
end