weary 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/lib/weary/middleware/basic_auth.rb +1 -1
- data/lib/weary/resource.rb +2 -2
- data/lib/weary/version.rb +1 -1
- data/spec/weary/resource_spec.rb +7 -1
- data/weary.gemspec +1 -1
- metadata +13 -19
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
weary (1.0.
|
4
|
+
weary (1.0.1)
|
5
5
|
addressable (~> 2.2.7)
|
6
|
-
multi_json (~> 1.
|
6
|
+
multi_json (~> 1.2.0)
|
7
7
|
promise (~> 0.3.0)
|
8
8
|
rack (~> 1.4.0)
|
9
9
|
simple_oauth (~> 0.1.5)
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
addressable (2.2.7)
|
15
15
|
crack (0.3.1)
|
16
16
|
diff-lcs (1.1.3)
|
17
|
-
multi_json (1.
|
17
|
+
multi_json (1.2.0)
|
18
18
|
promise (0.3.0)
|
19
19
|
rack (1.4.1)
|
20
20
|
rake (0.9.2.2)
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ This is a basic example of a client you will build using the Weary framework. If
|
|
47
47
|
Inherit from `Weary::Client` for a set of class methods that craft "Resources" (more on that later).
|
48
48
|
|
49
49
|
```ruby
|
50
|
-
MyClass < Weary::Client
|
50
|
+
class MyClass < Weary::Client
|
51
51
|
get :resource, "http://host.com/path/to/resource" do |resource|
|
52
52
|
resource.optional :optional_parameter
|
53
53
|
end
|
data/lib/weary/resource.rb
CHANGED
@@ -22,7 +22,7 @@ module Weary
|
|
22
22
|
#
|
23
23
|
# Returns an Addressable::Template
|
24
24
|
def url(uri=nil)
|
25
|
-
@uri = Addressable::Template.new(uri.gsub(/:(\w+)/) { "{#{$1}}" }) unless uri.nil?
|
25
|
+
@uri = Addressable::Template.new(uri.gsub(/:(?![0-9])(\w+)/) { "{#{$1}}" }) unless uri.nil?
|
26
26
|
@uri
|
27
27
|
end
|
28
28
|
|
@@ -156,4 +156,4 @@ module Weary
|
|
156
156
|
|
157
157
|
|
158
158
|
end
|
159
|
-
end
|
159
|
+
end
|
data/lib/weary/version.rb
CHANGED
data/spec/weary/resource_spec.rb
CHANGED
@@ -32,6 +32,12 @@ describe Weary::Resource do
|
|
32
32
|
resource = Weary::Resource.new "GET", url
|
33
33
|
resource.url.variables.should include 'user'
|
34
34
|
end
|
35
|
+
|
36
|
+
it "accepts port numbers in the url" do
|
37
|
+
url = "http://localhost:3000/api/v2/"
|
38
|
+
resource = Weary::Resource.new "GET", url
|
39
|
+
resource.url.variables.should_not include '3000'
|
40
|
+
end
|
35
41
|
end
|
36
42
|
|
37
43
|
describe "#optional" do
|
@@ -253,4 +259,4 @@ describe Weary::Resource do
|
|
253
259
|
req.params.should eql "user_id=markwunsch"
|
254
260
|
end
|
255
261
|
end
|
256
|
-
end
|
262
|
+
end
|
data/weary.gemspec
CHANGED
@@ -21,5 +21,5 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_runtime_dependency "addressable", "~> 2.2.7"
|
22
22
|
s.add_runtime_dependency "promise", "~> 0.3.0"
|
23
23
|
s.add_runtime_dependency "simple_oauth", "~> 0.1.5"
|
24
|
-
s.add_runtime_dependency "multi_json", "~> 1.
|
24
|
+
s.add_runtime_dependency "multi_json", "~> 1.2.0"
|
25
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
-
requirement: &
|
16
|
+
requirement: &70166012867980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.4.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70166012867980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: addressable
|
27
|
-
requirement: &
|
27
|
+
requirement: &70166012867300 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.2.7
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70166012867300
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: promise
|
38
|
-
requirement: &
|
38
|
+
requirement: &70166012866680 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.3.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70166012866680
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simple_oauth
|
49
|
-
requirement: &
|
49
|
+
requirement: &70166012866020 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,18 +54,18 @@ dependencies:
|
|
54
54
|
version: 0.1.5
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70166012866020
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: multi_json
|
60
|
-
requirement: &
|
60
|
+
requirement: &70166012864500 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 1.
|
65
|
+
version: 1.2.0
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70166012864500
|
69
69
|
description: ! 'A framework and DSL to construct Ruby clients to RESTful web services. '
|
70
70
|
email: mark@markwunsch.com
|
71
71
|
executables: []
|
@@ -125,18 +125,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- - ! '>='
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
|
-
segments:
|
129
|
-
- 0
|
130
|
-
hash: -931495693225517600
|
131
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
129
|
none: false
|
133
130
|
requirements:
|
134
131
|
- - ! '>='
|
135
132
|
- !ruby/object:Gem::Version
|
136
133
|
version: '0'
|
137
|
-
segments:
|
138
|
-
- 0
|
139
|
-
hash: -931495693225517600
|
140
134
|
requirements: []
|
141
135
|
rubyforge_project: weary
|
142
136
|
rubygems_version: 1.8.11
|