gemirro 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/lib/gemirro/configuration.rb +11 -6
- data/lib/gemirro/gems_fetcher.rb +4 -3
- data/lib/gemirro/version.rb +1 -1
- data/spec/gemirro/configuration_spec.rb +4 -4
- data/spec/gemirro/gems_fetcher_spec.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 743376753a6202cadfe4fb780411c3b1a5c13b551aed1025abca32ec98bb8d0d
|
4
|
+
data.tar.gz: 9b251517b641c81a708c1d66e15c300d2e159d8024512107de2366418f638927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d2bf4a45e5d4128ddfe0fe392bf326d8f35afbdb98ddbdca27edd3be53ff8841e51e6e96b7bc95a99b1a44a259a535453b2d6b28a6583a6d4cf6f46d2226bf1
|
7
|
+
data.tar.gz: 6a3eebf032d60e1eaf61b55fba14c0988d85e27b80d4a90ea69cbeb50c6e7a81cb73d648bd61144e46be42600af01e5c9ae30ef350a41674c8f1a92374ee1c30
|
data/.rubocop.yml
CHANGED
@@ -162,7 +162,7 @@ module Gemirro
|
|
162
162
|
# @return [Hash]
|
163
163
|
#
|
164
164
|
def ignored_gems
|
165
|
-
@ignored_gems ||= Hash.new { |hash, key| hash[key] =
|
165
|
+
@ignored_gems ||= Hash.new { |hash, key| hash[key] = {} }
|
166
166
|
end
|
167
167
|
|
168
168
|
##
|
@@ -171,9 +171,10 @@ module Gemirro
|
|
171
171
|
# @param [String] name
|
172
172
|
# @param [String] version
|
173
173
|
#
|
174
|
-
def ignore_gem(name, version)
|
175
|
-
ignored_gems[
|
176
|
-
ignored_gems[name]
|
174
|
+
def ignore_gem(name, version, platform)
|
175
|
+
ignored_gems[platform] ||= {}
|
176
|
+
ignored_gems[platform][name] ||= []
|
177
|
+
ignored_gems[platform][name] << version
|
177
178
|
end
|
178
179
|
|
179
180
|
##
|
@@ -183,8 +184,12 @@ module Gemirro
|
|
183
184
|
# @param [String] version
|
184
185
|
# @return [TrueClass|FalseClass]
|
185
186
|
#
|
186
|
-
def ignore_gem?(name, version)
|
187
|
-
ignored_gems[name]
|
187
|
+
def ignore_gem?(name, version, platform)
|
188
|
+
if ignored_gems[platform][name]
|
189
|
+
ignored_gems[platform][name].include?(version)
|
190
|
+
else
|
191
|
+
false
|
192
|
+
end
|
188
193
|
end
|
189
194
|
|
190
195
|
##
|
data/lib/gemirro/gems_fetcher.rb
CHANGED
@@ -105,12 +105,13 @@ module Gemirro
|
|
105
105
|
end
|
106
106
|
name = gem.name
|
107
107
|
|
108
|
-
if gem_exists?(filename) || ignore_gem?(name, version) ||
|
108
|
+
if gem_exists?(filename) || ignore_gem?(name, version, gem.platform) ||
|
109
|
+
!satisfied
|
109
110
|
Utils.logger.debug("Skipping #{filename}")
|
110
111
|
return
|
111
112
|
end
|
112
113
|
|
113
|
-
Utils.configuration.ignore_gem(gem.name, version)
|
114
|
+
Utils.configuration.ignore_gem(gem.name, version, gem.platform)
|
114
115
|
Utils.logger.info("Fetching #{filename}")
|
115
116
|
|
116
117
|
fetch_from_source(filename, gem, version)
|
@@ -133,7 +134,7 @@ module Gemirro
|
|
133
134
|
Utils.logger.error("Failed to retrieve #{filename}: #{e.message}")
|
134
135
|
Utils.logger.debug("Adding #{filename} to the list of ignored Gems")
|
135
136
|
|
136
|
-
Utils.configuration.ignore_gem(gem.name, version)
|
137
|
+
Utils.configuration.ignore_gem(gem.name, version, gem.platform)
|
137
138
|
end
|
138
139
|
|
139
140
|
data
|
data/lib/gemirro/version.rb
CHANGED
@@ -68,10 +68,10 @@ module Gemirro
|
|
68
68
|
|
69
69
|
it 'should return ignored gems' do
|
70
70
|
expect(@config.ignored_gems).to eq({})
|
71
|
-
expect(@config.ignore_gem?('rake', '1.0.0')).to be_falsy
|
72
|
-
expect(@config.ignore_gem('rake', '1.0.0')).to eq(['1.0.0'])
|
73
|
-
expect(@config.ignored_gems).to eq('rake' => ['1.0.0'])
|
74
|
-
expect(@config.ignore_gem?('rake', '1.0.0')).to be_truthy
|
71
|
+
expect(@config.ignore_gem?('rake', '1.0.0', 'ruby')).to be_falsy
|
72
|
+
expect(@config.ignore_gem('rake', '1.0.0', 'ruby')).to eq(['1.0.0'])
|
73
|
+
expect(@config.ignored_gems).to eq('ruby' => {'rake' => ['1.0.0']})
|
74
|
+
expect(@config.ignore_gem?('rake', '1.0.0', 'ruby')).to be_truthy
|
75
75
|
end
|
76
76
|
|
77
77
|
it 'should add and return source' do
|
@@ -34,9 +34,9 @@ module Gemirro
|
|
34
34
|
it 'should ignore gem' do
|
35
35
|
allow(Utils.logger).to receive(:info)
|
36
36
|
.once.with('Fetching gemirro-0.0.1.gem')
|
37
|
-
expect(@fetcher.ignore_gem?('gemirro', '0.0.1')).to be_falsy
|
38
|
-
Utils.configuration.ignore_gem('gemirro', '0.0.1')
|
39
|
-
expect(@fetcher.ignore_gem?('gemirro', '0.0.1')).to be_truthy
|
37
|
+
expect(@fetcher.ignore_gem?('gemirro', '0.0.1', 'ruby')).to be_falsy
|
38
|
+
Utils.configuration.ignore_gem('gemirro', '0.0.1', 'ruby')
|
39
|
+
expect(@fetcher.ignore_gem?('gemirro', '0.0.1', 'ruby')).to be_truthy
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'should log error when fetch gem failed' do
|
@@ -44,7 +44,7 @@ module Gemirro
|
|
44
44
|
.once.with('Fetching gemirro-0.0.1.gem')
|
45
45
|
gem = Gem.new('gemirro')
|
46
46
|
version = ::Gem::Version.new('0.0.1')
|
47
|
-
Utils.configuration.ignore_gem('gemirro', '0.0.1')
|
47
|
+
Utils.configuration.ignore_gem('gemirro', '0.0.1', 'ruby')
|
48
48
|
allow(@source).to receive(:fetch_gem)
|
49
49
|
.once.with('gemirro', version).and_raise(ArgumentError)
|
50
50
|
allow(Utils.logger).to receive(:error)
|
@@ -53,7 +53,7 @@ module Gemirro
|
|
53
53
|
.once.with(/Adding (.*) to the list of ignored Gems/)
|
54
54
|
|
55
55
|
expect(@fetcher.fetch_gem(gem, version)).to be_nil
|
56
|
-
expect(@fetcher.ignore_gem?('gemirro', '0.0.1')).to be_truthy
|
56
|
+
expect(@fetcher.ignore_gem?('gemirro', '0.0.1', 'ruby')).to be_truthy
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'should fetch gem' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemirro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Rambaud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -317,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
317
|
version: '0'
|
318
318
|
requirements: []
|
319
319
|
rubyforge_project:
|
320
|
-
rubygems_version: 2.7.
|
320
|
+
rubygems_version: 2.7.5
|
321
321
|
signing_key:
|
322
322
|
specification_version: 4
|
323
323
|
summary: Gem for easily creating your own gems mirror.
|