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

Methods included from Svn

git_svn_fetch, git_svn_init, svn_git_commit_hash, svn_remote_head_revision

Class Method Details

.exec(cmd) ⇒ Object



241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/braid/operations.rb', line 241

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



255
256
257
258
259
# File 'lib/braid/operations.rb', line 255

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



237
238
239
# File 'lib/braid/operations.rb', line 237

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

.msg(str) ⇒ Object



262
263
264
# File 'lib/braid/operations.rb', line 262

def self.msg(str)
  Braid::Command.msg(str)
end