labrea 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/labrea.rb +19 -14
  2. metadata +4 -4
data/lib/labrea.rb CHANGED
@@ -33,21 +33,25 @@ class Labrea
33
33
  checksums = Hash.new
34
34
  if File.exists?(@install_dir)
35
35
  Dir.chdir(@install_dir) do |path|
36
- Dir.glob("**/*.*") do |file|
37
- @changeset << file.to_s
38
- if File.file?(file)
39
- if !@exclude.include? file
40
- checksums[file] = sha1sum(file)
41
- end
42
- end
43
- end
44
- end
36
+ @changeset.each do |file|
37
+ checksums[file] = sha1sum(file) unless @exclude.include? file
38
+ end
39
+ end
40
+ # Dir.glob("**/*.*") do |file|
41
+ # @changeset << file.to_s
42
+ # if File.file?(file)
43
+ # if !@exclude.include? file
44
+ # checksums[file] = sha1sum(file)
45
+ # end
46
+ # end
47
+ # end
48
+ # end
45
49
  end
46
-
50
+
47
51
  # Write out checksum file
48
52
  File.open(checksum_fqn, "w+") do |file|
49
53
  file.puts JSON.generate(checksums)
50
- end
54
+ end unless testmode
51
55
 
52
56
  return @changeset
53
57
  end
@@ -101,16 +105,17 @@ class Labrea
101
105
 
102
106
  def extract_files(testmode)
103
107
  Dir.chdir(@working_dir) do |path|
104
- @changeset << @install_dir
105
108
 
106
109
  case filetype(@filename)
107
110
  when :tgz
108
- `tar -xzf #{@filename} -C #{@install_dir}` unless testmode
111
+ output = `tar -xvzf #{@filename} -C #{@install_dir} 2>/dev/null` unless testmode
109
112
  when :zip
110
113
  `unzip #{@filename} -d #{@install_dir}` unless testmode
114
+ output = `zipinfo -1 #{@filename}`
111
115
  when :bz2
112
- `tar -xjf #{@filename} -C #{@install_dir}` unless testmode
116
+ output = `tar -xvjf #{@filename} -C #{@install_dir} 2>/dev/null` unless testmode
113
117
  end
118
+ @changeset |= output.split("\n") if output
114
119
  end
115
120
  end
116
121
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: labrea
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Sledge
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-09-17 00:00:00 Z
18
+ date: 2013-09-30 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json