Module: Figs::GitHandler

Extended by:
GitHandler
Included in:
GitHandler
Defined in:
lib/figs/git_handler.rb

Constant Summary collapse

TMP_GIT_DIR =
"tmp/figs/"

Instance Method Summary collapse

Instance Method Details

#clear_temp_filesObject



19
20
21
22
23
24
25
# File 'lib/figs/git_handler.rb', line 19

def clear_temp_files
  return unless !@temp_files.nil?
  @temp_files.each do |temp_file|
    temp_file.close
    temp_file.unlink
  end
end

#location(gitpath, filenames) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/figs/git_handler.rb', line 9

def location(gitpath, filenames)
  @temp_files = []
  git_clone gitpath
  temp_filenames(([]<< Figs::DirectoryFlattener.flattened_filenames(filenames.collect {|filename| "#{TMP_GIT_DIR}#{filename}"})).flatten)
rescue Exception => e
  puts e
  clear_tmp_dir
  clear_temp_files
end