Class: Gonzui::AbstractVCS

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/gonzui/vcs.rb

Direct Known Subclasses

CVS, Git, Subversion

Instance Method Summary collapse

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) ⇒ AbstractVCS

Returns a new instance of AbstractVCS.



18
19
20
21
22
# File 'lib/gonzui/vcs.rb', line 18

def initialize(config, root, mozule)
  @config = config
  @root = root
  @mozule = mozule
end

Instance Method Details

#cleanObject



48
49
# File 'lib/gonzui/vcs.rb', line 48

def clean
end

#extractObject



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/gonzui/vcs.rb', line 35

def extract
  File.mkpath(@config.cache_directory)
  output_directory = File.join(@config.cache_directory, @mozule)
  if not File.exist?(output_directory)
    do_checkout(output_directory)
  elsif File.directory?(output_directory)
    do_update(output_directory)
  else
    raise VCSError.new("#{output_directory}: obstacle found")
  end
  return output_directory
end