http_router 0.7.7 → 0.7.8

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.
@@ -11,12 +11,10 @@ class HttpRouter
11
11
 
12
12
  def [](request)
13
13
  if request.path.empty? or (request.path.size == 1 and request.path[0] == '') or @allow_partial
14
- catch(:pass) do
15
- request = request.clone
16
- request.continue = proc { |state| node_lookup(request) if state }
17
- params = @param_names.nil? ? {} : Hash[@param_names.zip(request.params)]
18
- @blk.call(request, params)
19
- end
14
+ request = request.clone
15
+ request.continue = proc { |state| node_lookup(request) if state }
16
+ params = @param_names.nil? ? {} : Hash[@param_names.zip(request.params)]
17
+ @blk.call(request, params)
20
18
  end
21
19
  end
22
20
 
@@ -273,7 +273,7 @@ class HttpRouter
273
273
  router.pass_on_response(response) ? throw(:pass) : throw(:success, response)
274
274
  elsif req.acceptance_test
275
275
  response = Response.new(req, path_obj)
276
- req.acceptance_test[response]
276
+ catch(:pass) { req.acceptance_test[response] }
277
277
  throw :success, response if response.acceptance_response
278
278
  else
279
279
  throw :success, Response.new(req, path_obj)
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  class HttpRouter #:nodoc
3
- VERSION = '0.7.7'
3
+ VERSION = '0.7.8'
4
4
  end
@@ -48,14 +48,6 @@ class TestArbitrary < MiniTest::Unit::TestCase
48
48
  assert_route r, '/test', {:test => 'test'}
49
49
  end
50
50
 
51
- def test_passing
52
- never, route = router {
53
- add('test').arbitrary(Proc.new{|req, params| throw :pass })
54
- add("test")
55
- }
56
- assert_route route, 'http://lovelove:8080/test'
57
- end
58
-
59
51
  def test_continue
60
52
  no, yes = router {
61
53
  add('test').arbitrary_with_continue{|req, p| req.continue[false]}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_router
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 7
10
- version: 0.7.7
9
+ - 8
10
+ version: 0.7.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Hull