class Overapp::Git
Public Class Methods
commit(output_path,message,&b)
click to toggle source
# File lib/overapp/util/git.rb, line 18 def commit(output_path,message,&b) init = !FileTest.exist?("#{output_path}/.git") commit_inner(output_path,message,init,&b) end
commit_inner(output_path,message,init) { || ... }
click to toggle source
# File lib/overapp/util/git.rb, line 4 def commit_inner(output_path,message,init,&b) res = nil res = yield if block_given? if init `rm -rf #{output_path}/.git` ec "cd #{output_path} && git init && git config user.email johnsmith@fake.com && git config user.name 'John Smith'", :silent => true end begin ec "cd #{output_path} && git add . && git commit -m '#{message}'", :silent => true rescue; end res end
repo?(path)
click to toggle source
# File lib/overapp/util/git.rb, line 23 def repo?(path) path =~ /\.git/ || path =~ /file:\/\// || path =~ /git:\/\// end