class Crafti::Git

Attributes

app_path[R]

Public Class Methods

new(app_path, &block) click to toggle source
# File lib/crafti.rb, line 141
def initialize(app_path, &block)
  @app_path = app_path
  instance_eval(&block) if block_given?
end

Public Instance Methods

add(*args) click to toggle source
# File lib/crafti.rb, line 150
def add(*args)
  cmd = case args.first
  when :all then "."
  else
    files = args.join(' ')
  end

  git "add #{cmd}"
end
commit(message) click to toggle source
# File lib/crafti.rb, line 160
def commit(message)
  git "commit -am '#{message}'"
end
git(command) click to toggle source
# File lib/crafti.rb, line 164
def git(command)
  results = system "cd #{app_path} && git #{command}"
end
init() click to toggle source
# File lib/crafti.rb, line 146
def init
  git "init ."
end