class Bagboy::Core::SCM::Git

Public Instance Methods

commit( file, message ) click to toggle source
# File lib/bagboy/core/scm/git.rb, line 14
def commit( file, message )
  execute_command "cd #{Bagboy.chef_repo}; git add '#{clean_filename file}'; git commit '#{clean_filename file}' -m '#{message}'; git push"
end
pull() click to toggle source
# File lib/bagboy/core/scm/git.rb, line 10
def pull
  execute_command "cd #{Bagboy.chef_repo}; git pull"
end

Private Instance Methods

clean_filename( file ) click to toggle source
# File lib/bagboy/core/scm/git.rb, line 24
def clean_filename( file )
  absolute  = Pathname.new(file)
  root      = Pathname.new(Bagboy.chef_repo)
  relative  = absolute.relative_path_from(root)
end
execute_command(cmd) click to toggle source
# File lib/bagboy/core/scm/git.rb, line 20
def execute_command cmd
  `#{cmd}`
end