Class: Gonzui::GitFetcher

Inherits:
AbstractFetcher show all
Defined in:
lib/gonzui/fetcher.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractFetcher

#add_finishing_proc, #collect, #exclude?, #fetch, #finish, #initialize, #package_name

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

This class inherits a constructor from Gonzui::AbstractFetcher

Class Method Details

.schemeObject



285
286
287
# File 'lib/gonzui/fetcher.rb', line 285

def self.scheme
  "git"
end

Instance Method Details

#get_extractorObject



293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/gonzui/fetcher.rb', line 293

def get_extractor
  query = WEBrick::HTTPUtils.parse_query(@source_uri.query)
  mozule = query["module"]
  uri = @source_uri.dup
  uri.scheme = query["original_scheme"] if query["original_scheme"]
  uri.query = nil
  root = uri.to_s
  # FIXME: kludge for replacing file:/home/... ->
  # file:///home/... because git doesn't allow
  # the former URI.
  root.gsub!(%r!^file:/+!, "file:///") if uri.scheme == "file"
  return Git.new(@config, root, mozule)
end

#need_extraction?Boolean

Returns:

  • (Boolean)


289
290
291
# File 'lib/gonzui/fetcher.rb', line 289

def need_extraction?
  true
end