gemirro 0.10.0 → 0.10.1
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 +7 -9
- data/lib/gemirro/version.rb +1 -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: 9da9030e0d14e4a42aa1b4bd5c2d807ad671b9fa
|
4
|
+
data.tar.gz: 8635986b3ca41c6d5a086edc019a92df0b748386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 615913c7fb85dbc0151366f901f7ba95f9abd9682cade0d2a89e9b67359320a8cdcbe10262e769f6a09ea3a0a5ddb18d47c7386b9db3e38eb1b57f2f94261d33
|
7
|
+
data.tar.gz: ef79683054df6adf27951b2e7b9118253fefdaf78e7ed4dac531eb86429c71b192cb6787597d784affea8938829c52be7717400c30f30e5ecdad1e0eb9cf960e
|
data/lib/gemirro/server.rb
CHANGED
@@ -14,12 +14,8 @@ module Gemirro
|
|
14
14
|
class Server < Sinatra::Base
|
15
15
|
attr_accessor :versions_fetcher, :gems_fetcher
|
16
16
|
|
17
|
+
Logger.class_eval { alias_method :write, :'<<' }
|
17
18
|
access_logger = Logger.new(Gemirro.configuration.server.access_log)
|
18
|
-
.tap do |logger|
|
19
|
-
::Logger.class_eval { alias_method :write, :'<<' }
|
20
|
-
logger.level = ::Logger::INFO
|
21
|
-
end
|
22
|
-
|
23
19
|
error_logger = File.new(Gemirro.configuration.server.error_log, 'a+')
|
24
20
|
error_logger.sync = true
|
25
21
|
|
@@ -137,17 +133,19 @@ module Gemirro
|
|
137
133
|
gem_name, gem_version = result.captures
|
138
134
|
return unless gem_name && gem_version
|
139
135
|
|
140
|
-
logger.info("Try to download #{gem_name} with version #{gem_version}")
|
141
|
-
|
142
136
|
begin
|
137
|
+
gem = Gemirro::Gem.new(gem_name, gem_version)
|
138
|
+
return if gems_fetcher.gem_exists?(gem.filename(gem_version))
|
139
|
+
|
140
|
+
logger.info("Try to download #{gem_name} with version #{gem_version}")
|
143
141
|
gems_fetcher.source.gems.clear
|
144
142
|
gems_fetcher.source.gems.push(Gemirro::Gem.new(gem_name, gem_version))
|
145
143
|
gems_fetcher.fetch
|
144
|
+
|
145
|
+
update_indexes
|
146
146
|
rescue StandardError => e
|
147
147
|
logger.error(e.message)
|
148
148
|
end
|
149
|
-
|
150
|
-
update_indexes
|
151
149
|
end
|
152
150
|
|
153
151
|
##
|
data/lib/gemirro/version.rb
CHANGED