figs 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/figs/git_handler.rb +11 -8
- data/lib/figs/version.rb +1 -1
- metadata +2 -2
data/lib/figs/git_handler.rb
CHANGED
@@ -11,25 +11,28 @@ module Figs
|
|
11
11
|
git_clone gitpath
|
12
12
|
temp_filenames(([]<< Figs::DirectoryFlattener.flattened_filenames(filenames.collect {|filename| "#{TMP_GIT_DIR}#{filename}"})).flatten)
|
13
13
|
rescue Exception => e
|
14
|
-
|
14
|
+
puts e
|
15
15
|
clear_tmp_dir
|
16
16
|
clear_temp_files
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def clear_temp_files
|
20
20
|
return unless !@temp_files.nil?
|
21
|
-
@temp_files.each
|
21
|
+
@temp_files.each do |temp_file|
|
22
|
+
temp_file.close
|
23
|
+
temp_file.unlink
|
24
|
+
end
|
22
25
|
end
|
23
|
-
|
26
|
+
|
24
27
|
private
|
25
|
-
|
28
|
+
|
26
29
|
def temp_filenames(filenames)
|
27
30
|
temp_files = []
|
28
31
|
filenames.each { |filename| temp_files << copy_to_temp_files(filename) }
|
29
32
|
clear_tmp_dir
|
30
33
|
temp_files
|
31
34
|
end
|
32
|
-
|
35
|
+
|
33
36
|
def copy_to_temp_files(filename)
|
34
37
|
temp_file = Tempfile.new("#{filename.gsub('/','-')}")
|
35
38
|
temp_file.open
|
@@ -38,12 +41,12 @@ module Figs
|
|
38
41
|
@temp_files << temp_file
|
39
42
|
temp_file.path
|
40
43
|
end
|
41
|
-
|
44
|
+
|
42
45
|
def git_clone(gitpath)
|
43
46
|
clear_tmp_dir
|
44
47
|
::Git.clone gitpath, TMP_GIT_DIR
|
45
48
|
end
|
46
|
-
|
49
|
+
|
47
50
|
def clear_tmp_dir
|
48
51
|
FileUtils.rm_rf TMP_GIT_DIR
|
49
52
|
end
|
data/lib/figs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|