alice 0.1.2 → 0.1.3

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{alice}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["rick"]
12
- s.date = %q{2010-01-08}
12
+ s.date = %q{2010-01-12}
13
13
  s.description = %q{HTTP/REST API client library using Rack-like middleware}
14
14
  s.email = %q{technoweenie@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -74,15 +74,20 @@ module Alice
74
74
  yield stubs
75
75
  end
76
76
 
77
+ def request_uri url
78
+ (url.path != "" ? url.path : "/") +
79
+ (url.query ? "?#{url.query}" : "")
80
+ end
81
+
77
82
  def call(env)
78
- if stub = stubs.match(env[:method], env[:url].path, env[:body])
83
+ if stub = stubs.match(env[:method], request_uri(env[:url]), env[:body])
79
84
  status, headers, body = stub.block.call(env)
80
85
  env.update \
81
86
  :status => status,
82
87
  :response_headers => headers,
83
88
  :body => body
84
89
  else
85
- raise "no stubbed request for #{env[:method]} #{env[:url].path} with #{env[:body]}"
90
+ raise "no stubbed request for #{env[:method]} #{request_uri(env[:url])} #{env[:body]}"
86
91
  end
87
92
  @app.call(env)
88
93
  end
@@ -180,4 +180,4 @@ module Alice
180
180
  end
181
181
  end
182
182
  end
183
- end
183
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - rick
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-08 00:00:00 -08:00
12
+ date: 2010-01-12 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency