gemirro 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gemirro might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/gemirro/server.rb +9 -4
- data/lib/gemirro/version.rb +1 -1
- data/spec/gemirro/server_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78f6c247eadc49dc2b5f32d05dc0e0d7ebf0adf0
|
4
|
+
data.tar.gz: 495c49a190ec3116a566fc26fb20bfe597e1037b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 826a05555760d61213e65965f8d0dc52ebfaebbf80b5628da365d1da4abfdcf0c7ef1b81ce3b7aeadb54782fe68c4a308f0d2c93decb51e9c9e45a85c7f2c7d3
|
7
|
+
data.tar.gz: 262edd87484dda4c5dff3345c489863499c608bbf7d41f369f2655f44c7aa495e14b9e74ec011e406d70747203209ded2078dbd0524e3a4720822bf51273dfd4
|
data/lib/gemirro/server.rb
CHANGED
@@ -14,8 +14,13 @@ module Gemirro
|
|
14
14
|
class Server < Sinatra::Base
|
15
15
|
attr_accessor :versions_fetcher, :gems_fetcher
|
16
16
|
|
17
|
-
|
18
|
-
access_logger = Logger.new(Gemirro.configuration.server.access_log)
|
17
|
+
# rubocop:disable Metrics/LineLength
|
18
|
+
access_logger = Logger.new(Gemirro.configuration.server.access_log).tap do |logger|
|
19
|
+
::Logger.class_eval { alias_method :write, :'<<' }
|
20
|
+
logger.level = ::Logger::INFO
|
21
|
+
end
|
22
|
+
# rubocop:enable Metrics/LineLength
|
23
|
+
|
19
24
|
error_logger = File.new(Gemirro.configuration.server.error_log, 'a+')
|
20
25
|
error_logger.sync = true
|
21
26
|
|
@@ -125,7 +130,7 @@ module Gemirro
|
|
125
130
|
def fetch_gem(resource)
|
126
131
|
name = File.basename(resource)
|
127
132
|
# rubocop:disable Metrics/LineLength
|
128
|
-
regexp = /^(.*)-(\d+(?:\.\d+){,4})(-x86-((mswin|mingw)(32|64))*)
|
133
|
+
regexp = /^(.*)-(\d+(?:\.\d+){,4})(-x86-((mswin|mingw)(32|64))*)?\.gem(?:spec\.rz)?$/
|
129
134
|
# rubocop:enable Metrics/LineLength
|
130
135
|
result = name.match(regexp)
|
131
136
|
return unless result
|
@@ -139,7 +144,7 @@ module Gemirro
|
|
139
144
|
|
140
145
|
logger.info("Try to download #{gem_name} with version #{gem_version}")
|
141
146
|
gems_fetcher.source.gems.clear
|
142
|
-
gems_fetcher.source.gems.push(
|
147
|
+
gems_fetcher.source.gems.push(gem)
|
143
148
|
gems_fetcher.fetch
|
144
149
|
|
145
150
|
update_indexes
|
data/lib/gemirro/version.rb
CHANGED
data/spec/gemirro/server_spec.rb
CHANGED
@@ -123,8 +123,9 @@ module Gemirro
|
|
123
123
|
versions_fetcher = Gemirro::VersionsFetcher.new(source)
|
124
124
|
allow(versions_fetcher).to receive(:fetch).once.and_return(true)
|
125
125
|
|
126
|
-
gems_fetcher = Gemirro::
|
126
|
+
gems_fetcher = Gemirro::GemsFetcher.new(source, versions_fetcher)
|
127
127
|
allow(gems_fetcher).to receive(:fetch).once.and_return(true)
|
128
|
+
allow(gems_fetcher).to receive(:gem_exists?).once.and_return(true)
|
128
129
|
|
129
130
|
Struct.new('GemIndexer')
|
130
131
|
gem_indexer = Struct::GemIndexer.new
|