gem_lint 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/lib/gem_lint/runner.rb +9 -10
- data/lib/gem_lint.rb +1 -0
- metadata +4 -4
data/CHANGELOG
CHANGED
data/lib/gem_lint/runner.rb
CHANGED
@@ -90,10 +90,6 @@ module GemLint
|
|
90
90
|
@data_path ||= File.join(unpack_path, "data")
|
91
91
|
end
|
92
92
|
|
93
|
-
def data_file
|
94
|
-
@data_file ||= File.join(unpack_path, "data.tar.gz")
|
95
|
-
end
|
96
|
-
|
97
93
|
def metadata_gz_file
|
98
94
|
@metadata_gz_file ||= File.join(unpack_path, "metadata.gz")
|
99
95
|
end
|
@@ -114,16 +110,19 @@ module GemLint
|
|
114
110
|
@unpack_path ||= File.join(Dir.tmpdir, rand(100000).to_s)
|
115
111
|
end
|
116
112
|
|
117
|
-
# TODO: update this to use native ruby untar
|
118
113
|
def unpack_gem
|
119
114
|
Dir.mkdir(unpack_path)
|
120
115
|
Dir.mkdir(data_path)
|
121
116
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
117
|
+
format = Gem::Format.from_file_by_path(@filename)
|
118
|
+
File.open(metadata_file, "wb") { |out| YAML.dump(format.spec, out) }
|
119
|
+
format.file_entries.each do |entry, file_data|
|
120
|
+
path = entry['path']
|
121
|
+
path = File.expand_path File.join(data_path, path)
|
122
|
+
raise "Can't install files there" unless path[0, data_path.size] == data_path
|
123
|
+
FileUtils.mkdir_p File.dirname(path)
|
124
|
+
File.open(path, "wb") { |out| out.write file_data }
|
125
|
+
end
|
127
126
|
|
128
127
|
true
|
129
128
|
end
|
data/lib/gem_lint.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Healy
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-10 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|