geminabox 0.13.3 → 0.13.4
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.
Potentially problematic release.
This version of geminabox might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/geminabox/proxy/copier.rb +3 -1
- data/lib/geminabox/proxy/file_handler.rb +2 -1
- data/lib/geminabox/proxy/splicer.rb +14 -10
- data/lib/geminabox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06c1719b0b3d8508755171751405a9e44a65b3d8
|
4
|
+
data.tar.gz: 2a843634e631cd122dfead4d0ff7f9b28c114934
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26576e1a5defefbbe0eef931d707a459fdfd4a172dc243828bd1dcc3bc6e9bf80ab491fd1a415c7720c5030c0c7ba010f6d3fa2864efd94ffab2fbd64d0c7169
|
7
|
+
data.tar.gz: efd5805d53e8265f3e0929d257e160d3aa5a2c731d7d80f8e14e9b1814e5023b8c5107a8af938eff52e6c8e398c493cfb13a41e141e8b93dca6814a741f8be8d
|
@@ -22,7 +22,9 @@ module Geminabox
|
|
22
22
|
|
23
23
|
def get_remote
|
24
24
|
begin
|
25
|
-
|
25
|
+
if rc = remote_content
|
26
|
+
File.open(proxy_path, 'w'){|f| f.write(rc) }
|
27
|
+
end
|
26
28
|
rescue
|
27
29
|
File.unlink(proxy_path) if File.exists?(proxy_path)
|
28
30
|
raise $!
|
@@ -45,11 +45,12 @@ module Geminabox
|
|
45
45
|
def remote_content
|
46
46
|
Geminabox.http_adapter.get_content(remote_url).force_encoding(encoding)
|
47
47
|
rescue
|
48
|
+
return nil if Geminabox.allow_remote_failure
|
48
49
|
raise GemStoreError.new(500, "Unable to get content from #{remote_url}")
|
49
50
|
end
|
50
51
|
|
51
52
|
def remote_url
|
52
|
-
|
53
|
+
URI.join(Geminabox.ruby_gems_url, file_name)
|
53
54
|
end
|
54
55
|
|
55
56
|
def local_content
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'tempfile'
|
2
|
+
require 'fileutils'
|
2
3
|
|
3
4
|
module Geminabox
|
4
5
|
module Proxy
|
@@ -11,16 +12,15 @@ module Geminabox
|
|
11
12
|
end
|
12
13
|
|
13
14
|
def create
|
14
|
-
data = new_content
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
if data = new_content
|
16
|
+
f = Tempfile.create('geminabox')
|
17
|
+
begin
|
18
|
+
f.write(data)
|
19
|
+
ensure
|
20
|
+
f.close rescue nil
|
21
|
+
end
|
22
|
+
FileUtils.mv f.path, splice_path
|
21
23
|
end
|
22
|
-
|
23
|
-
FileUtils.mv tmp, splice_path
|
24
24
|
end
|
25
25
|
|
26
26
|
def new_content
|
@@ -57,7 +57,11 @@ module Geminabox
|
|
57
57
|
|
58
58
|
private
|
59
59
|
def merge_gziped_content
|
60
|
-
|
60
|
+
if rc = remote_content
|
61
|
+
package(unpackage(local_content) | unpackage(rc))
|
62
|
+
else
|
63
|
+
local_content
|
64
|
+
end
|
61
65
|
end
|
62
66
|
|
63
67
|
def unpackage(content)
|
data/lib/geminabox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geminabox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Lea
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-10-
|
14
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sinatra
|