omgf 0.0.4 → 0.0.5
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/GIT-VERSION-GEN +1 -1
- data/lib/omgf/hysterical_raisins.rb +1 -1
- data/test/test_hyst.rb +14 -0
- data/test/test_hysterical_raisins.rb +4 -4
- metadata +2 -2
data/GIT-VERSION-GEN
CHANGED
@@ -123,7 +123,7 @@ class OMGF::HystericalRaisins
|
|
123
123
|
fn = filename(h, query(env)) || key
|
124
124
|
h["Content-Type"] = key_mime_type(fn)
|
125
125
|
unless reproxy?(env, key, h, uris[0].to_s)
|
126
|
-
uris.each_with_index { |uri,i| h["X-
|
126
|
+
uris.each_with_index { |uri,i| h["X-Url-#{i}"] = uri.to_s }
|
127
127
|
end
|
128
128
|
[ 200, h, [] ]
|
129
129
|
end
|
data/test/test_hyst.rb
CHANGED
@@ -45,6 +45,20 @@ class TestHystScript < Test::Unit::TestCase
|
|
45
45
|
assert_equal "HI\n", out
|
46
46
|
assert_equal "HI\n", `#@hyst cat foo`
|
47
47
|
|
48
|
+
# ensure stat returns needed output
|
49
|
+
lines = `#@hyst stat foo`.split(/\n/)
|
50
|
+
|
51
|
+
key = lines.grep(/^Key: /)
|
52
|
+
assert_equal 1, key.size, lines
|
53
|
+
assert_equal "Key: foo", key[0]
|
54
|
+
|
55
|
+
size = lines.grep(/^Size: /)
|
56
|
+
assert_equal 1, size.size, lines
|
57
|
+
assert_equal "Size: 3", size[0]
|
58
|
+
|
59
|
+
urls = lines.grep(/^URL/)
|
60
|
+
assert_match(/^URL-0: /, urls[0], urls.inspect)
|
61
|
+
|
48
62
|
# /dev/null optimization
|
49
63
|
out = `echo NULL | #@hyst tee bar >/dev/null`
|
50
64
|
assert_equal 0, $?
|
@@ -184,18 +184,18 @@ class TestHystericalRaisins < Test::Unit::TestCase
|
|
184
184
|
assert_equal 0, @err.string.size, @err.string
|
185
185
|
assert_equal 200, resp.status, resp.inspect
|
186
186
|
assert_equal "4", resp["Content-Length"]
|
187
|
-
assert_equal "BLAH", open(resp["X-
|
187
|
+
assert_equal "BLAH", open(resp["X-Url-0"]).read
|
188
188
|
|
189
189
|
# wait for replication
|
190
190
|
if ENV["EXPENSIVE"]
|
191
191
|
50.times do
|
192
192
|
resp = @req.head("/testdom/key", @opts)
|
193
193
|
assert_equal 200, resp.status, resp.inspect
|
194
|
-
resp["X-
|
194
|
+
resp["X-Url-1"] and break
|
195
195
|
sleep 0.5
|
196
196
|
end
|
197
|
-
assert_kind_of String, resp["X-
|
198
|
-
assert_equal "BLAH", open(resp["X-
|
197
|
+
assert_kind_of String, resp["X-Url-1"], resp.inspect
|
198
|
+
assert_equal "BLAH", open(resp["X-Url-1"]).read
|
199
199
|
|
200
200
|
# Location should not be in X-Alt-Location, too
|
201
201
|
resp = @req.get("/testdom/key", @opts)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: !binary |-
|
3
3
|
b21nZg==
|
4
4
|
version: !ruby/object:Gem::Version
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
prerelease:
|
7
7
|
platform: ruby
|
8
8
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-03-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: !binary |-
|