omgf 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
  CONSTANT = "OMGF::VERSION"
3
3
  RVF = "lib/omgf/version.rb"
4
4
  GVF = "GIT-VERSION-FILE"
5
- DEF_VER = "v0.0.4"
5
+ DEF_VER = "v0.0.5"
6
6
  vn = DEF_VER
7
7
 
8
8
  # First see if there is a version file (included in release tarballs),
@@ -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-URL-#{i}"] = uri.to_s }
126
+ uris.each_with_index { |uri,i| h["X-Url-#{i}"] = uri.to_s }
127
127
  end
128
128
  [ 200, h, [] ]
129
129
  end
@@ -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-URL-0"]).read
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-URL-1"] and break
194
+ resp["X-Url-1"] and break
195
195
  sleep 0.5
196
196
  end
197
- assert_kind_of String, resp["X-URL-1"], resp.inspect
198
- assert_equal "BLAH", open(resp["X-URL-1"]).read
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.4
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-02-21 00:00:00.000000000 Z
14
+ date: 2013-03-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: !binary |-