Class: Gonzui::Git

Inherits:
AbstractVCS show all
Defined in:
lib/gonzui/vcs.rb

Instance Method Summary collapse

Methods inherited from AbstractVCS

#clean, #extract

Methods included from Util

assert, assert_equal, assert_equal_all, assert_non_nil, assert_not_reached, benchmark, command_exist?, commify, eprintf, format_bytes, program_name, protect_from_signals, require_command, set_verbosity, shell_escape, unix?, vprintf, windows?, wprintf

Constructor Details

#initialize(config, root, mozule = nil) ⇒ Git

Returns a new instance of Git.



108
109
110
111
112
# File 'lib/gonzui/vcs.rb', line 108

def initialize(config, root, mozule = nil)
  require_command("git")
  mozule = File.basename(URI.parse(root).path, ".git") unless mozule
  super(config, root, mozule)
end

Instance Method Details

#do_checkout(output_directory) ⇒ Object



114
115
116
117
118
119
120
# File 'lib/gonzui/vcs.rb', line 114

def do_checkout(output_directory)
  Dir.chdir(@config.cache_directory) {
    command_line = sprintf("git clone %s",
                           shell_escape(@root))
    run_command(command_line, "git clone")
  }
end

#do_update(output_directory) ⇒ Object



122
123
124
125
126
# File 'lib/gonzui/vcs.rb', line 122

def do_update(output_directory)
  Dir.chdir(output_directory) {
    run_command("git pull","git pull")
  }
end