resto 0.0.7 → 0.0.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.
- data/lib/resto.rb +3 -3
- data/lib/resto/property/handler.rb +4 -4
- data/lib/resto/property/time.rb +53 -7
- data/lib/resto/request/option.rb +2 -2
- data/lib/resto/version.rb +1 -1
- data/resto.gemspec +2 -2
- data/spec/resto/extra/copy_spec.rb +13 -13
- data/spec/resto/extra/hash_args_spec.rb +18 -18
- data/spec/resto/property/handler_spec.rb +2 -2
- data/spec/resto/property/time_spec.rb +25 -4
- data/spec/resto/property_spec.rb +2 -2
- data/spec/resto/request/base_spec.rb +22 -22
- data/spec/resto/request/factory_spec.rb +39 -39
- data/spec/resto_spec.rb +126 -112
- data/spec/spec_helper.rb +3 -0
- metadata +67 -5
data/lib/resto.rb
CHANGED
@@ -63,7 +63,7 @@ module Resto
|
|
63
63
|
|
64
64
|
@#{name} ||= {}
|
65
65
|
|
66
|
-
@#{name}[params] ||= #{class_name.capitalize}.
|
66
|
+
@#{name}[params] ||= #{class_name.to_s.capitalize}.
|
67
67
|
all({#{params}}.update(params), {#{relation}})
|
68
68
|
end
|
69
69
|
}
|
@@ -76,9 +76,9 @@ module Resto
|
|
76
76
|
method_definition = %Q{
|
77
77
|
def #{name}(reload = false)
|
78
78
|
if reload
|
79
|
-
@#{name} = #{name.capitalize}.get(#{name}_id)
|
79
|
+
@#{name} = #{name.to_s.capitalize}.get(#{name}_id)
|
80
80
|
else
|
81
|
-
@#{name} ||= #{name.capitalize}.get(#{name}_id)
|
81
|
+
@#{name} ||= #{name.to_s.capitalize}.get(#{name}_id)
|
82
82
|
end
|
83
83
|
end
|
84
84
|
}
|
@@ -9,10 +9,10 @@ module Resto
|
|
9
9
|
|
10
10
|
def add(property)
|
11
11
|
@properties_with_indifferent_access.store(property.remote_key, property)
|
12
|
-
@properties_with_indifferent_access
|
13
|
-
|
14
|
-
@properties_with_indifferent_access
|
15
|
-
|
12
|
+
@properties_with_indifferent_access.
|
13
|
+
store(property.attribute_key, property)
|
14
|
+
@properties_with_indifferent_access.
|
15
|
+
store(property.attribute_key_as_string, property)
|
16
16
|
|
17
17
|
@properties.store(property.attribute_key, property)
|
18
18
|
end
|
data/lib/resto/property/time.rb
CHANGED
@@ -14,6 +14,8 @@ module Resto
|
|
14
14
|
|
15
15
|
def initialize(name, options={})
|
16
16
|
@key = (name.to_s + "_time").to_sym
|
17
|
+
@format = options[:format]
|
18
|
+
@delimiter = @format.to_s.match(/(\W)/) { |m| m[0] }
|
17
19
|
super
|
18
20
|
end
|
19
21
|
|
@@ -22,22 +24,66 @@ module Resto
|
|
22
24
|
|
23
25
|
formatted_value = value.to_s.strip
|
24
26
|
if formatted_value.gsub(/([a-z|A-Z]{1,5}\Z)/, '') =~ /[^T\d\-:\+\/\s]/
|
25
|
-
|
27
|
+
errors.store(@key, ":#{attribute_key} is not a valid time format.")
|
28
|
+
formatted_value = ""
|
26
29
|
end
|
27
30
|
|
28
31
|
number_of_digits = formatted_value.gsub(/\D/, '').length
|
29
|
-
if (1..
|
30
|
-
|
32
|
+
if (1..9).include?(number_of_digits)
|
33
|
+
errors.store(@key, ":#{attribute_key} is not a valid time format.")
|
34
|
+
formatted_value = ""
|
31
35
|
end
|
32
36
|
|
33
37
|
begin
|
34
|
-
formatted_value.empty?
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
if formatted_value.empty?
|
39
|
+
nil
|
40
|
+
else
|
41
|
+
::Time.parse(from_format(formatted_value))
|
38
42
|
end
|
43
|
+
rescue ArgumentError, TypeError, NoMethodError
|
44
|
+
errors.store(@key, ":#{attribute_key} is not a valid time format.")
|
45
|
+
nil
|
39
46
|
end
|
40
47
|
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def from_format(value)
|
52
|
+
if @format
|
53
|
+
first_date_part = value.split("#{@delimiter}")
|
54
|
+
|
55
|
+
reminder = first_date_part.delete_at(2)
|
56
|
+
last = reminder.gsub(/\A(\d+)/) { $1 + "SPLIT" }.split("SPLIT")
|
57
|
+
last_date_part = last[0]
|
58
|
+
|
59
|
+
time_and_zone = last[1]
|
60
|
+
date = first_date_part << last_date_part
|
61
|
+
"#{date.at(year)}-#{date.at(month)}-#{date.at(day)}#{time_and_zone}"
|
62
|
+
else
|
63
|
+
value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def to_format
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
def day
|
72
|
+
split_format.index('dd')
|
73
|
+
end
|
74
|
+
|
75
|
+
def month
|
76
|
+
split_format.index('mm')
|
77
|
+
end
|
78
|
+
|
79
|
+
def year
|
80
|
+
split_format.index('yyyy')
|
81
|
+
end
|
82
|
+
|
83
|
+
def split_format
|
84
|
+
@split_format ||= @format.split("#{@delimiter}")
|
85
|
+
end
|
86
|
+
|
41
87
|
end
|
42
88
|
end
|
43
89
|
end
|
data/lib/resto/request/option.rb
CHANGED
@@ -100,8 +100,8 @@ module Resto
|
|
100
100
|
tap { options.store(:open_timeout, time)}
|
101
101
|
end
|
102
102
|
|
103
|
-
# Number of seconds to wait for one block to be read (via one read(2)
|
104
|
-
# If the HTTP object cannot read data in this many seconds,
|
103
|
+
# Number of seconds to wait for one block to be read (via one read(2)
|
104
|
+
# call). If the HTTP object cannot read data in this many seconds,
|
105
105
|
# it raises a TimeoutError exception.
|
106
106
|
def read_timeout(time)#
|
107
107
|
tap { options.store(:read_timeout, time)}
|
data/lib/resto/version.rb
CHANGED
data/resto.gemspec
CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_runtime_dependency "yajl-ruby", "0.8.2"
|
21
21
|
s.add_runtime_dependency "nokogiri", ">=1.4.4"
|
22
22
|
# s.add_dependency "activesupport", "3.0.0" ???
|
23
|
-
s.add_development_dependency "bundler", ">= 1.0.
|
24
|
-
s.add_development_dependency "rspec", ">= 2.
|
23
|
+
s.add_development_dependency "bundler", ">= 1.0.13"
|
24
|
+
s.add_development_dependency "rspec", ">= 2.6.0"
|
25
25
|
s.add_development_dependency "fuubar", ">= 0.0.4"
|
26
26
|
s.add_development_dependency "webmock", ">= 1.6.2"
|
27
27
|
s.add_development_dependency "code-cleaner", ">= 0.8.2"
|
@@ -5,17 +5,17 @@ require 'resto/extra/copy'
|
|
5
5
|
describe Resto::Extra::Copy do
|
6
6
|
describe ".request_base" do
|
7
7
|
before do
|
8
|
-
@request_base = Resto::Request::Base.new.port(40)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
@new_request_base = Resto::Extra::Copy.request_base(@request_base)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
8
|
+
@request_base = Resto::Request::Base.new.port(40).
|
9
|
+
url('http://www.aftonbladet.se:92/customers').
|
10
|
+
query('q=adam').
|
11
|
+
path('contacts')
|
12
|
+
|
13
|
+
@new_request_base = Resto::Extra::Copy.request_base(@request_base).
|
14
|
+
url('http://new.se:99/other').
|
15
|
+
query('q=not-same').
|
16
|
+
path('other-contacts/').
|
17
|
+
headers({ "accept"=> "other", "user-agent"=> "Ruby" }).
|
18
|
+
append_path(2)
|
19
19
|
end
|
20
20
|
|
21
21
|
it { @new_request_base.object_id.should_not == @request_base.object_id }
|
@@ -47,8 +47,8 @@ describe Resto::Extra::Copy do
|
|
47
47
|
describe ".response_base" do
|
48
48
|
before do
|
49
49
|
@response_base = Resto::Response::Base.new.format(:json)
|
50
|
-
@new_response_base = Resto::Extra::Copy.response_base(@response_base)
|
51
|
-
|
50
|
+
@new_response_base = Resto::Extra::Copy.response_base(@response_base).
|
51
|
+
http_response('response')
|
52
52
|
end
|
53
53
|
|
54
54
|
it { @response_base.instance_eval { @response }.should == nil }
|
@@ -16,13 +16,13 @@ describe Resto::Extra::HashArgs do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "returns the value found by the key" do
|
19
|
-
BasicAuthication.new({'username' => 'anders', :password => 'secret'})
|
20
|
-
|
19
|
+
BasicAuthication.new({'username' => 'anders', :password => 'secret'}).
|
20
|
+
fetch(:password) { 'other' }.should == 'secret'
|
21
21
|
end
|
22
22
|
|
23
23
|
it "the key is translated to its symbol" do
|
24
|
-
BasicAuthication.new({'username' => 'anders', :password => 'secret'})
|
25
|
-
|
24
|
+
BasicAuthication.new({'username' => 'anders', :password => 'secret'}).
|
25
|
+
fetch(:username) { 'other' }.should == 'anders'
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -38,34 +38,34 @@ describe Resto::Extra::HashArgs do
|
|
38
38
|
if RUBY_VERSION < '1.9'
|
39
39
|
|
40
40
|
it "raises IndexError when no value and no block" do
|
41
|
-
expect { FormatExt.new({}).fetch(:extension) }
|
42
|
-
|
41
|
+
expect { FormatExt.new({}).fetch(:extension) }.
|
42
|
+
to raise_error(IndexError, 'key not found')
|
43
43
|
end
|
44
44
|
|
45
45
|
else
|
46
46
|
|
47
47
|
it "raises KeyError when no value and no block" do
|
48
|
-
lambda { FormatExt.new({}).fetch(:extension) }
|
49
|
-
|
48
|
+
lambda { FormatExt.new({}).fetch(:extension) }.
|
49
|
+
should raise_error(KeyError, 'key not found: :extension')
|
50
50
|
end
|
51
51
|
|
52
52
|
end
|
53
53
|
|
54
54
|
it "raises" do
|
55
|
-
expect { FormatExt.new({:username => "anders"}) }
|
56
|
-
|
55
|
+
expect { FormatExt.new({:username => "anders"}) }.
|
56
|
+
to raise_error(ArgumentError, /The key 'username'/)
|
57
57
|
|
58
|
-
expect { FormatExt.new("string") }
|
59
|
-
|
58
|
+
expect { FormatExt.new("string") }.
|
59
|
+
to raise_error(ArgumentError, "'string' must be a Hash")
|
60
60
|
|
61
|
-
expect { FormatExt.new(:extension => 'value', 'extension' => 'value') }
|
62
|
-
|
61
|
+
expect { FormatExt.new(:extension => 'value', 'extension' => 'value') }.
|
62
|
+
to raise_error(ArgumentError, "duplicated keys: extension, extension")
|
63
63
|
|
64
|
-
expect { FormatExt.new({:invalid_key => 'invalid' }) }
|
65
|
-
|
64
|
+
expect { FormatExt.new({:invalid_key => 'invalid' }) }.
|
65
|
+
to raise_error(ArgumentError, /The key 'invalid_key' is not valid/)
|
66
66
|
|
67
|
-
expect { FormatExt.new({:extension => 'value' }).fetch(:invalid_key) }
|
68
|
-
|
67
|
+
expect { FormatExt.new({:extension => 'value' }).fetch(:invalid_key) }.
|
68
|
+
to raise_error(ArgumentError, /The key 'invalid_key' is not valid/)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
@@ -47,8 +47,8 @@ describe Resto::Property::Handler do
|
|
47
47
|
it { article.errors.fetch(:title_presence, false).should == nil }
|
48
48
|
|
49
49
|
it do
|
50
|
-
article.errors.fetch(:empty_title_presence, false)
|
51
|
-
|
50
|
+
article.errors.fetch(:empty_title_presence, false).
|
51
|
+
should == ":empty_title can’t be blank"
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -12,10 +12,12 @@ describe Resto::Property::Time do
|
|
12
12
|
let(:iso_8601_cet_winter) { "2011-01-01T14:46:00+01:00" } #GMT +1, UTC +1
|
13
13
|
|
14
14
|
let(:errors) { {} }
|
15
|
-
|
15
|
+
|
16
16
|
|
17
17
|
describe ".cast(time_string, errors)" do
|
18
|
-
|
18
|
+
subject { Resto::Property::Time.new(:date_of_birth) }
|
19
|
+
|
20
|
+
context "local time is 2010-10-25T12:00:00 PST", :ruby => 1.9 do
|
19
21
|
it "returns a time object parsed from the string" do
|
20
22
|
at_time("2010-10-25T12:00:00 PST", '-08:00') do #UTC -8
|
21
23
|
time = subject.cast(iso_8601_plus, errors)
|
@@ -74,7 +76,7 @@ describe Resto::Property::Time do
|
|
74
76
|
end
|
75
77
|
|
76
78
|
context ".cast('q', errors)" do
|
77
|
-
it("returns nil and sets errors[:date_of_birth_time]") do
|
79
|
+
it("returns nil and sets errors[:date_of_birth_time]", :ruby => 1.9) do
|
78
80
|
subject.cast('q', errors).should == nil
|
79
81
|
errors.fetch(:date_of_birth_time, false).should ==
|
80
82
|
':date_of_birth is not a valid time format.'
|
@@ -113,7 +115,7 @@ describe Resto::Property::Time do
|
|
113
115
|
end
|
114
116
|
end
|
115
117
|
|
116
|
-
context ".cast('22/02/2010 00:00:00 UTC', errors)" do
|
118
|
+
context ".cast('22/02/2010 00:00:00 UTC', errors)", :ruby => 1.9 do
|
117
119
|
it("returns a time object parsed from the string") do
|
118
120
|
time = subject.cast('22/02/2010 00:00:00 UTC', errors)
|
119
121
|
time.utc.iso8601.should == '2010-02-22T00:00:00Z'
|
@@ -121,4 +123,23 @@ describe Resto::Property::Time do
|
|
121
123
|
end
|
122
124
|
end
|
123
125
|
end
|
126
|
+
|
127
|
+
context ":format => 'mm/dd/yyyy'" do
|
128
|
+
subject do
|
129
|
+
Resto::Property::Time.new(:date_of_birth, :format => 'mm/dd/yyyy')
|
130
|
+
end
|
131
|
+
|
132
|
+
it("returns a time object parsed from the string") do
|
133
|
+
time = subject.cast('02/22/2010 00:00:00 UTC', errors)
|
134
|
+
time.utc.iso8601.should == '2010-02-22T00:00:00Z'
|
135
|
+
errors.fetch(:date_of_birth_time, false).should == nil
|
136
|
+
end
|
137
|
+
|
138
|
+
it("returns nil and sets errors") do
|
139
|
+
subject.cast('ddd', errors).should == nil
|
140
|
+
errors.fetch(:date_of_birth_time, false).should ==
|
141
|
+
':date_of_birth is not a valid time format.'
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
124
145
|
end
|
data/spec/resto/property_spec.rb
CHANGED
@@ -50,8 +50,8 @@ describe Resto::Property do
|
|
50
50
|
before { subject.validate(article, :empty_title) }
|
51
51
|
|
52
52
|
it {
|
53
|
-
article.errors[:empty_title_presence]
|
54
|
-
|
53
|
+
article.errors[:empty_title_presence].
|
54
|
+
should == ":empty_title can’t be blank"
|
55
55
|
}
|
56
56
|
end
|
57
57
|
end
|
@@ -20,8 +20,8 @@ describe Resto::Request::Base do
|
|
20
20
|
|
21
21
|
describe "@request" do
|
22
22
|
it do
|
23
|
-
subject.instance_eval { @request }
|
24
|
-
|
23
|
+
subject.instance_eval { @request }.
|
24
|
+
should be_instance_of(Resto::Request::Factory)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -39,8 +39,8 @@ describe Resto::Request::Base do
|
|
39
39
|
context "#content_type('text/html').headers({'content-type' => 'text/plain',
|
40
40
|
'User-agent' => 'Ruby' })" do
|
41
41
|
before do
|
42
|
-
subject.content_type('text/html')
|
43
|
-
|
42
|
+
subject.content_type('text/html').
|
43
|
+
headers({'content-type' => 'text/plain', 'user-agent' => 'Ruby' })
|
44
44
|
end
|
45
45
|
|
46
46
|
its(:composed_headers) do
|
@@ -54,8 +54,8 @@ describe Resto::Request::Base do
|
|
54
54
|
.content_type('text/html')" do
|
55
55
|
|
56
56
|
before do
|
57
|
-
subject.basic_auth('username' => "developer", "password" => "secret")
|
58
|
-
|
57
|
+
subject.basic_auth('username' => "developer", "password" => "secret").
|
58
|
+
content_type('text/html')
|
59
59
|
end
|
60
60
|
|
61
61
|
its(:composed_headers) do
|
@@ -112,9 +112,9 @@ describe Resto::Request::Base do
|
|
112
112
|
.params('longUrl' => 'http://betaworks.com', 'short' => 'htt')" do
|
113
113
|
|
114
114
|
before do
|
115
|
-
subject.url('http://www.aftonbladet.se:92/customers')
|
116
|
-
|
117
|
-
|
115
|
+
subject.url('http://www.aftonbladet.se:92/customers').
|
116
|
+
query('q=adam').
|
117
|
+
params('longUrl' => 'http://betaworks.com', 'short' => 'htt')
|
118
118
|
end
|
119
119
|
|
120
120
|
its(:read_host) { should == 'www.aftonbladet.se' }
|
@@ -130,10 +130,10 @@ describe Resto::Request::Base do
|
|
130
130
|
.path('contacts')" do
|
131
131
|
|
132
132
|
before do
|
133
|
-
subject.port(40)
|
134
|
-
|
135
|
-
|
136
|
-
|
133
|
+
subject.port(40).
|
134
|
+
url('http://www.aftonbladet.se:92/customers').
|
135
|
+
query('q=adam').
|
136
|
+
path('contacts')
|
137
137
|
end
|
138
138
|
|
139
139
|
its(:read_host) { should == 'www.aftonbladet.se' }
|
@@ -154,8 +154,8 @@ describe Resto::Request::Base do
|
|
154
154
|
.append_path(1)" do
|
155
155
|
|
156
156
|
before do
|
157
|
-
subject.url('http://www.aftonbladet.se:92/customers/?q=adam')
|
158
|
-
|
157
|
+
subject.url('http://www.aftonbladet.se:92/customers/?q=adam').
|
158
|
+
append_path(1)
|
159
159
|
end
|
160
160
|
|
161
161
|
its(:read_host) { should == 'www.aftonbladet.se' }
|
@@ -167,8 +167,8 @@ describe Resto::Request::Base do
|
|
167
167
|
.query('q=take presendent')" do
|
168
168
|
|
169
169
|
before do
|
170
|
-
subject.url('http://www.aftonbladet.se:92/customers/?q=adam')
|
171
|
-
|
170
|
+
subject.url('http://www.aftonbladet.se:92/customers/?q=adam').
|
171
|
+
query("q=take presendent")
|
172
172
|
end
|
173
173
|
|
174
174
|
its(:read_host) { should == 'www.aftonbladet.se' }
|
@@ -181,9 +181,9 @@ describe Resto::Request::Base do
|
|
181
181
|
.query('q=take presendent')" do
|
182
182
|
|
183
183
|
before do
|
184
|
-
subject.host('www.take-presedent.se')
|
185
|
-
|
186
|
-
|
184
|
+
subject.host('www.take-presedent.se').
|
185
|
+
url('http://www.aftonbladet.se:92/customers/?q=adam').
|
186
|
+
query('q=take presendent')
|
187
187
|
end
|
188
188
|
|
189
189
|
its(:read_host) { should == 'www.take-presedent.se' }
|
@@ -207,8 +207,8 @@ describe Resto::Request::Base do
|
|
207
207
|
|
208
208
|
context "when formatter is Resto::Format::Json" do
|
209
209
|
before do
|
210
|
-
subject.format(:json)
|
211
|
-
|
210
|
+
subject.format(:json).
|
211
|
+
body( { :foo => 12425125, :bar => "some string" } )
|
212
212
|
end
|
213
213
|
|
214
214
|
its(:read_body) do
|
@@ -9,19 +9,19 @@ describe Resto::Request::Factory do
|
|
9
9
|
let(:base) { Resto::Request::Base.new }
|
10
10
|
|
11
11
|
subject do
|
12
|
-
factory.new(base
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
factory.new(base.
|
13
|
+
host('sr.se').
|
14
|
+
port(8080).
|
15
|
+
headers('content-type' => 'text/html').
|
16
|
+
body('Anders').
|
17
|
+
path('/dashboard'))
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "#head" do
|
21
21
|
before do
|
22
|
-
stub_request(:head, "sr.se:8080/dashboard")
|
23
|
-
|
24
|
-
|
22
|
+
stub_request(:head, "sr.se:8080/dashboard").
|
23
|
+
with(:headers => headers("content-type" => "text/html")).
|
24
|
+
to_return(:status => 200)
|
25
25
|
end
|
26
26
|
|
27
27
|
it { subject.head.code.should == "200" }
|
@@ -29,9 +29,9 @@ describe Resto::Request::Factory do
|
|
29
29
|
|
30
30
|
describe "#get" do
|
31
31
|
before do
|
32
|
-
stub_request(:get, "sr.se:8080/dashboard")
|
33
|
-
|
34
|
-
|
32
|
+
stub_request(:get, "sr.se:8080/dashboard").
|
33
|
+
with(:headers => headers("content-type" => "text/html")).
|
34
|
+
to_return(:status => 200)
|
35
35
|
end
|
36
36
|
|
37
37
|
it { subject.get.code.should == "200" }
|
@@ -39,10 +39,10 @@ describe Resto::Request::Factory do
|
|
39
39
|
|
40
40
|
describe "#post" do
|
41
41
|
before do
|
42
|
-
stub_request(:post, "sr.se:8080/dashboard")
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
stub_request(:post, "sr.se:8080/dashboard").
|
43
|
+
with(:headers => headers("content-type" => "text/html"),
|
44
|
+
:body => 'Anders').
|
45
|
+
to_return(:status => 200)
|
46
46
|
end
|
47
47
|
|
48
48
|
it { subject.post.code.should == "200" }
|
@@ -50,10 +50,10 @@ describe Resto::Request::Factory do
|
|
50
50
|
|
51
51
|
describe "#put" do
|
52
52
|
before do
|
53
|
-
stub_request(:put, "sr.se:8080/dashboard")
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
stub_request(:put, "sr.se:8080/dashboard").
|
54
|
+
with(:headers => headers("content-type" => "text/html"),
|
55
|
+
:body => 'Anders').
|
56
|
+
to_return(:status => 200)
|
57
57
|
end
|
58
58
|
|
59
59
|
it { subject.put.code.should == "200" }
|
@@ -61,9 +61,9 @@ describe Resto::Request::Factory do
|
|
61
61
|
|
62
62
|
describe "#delete" do
|
63
63
|
before do
|
64
|
-
stub_request(:delete, "sr.se:8080/dashboard")
|
65
|
-
|
66
|
-
|
64
|
+
stub_request(:delete, "sr.se:8080/dashboard").
|
65
|
+
with(:headers => headers("content-type" => "text/html")).
|
66
|
+
to_return(:status => 200)
|
67
67
|
end
|
68
68
|
|
69
69
|
it { subject.delete.code.should == "200" }
|
@@ -72,19 +72,19 @@ describe Resto::Request::Factory do
|
|
72
72
|
|
73
73
|
context "other settings" do
|
74
74
|
subject do
|
75
|
-
factory.new(Resto::Request::Base.new
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
factory.new(Resto::Request::Base.new.
|
76
|
+
host('sr.se').
|
77
|
+
path('/friends_timeline').
|
78
|
+
body('Anders').
|
79
|
+
headers('content-type' => 'application/xml').
|
80
|
+
basic_auth(:username => 'developer', :password => 'secret'))
|
81
81
|
end
|
82
82
|
|
83
83
|
describe "#head" do
|
84
84
|
before do
|
85
|
-
stub_request(:head, "developer:secret@sr.se/friends_timeline")
|
86
|
-
|
87
|
-
|
85
|
+
stub_request(:head, "developer:secret@sr.se/friends_timeline").
|
86
|
+
with(:headers => headers("content-type" => "application/xml")).
|
87
|
+
to_return(:status => 200)
|
88
88
|
end
|
89
89
|
|
90
90
|
it { subject.head.code.should == "200" }
|
@@ -92,9 +92,9 @@ describe Resto::Request::Factory do
|
|
92
92
|
|
93
93
|
describe "#get" do
|
94
94
|
before do
|
95
|
-
stub_request(:get, "developer:secret@sr.se/friends_timeline")
|
96
|
-
|
97
|
-
|
95
|
+
stub_request(:get, "developer:secret@sr.se/friends_timeline").
|
96
|
+
with(:headers => headers("content-type" => "application/xml")).
|
97
|
+
to_return(:status => 200)
|
98
98
|
end
|
99
99
|
|
100
100
|
it { subject.get.code.should == "200" }
|
@@ -102,10 +102,10 @@ describe Resto::Request::Factory do
|
|
102
102
|
|
103
103
|
describe "#post" do
|
104
104
|
before do
|
105
|
-
stub_request(:post, "developer:secret@sr.se/friends_timeline")
|
106
|
-
|
107
|
-
|
108
|
-
|
105
|
+
stub_request(:post, "developer:secret@sr.se/friends_timeline").
|
106
|
+
with(:headers => headers("content-type" => "application/xml"),
|
107
|
+
:body => 'Anders').
|
108
|
+
to_return(:status => 200)
|
109
109
|
end
|
110
110
|
|
111
111
|
it { subject.post.code.should == "200" }
|
data/spec/resto_spec.rb
CHANGED
@@ -40,7 +40,7 @@ describe Resto do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
let(:body) do
|
43
|
-
{ :subscription => attributes.merge({}).
|
43
|
+
{ :subscription => attributes.merge({}).reject { |k, _| k == :id } }
|
44
44
|
end
|
45
45
|
|
46
46
|
let(:response) do
|
@@ -50,10 +50,10 @@ describe Resto do
|
|
50
50
|
describe ".all" do
|
51
51
|
before do
|
52
52
|
stub_request(:get,
|
53
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions.json")
|
54
|
-
|
55
|
-
'content-type' => 'application/json'))
|
56
|
-
|
53
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions.json").
|
54
|
+
with(:headers => headers('accept' => 'application/json, */*',
|
55
|
+
'content-type' => 'application/json')).
|
56
|
+
to_return(:status => 200, :body => [response].to_json)
|
57
57
|
end
|
58
58
|
|
59
59
|
subject { Subscription.all.first }
|
@@ -70,10 +70,10 @@ describe Resto do
|
|
70
70
|
describe ".get(id)" do
|
71
71
|
before do
|
72
72
|
stub_request(:get,
|
73
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json")
|
74
|
-
|
75
|
-
'content-type' => 'application/json'))
|
76
|
-
|
73
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json").
|
74
|
+
with(:headers => headers('accept' => 'application/json, */*',
|
75
|
+
'content-type' => 'application/json')).
|
76
|
+
to_return(:status => 200, :body => response.to_json)
|
77
77
|
end
|
78
78
|
|
79
79
|
subject { Subscription.get(415520) }
|
@@ -90,10 +90,10 @@ describe Resto do
|
|
90
90
|
describe "#get" do
|
91
91
|
before do
|
92
92
|
stub_request(:get,
|
93
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json")
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json").
|
94
|
+
with(:headers => headers('accept' => 'application/json, */*',
|
95
|
+
'content-type' => 'application/json')).
|
96
|
+
to_return(:status => 200, :body => response.to_json)
|
97
97
|
end
|
98
98
|
|
99
99
|
subject { Subscription.new(attributes).get }
|
@@ -110,10 +110,10 @@ describe Resto do
|
|
110
110
|
describe "#reload" do
|
111
111
|
before do
|
112
112
|
stub_request(:get,
|
113
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json")
|
114
|
-
|
115
|
-
'content-type' => 'application/json'))
|
116
|
-
|
113
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json").
|
114
|
+
with(:headers => headers('accept' => 'application/json, */*',
|
115
|
+
'content-type' => 'application/json')).
|
116
|
+
to_return(:status => 200, :body => response.to_json)
|
117
117
|
end
|
118
118
|
|
119
119
|
subject { Subscription.new(attributes).reload }
|
@@ -129,12 +129,16 @@ describe Resto do
|
|
129
129
|
|
130
130
|
describe ".post(attributes)" do
|
131
131
|
before do
|
132
|
+
# Ruby < 1.9 doesn't preserve key insert order => webmock stub of body
|
133
|
+
# request doesn't match
|
134
|
+
content = {}
|
135
|
+
content[:body] = body.to_json if RUBY_VERSION >= '1.9.1'
|
136
|
+
content[:headers] = headers('accept' => 'application/json, */*',
|
137
|
+
'content-type' => 'application/json')
|
132
138
|
stub_request(:post,
|
133
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions.json")
|
134
|
-
|
135
|
-
|
136
|
-
:body => body.to_json)
|
137
|
-
.to_return(:status => 201, :body => response.to_json)
|
139
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions.json").
|
140
|
+
with(content).
|
141
|
+
to_return(:status => 201, :body => response.to_json)
|
138
142
|
end
|
139
143
|
|
140
144
|
subject { Subscription.post(attributes) }
|
@@ -150,12 +154,17 @@ describe Resto do
|
|
150
154
|
|
151
155
|
describe ".put(attributes)" do
|
152
156
|
before do
|
157
|
+
# Ruby < 1.9 doesn't preserve key insert order => webmock stub of body
|
158
|
+
# request doesn't match
|
159
|
+
content = {}
|
160
|
+
content[:body] = body.to_json if RUBY_VERSION >= '1.9.1'
|
161
|
+
content[:headers] = headers('accept' => 'application/json, */*',
|
162
|
+
'content-type' => 'application/json')
|
163
|
+
|
153
164
|
stub_request(:put,
|
154
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json")
|
155
|
-
|
156
|
-
|
157
|
-
:body => body.to_json)
|
158
|
-
.to_return(:status => 200, :body => response.to_json)
|
165
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json").
|
166
|
+
with(content).
|
167
|
+
to_return(:status => 200, :body => response.to_json)
|
159
168
|
end
|
160
169
|
|
161
170
|
subject { Subscription.put(attributes) }
|
@@ -169,14 +178,19 @@ describe Resto do
|
|
169
178
|
it { should be_valid }
|
170
179
|
end
|
171
180
|
|
172
|
-
describe "#put" do
|
181
|
+
describe "#put(attributes)" do
|
173
182
|
before do
|
183
|
+
# Ruby < 1.9 doesn't preserve key insert order => webmock stub of body
|
184
|
+
# request doesn't match
|
185
|
+
content = {}
|
186
|
+
content[:body] = body.to_json if RUBY_VERSION >= '1.9.1'
|
187
|
+
content[:headers] = headers('accept' => 'application/json, */*',
|
188
|
+
'content-type' => 'application/json')
|
189
|
+
|
174
190
|
stub_request(:put,
|
175
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json")
|
176
|
-
|
177
|
-
|
178
|
-
:body => body.to_json)
|
179
|
-
.to_return(:status => 200, :body => response.to_json)
|
191
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json").
|
192
|
+
with(content).
|
193
|
+
to_return(:status => 200, :body => response.to_json)
|
180
194
|
end
|
181
195
|
|
182
196
|
subject { Subscription.new(attributes).put }
|
@@ -193,10 +207,10 @@ describe Resto do
|
|
193
207
|
describe ".delete(id)" do
|
194
208
|
before do
|
195
209
|
stub_request(:delete,
|
196
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json")
|
197
|
-
|
198
|
-
'content-type' => 'application/json'))
|
199
|
-
|
210
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json").
|
211
|
+
with(:headers => headers('accept' => 'application/json, */*',
|
212
|
+
'content-type' => 'application/json')).
|
213
|
+
to_return(:status => 200)
|
200
214
|
end
|
201
215
|
|
202
216
|
subject { Subscription.delete(415520) }
|
@@ -208,10 +222,10 @@ describe Resto do
|
|
208
222
|
describe "#delete" do
|
209
223
|
before do
|
210
224
|
stub_request(:delete,
|
211
|
-
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json")
|
212
|
-
|
213
|
-
|
214
|
-
|
225
|
+
"https://EyphE_t:x@dns-parrot.chargify.com/subscriptions/415520.json").
|
226
|
+
with(:headers => headers('accept' => 'application/json, */*',
|
227
|
+
'content-type' => 'application/json')).
|
228
|
+
to_return(:status => 200)
|
215
229
|
end
|
216
230
|
|
217
231
|
subject { Subscription.new(attributes).delete }
|
@@ -246,8 +260,8 @@ describe Resto do
|
|
246
260
|
property :id, Integer
|
247
261
|
property :title, String
|
248
262
|
property :body, String, :remote_name => 'a_bad_body_name' do
|
249
|
-
validate_presence .if { |user| user.title.to_s.size < 3 }
|
250
|
-
|
263
|
+
validate_presence .if { |user| user.title.to_s.size < 3 } .
|
264
|
+
message 'must be present'
|
251
265
|
end
|
252
266
|
|
253
267
|
resto_request do
|
@@ -268,9 +282,9 @@ describe Resto do
|
|
268
282
|
|
269
283
|
describe ".get(id)" do
|
270
284
|
let(:request) do
|
271
|
-
stub_request(:get, "http://api.bit.ly/v3/users/200")
|
272
|
-
|
273
|
-
|
285
|
+
stub_request(:get, "http://api.bit.ly/v3/users/200").
|
286
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
287
|
+
'content-type'=>'application/json'))
|
274
288
|
end
|
275
289
|
|
276
290
|
subject { RestUser.get(200) }
|
@@ -323,10 +337,10 @@ describe Resto do
|
|
323
337
|
|
324
338
|
describe ".all" do
|
325
339
|
before do
|
326
|
-
stub_request(:get, "http://api.bit.ly/v3/articles")
|
327
|
-
|
328
|
-
|
329
|
-
|
340
|
+
stub_request(:get, "http://api.bit.ly/v3/articles").
|
341
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
342
|
+
'content-type'=>'application/json')).
|
343
|
+
to_return(:status => 200)
|
330
344
|
end
|
331
345
|
|
332
346
|
it { RestArticle.all.code.should == "200" }
|
@@ -334,10 +348,10 @@ describe Resto do
|
|
334
348
|
|
335
349
|
describe ".all('tag' => 'resto')" do
|
336
350
|
before do
|
337
|
-
stub_request(:get, "http://api.bit.ly/v3/articles?tag=resto")
|
338
|
-
|
339
|
-
|
340
|
-
|
351
|
+
stub_request(:get, "http://api.bit.ly/v3/articles?tag=resto").
|
352
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
353
|
+
'content-type'=>'application/json')).
|
354
|
+
to_return(:status => 200)
|
341
355
|
end
|
342
356
|
|
343
357
|
it { RestArticle.all('tag' => 'resto').code.should == "200" }
|
@@ -345,10 +359,10 @@ describe Resto do
|
|
345
359
|
|
346
360
|
describe ".head" do
|
347
361
|
before do
|
348
|
-
stub_request(:head, "http://api.bit.ly/v3/articles")
|
349
|
-
|
350
|
-
|
351
|
-
|
362
|
+
stub_request(:head, "http://api.bit.ly/v3/articles").
|
363
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
364
|
+
'content-type'=>'application/json')).
|
365
|
+
to_return(:status => 200)
|
352
366
|
end
|
353
367
|
|
354
368
|
it { RestArticle.head.code.should == "200" }
|
@@ -356,10 +370,10 @@ describe Resto do
|
|
356
370
|
|
357
371
|
describe ".get(200)" do
|
358
372
|
before do
|
359
|
-
stub_request(:get, "http://api.bit.ly/v3/articles/200")
|
360
|
-
|
361
|
-
|
362
|
-
|
373
|
+
stub_request(:get, "http://api.bit.ly/v3/articles/200").
|
374
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
375
|
+
'content-type'=>'application/json')).
|
376
|
+
to_return(:status => 200)
|
363
377
|
end
|
364
378
|
|
365
379
|
it { RestArticle.get(200).code.should == "200" }
|
@@ -367,11 +381,11 @@ describe Resto do
|
|
367
381
|
|
368
382
|
describe ".post(:author => 'Anders')" do
|
369
383
|
before do
|
370
|
-
stub_request(:post, "http://api.bit.ly/v3/articles")
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
384
|
+
stub_request(:post, "http://api.bit.ly/v3/articles").
|
385
|
+
with(:body => { "author" => "Anders"}.to_json,
|
386
|
+
:headers => headers('accept'=>'application/json, */*',
|
387
|
+
'content-type'=>'application/json')).
|
388
|
+
to_return(:status => 200)
|
375
389
|
end
|
376
390
|
|
377
391
|
it { RestArticle.post(:author => 'Anders').code.should == "200" }
|
@@ -379,11 +393,11 @@ describe Resto do
|
|
379
393
|
|
380
394
|
describe ".put(:author => 'Anders')" do
|
381
395
|
before do
|
382
|
-
stub_request(:put, "http://api.bit.ly/v3/articles")
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
396
|
+
stub_request(:put, "http://api.bit.ly/v3/articles").
|
397
|
+
with(:body => { "author"=> "Anders"}.to_json,
|
398
|
+
:headers => headers('accept'=>'application/json, */*',
|
399
|
+
'content-type'=>'application/json')).
|
400
|
+
to_return(:status => 200)
|
387
401
|
end
|
388
402
|
|
389
403
|
it { RestArticle.put(:author => 'Anders').code.should == "200" }
|
@@ -391,10 +405,10 @@ describe Resto do
|
|
391
405
|
|
392
406
|
describe ".delete(400)" do
|
393
407
|
before do
|
394
|
-
stub_request(:delete, "http://api.bit.ly/v3/articles/400")
|
395
|
-
|
396
|
-
|
397
|
-
|
408
|
+
stub_request(:delete, "http://api.bit.ly/v3/articles/400").
|
409
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
410
|
+
'content-type'=>'application/json')).
|
411
|
+
to_return(:status => 200)
|
398
412
|
end
|
399
413
|
|
400
414
|
it { RestArticle.delete(400).code.should == "200" }
|
@@ -415,10 +429,10 @@ describe Resto do
|
|
415
429
|
|
416
430
|
describe ".all" do
|
417
431
|
before do
|
418
|
-
stub_request(:get, "http://api.bit.ly/v3/articles.json")
|
419
|
-
|
420
|
-
|
421
|
-
|
432
|
+
stub_request(:get, "http://api.bit.ly/v3/articles.json").
|
433
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
434
|
+
'content-type'=>'application/json')).
|
435
|
+
to_return(:status => 200)
|
422
436
|
end
|
423
437
|
|
424
438
|
it { RestArticleWithExtension.all.code.should == "200" }
|
@@ -426,10 +440,10 @@ describe Resto do
|
|
426
440
|
|
427
441
|
describe ".all('tag' => 'resto')" do
|
428
442
|
before do
|
429
|
-
stub_request(:get, "http://api.bit.ly/v3/articles.json?tag=resto")
|
430
|
-
|
431
|
-
|
432
|
-
|
443
|
+
stub_request(:get, "http://api.bit.ly/v3/articles.json?tag=resto").
|
444
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
445
|
+
'content-type'=>'application/json')).
|
446
|
+
to_return(:status => 200)
|
433
447
|
end
|
434
448
|
|
435
449
|
it { RestArticleWithExtension.all('tag' => 'resto').code.should == "200" }
|
@@ -437,10 +451,10 @@ describe Resto do
|
|
437
451
|
|
438
452
|
describe ".head" do
|
439
453
|
before do
|
440
|
-
stub_request(:head, "http://api.bit.ly/v3/articles.json")
|
441
|
-
|
442
|
-
|
443
|
-
|
454
|
+
stub_request(:head, "http://api.bit.ly/v3/articles.json").
|
455
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
456
|
+
'content-type'=>'application/json')).
|
457
|
+
to_return(:status => 200)
|
444
458
|
end
|
445
459
|
|
446
460
|
it { RestArticleWithExtension.head.code.should == "200" }
|
@@ -448,10 +462,10 @@ describe Resto do
|
|
448
462
|
|
449
463
|
describe ".get(200)" do
|
450
464
|
before do
|
451
|
-
stub_request(:get, "http://api.bit.ly/v3/articles/200.json")
|
452
|
-
|
453
|
-
|
454
|
-
|
465
|
+
stub_request(:get, "http://api.bit.ly/v3/articles/200.json").
|
466
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
467
|
+
'content-type'=>'application/json')).
|
468
|
+
to_return(:status => 200)
|
455
469
|
end
|
456
470
|
|
457
471
|
it { RestArticleWithExtension.get(200).code.should == "200" }
|
@@ -459,11 +473,11 @@ describe Resto do
|
|
459
473
|
|
460
474
|
describe ".post(:author => 'Anders')" do
|
461
475
|
before do
|
462
|
-
stub_request(:post, "http://api.bit.ly/v3/articles.json")
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
476
|
+
stub_request(:post, "http://api.bit.ly/v3/articles.json").
|
477
|
+
with(:body => { "author" => "As" }.to_json,
|
478
|
+
:headers => headers('accept'=>'application/json, */*',
|
479
|
+
'content-type'=>'application/json')).
|
480
|
+
to_return(:status => 200)
|
467
481
|
end
|
468
482
|
|
469
483
|
it { RestArticleWithExtension.post(:author => 'As').code.should == "200" }
|
@@ -471,11 +485,11 @@ describe Resto do
|
|
471
485
|
|
472
486
|
describe ".put(:author => 'Anders')" do
|
473
487
|
before do
|
474
|
-
stub_request(:put, "http://api.bit.ly/v3/articles.json")
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
488
|
+
stub_request(:put, "http://api.bit.ly/v3/articles.json").
|
489
|
+
with(:body => { "author" => "An" }.to_json,
|
490
|
+
:headers => headers('accept'=>'application/json, */*',
|
491
|
+
'content-type'=>'application/json')).
|
492
|
+
to_return(:status => 200)
|
479
493
|
end
|
480
494
|
|
481
495
|
it { RestArticleWithExtension.put(:author => 'An').code.should == "200" }
|
@@ -483,10 +497,10 @@ describe Resto do
|
|
483
497
|
|
484
498
|
describe ".delete(400)" do
|
485
499
|
before do
|
486
|
-
stub_request(:delete, "http://api.bit.ly/v3/articles/400.json")
|
487
|
-
|
488
|
-
|
489
|
-
|
500
|
+
stub_request(:delete, "http://api.bit.ly/v3/articles/400.json").
|
501
|
+
with(:headers => headers('accept'=>'application/json, */*',
|
502
|
+
'content-type'=>'application/json')).
|
503
|
+
to_return(:status => 200)
|
490
504
|
end
|
491
505
|
|
492
506
|
it { RestArticleWithExtension.delete(400).code.should == "200" }
|
@@ -509,9 +523,9 @@ describe Resto do
|
|
509
523
|
|
510
524
|
describe ".all()" do
|
511
525
|
before do
|
512
|
-
stub_request(:get, "http://bit.ly/v3?format=json&longUrl=ll")
|
513
|
-
|
514
|
-
|
526
|
+
stub_request(:get, "http://bit.ly/v3?format=json&longUrl=ll").
|
527
|
+
with(:headers => headers("content-type" => "text/html")).
|
528
|
+
to_return(:status => 200)
|
515
529
|
end
|
516
530
|
|
517
531
|
it { Bitly.all.code.should == "200" }
|
@@ -519,9 +533,9 @@ describe Resto do
|
|
519
533
|
|
520
534
|
describe ".all('shortUrl' => short)" do
|
521
535
|
before do
|
522
|
-
stub_request(:get, "http://bit.ly/v3?format=json&shortUrl=short")
|
523
|
-
|
524
|
-
|
536
|
+
stub_request(:get, "http://bit.ly/v3?format=json&shortUrl=short").
|
537
|
+
with(:headers => headers("content-type" => "text/html")).
|
538
|
+
to_return(:status => 200)
|
525
539
|
end
|
526
540
|
|
527
541
|
it { Bitly.all('shortUrl' => 'short').code.should == "200" }
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- "Anders T\xC3\xB6rnqvist"
|
@@ -10,7 +15,7 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-16 00:00:00 Z
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: yajl-ruby
|
@@ -20,6 +25,11 @@ dependencies:
|
|
20
25
|
requirements:
|
21
26
|
- - "="
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
hash: 59
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 8
|
32
|
+
- 2
|
23
33
|
version: 0.8.2
|
24
34
|
type: :runtime
|
25
35
|
version_requirements: *id001
|
@@ -31,6 +41,11 @@ dependencies:
|
|
31
41
|
requirements:
|
32
42
|
- - ">="
|
33
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 15
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 4
|
48
|
+
- 4
|
34
49
|
version: 1.4.4
|
35
50
|
type: :runtime
|
36
51
|
version_requirements: *id002
|
@@ -42,7 +57,12 @@ dependencies:
|
|
42
57
|
requirements:
|
43
58
|
- - ">="
|
44
59
|
- !ruby/object:Gem::Version
|
45
|
-
|
60
|
+
hash: 13
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 0
|
64
|
+
- 13
|
65
|
+
version: 1.0.13
|
46
66
|
type: :development
|
47
67
|
version_requirements: *id003
|
48
68
|
- !ruby/object:Gem::Dependency
|
@@ -53,7 +73,12 @@ dependencies:
|
|
53
73
|
requirements:
|
54
74
|
- - ">="
|
55
75
|
- !ruby/object:Gem::Version
|
56
|
-
|
76
|
+
hash: 23
|
77
|
+
segments:
|
78
|
+
- 2
|
79
|
+
- 6
|
80
|
+
- 0
|
81
|
+
version: 2.6.0
|
57
82
|
type: :development
|
58
83
|
version_requirements: *id004
|
59
84
|
- !ruby/object:Gem::Dependency
|
@@ -64,6 +89,11 @@ dependencies:
|
|
64
89
|
requirements:
|
65
90
|
- - ">="
|
66
91
|
- !ruby/object:Gem::Version
|
92
|
+
hash: 23
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
- 0
|
96
|
+
- 4
|
67
97
|
version: 0.0.4
|
68
98
|
type: :development
|
69
99
|
version_requirements: *id005
|
@@ -75,6 +105,11 @@ dependencies:
|
|
75
105
|
requirements:
|
76
106
|
- - ">="
|
77
107
|
- !ruby/object:Gem::Version
|
108
|
+
hash: 11
|
109
|
+
segments:
|
110
|
+
- 1
|
111
|
+
- 6
|
112
|
+
- 2
|
78
113
|
version: 1.6.2
|
79
114
|
type: :development
|
80
115
|
version_requirements: *id006
|
@@ -86,6 +121,11 @@ dependencies:
|
|
86
121
|
requirements:
|
87
122
|
- - ">="
|
88
123
|
- !ruby/object:Gem::Version
|
124
|
+
hash: 59
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
- 8
|
128
|
+
- 2
|
89
129
|
version: 0.8.2
|
90
130
|
type: :development
|
91
131
|
version_requirements: *id007
|
@@ -97,6 +137,9 @@ dependencies:
|
|
97
137
|
requirements:
|
98
138
|
- - ">="
|
99
139
|
- !ruby/object:Gem::Version
|
140
|
+
hash: 3
|
141
|
+
segments:
|
142
|
+
- 0
|
100
143
|
version: "0"
|
101
144
|
type: :development
|
102
145
|
version_requirements: *id008
|
@@ -108,6 +151,9 @@ dependencies:
|
|
108
151
|
requirements:
|
109
152
|
- - ">="
|
110
153
|
- !ruby/object:Gem::Version
|
154
|
+
hash: 3
|
155
|
+
segments:
|
156
|
+
- 0
|
111
157
|
version: "0"
|
112
158
|
type: :development
|
113
159
|
version_requirements: *id009
|
@@ -119,6 +165,9 @@ dependencies:
|
|
119
165
|
requirements:
|
120
166
|
- - ">="
|
121
167
|
- !ruby/object:Gem::Version
|
168
|
+
hash: 3
|
169
|
+
segments:
|
170
|
+
- 0
|
122
171
|
version: "0"
|
123
172
|
type: :development
|
124
173
|
version_requirements: *id010
|
@@ -130,6 +179,9 @@ dependencies:
|
|
130
179
|
requirements:
|
131
180
|
- - ">="
|
132
181
|
- !ruby/object:Gem::Version
|
182
|
+
hash: 3
|
183
|
+
segments:
|
184
|
+
- 0
|
133
185
|
version: "0"
|
134
186
|
type: :development
|
135
187
|
version_requirements: *id011
|
@@ -202,17 +254,27 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
254
|
requirements:
|
203
255
|
- - ">="
|
204
256
|
- !ruby/object:Gem::Version
|
257
|
+
hash: 57
|
258
|
+
segments:
|
259
|
+
- 1
|
260
|
+
- 8
|
261
|
+
- 7
|
205
262
|
version: 1.8.7
|
206
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
264
|
none: false
|
208
265
|
requirements:
|
209
266
|
- - ">="
|
210
267
|
- !ruby/object:Gem::Version
|
268
|
+
hash: 23
|
269
|
+
segments:
|
270
|
+
- 1
|
271
|
+
- 3
|
272
|
+
- 6
|
211
273
|
version: 1.3.6
|
212
274
|
requirements: []
|
213
275
|
|
214
276
|
rubyforge_project: resto
|
215
|
-
rubygems_version: 1.
|
277
|
+
rubygems_version: 1.8.2
|
216
278
|
signing_key:
|
217
279
|
specification_version: 3
|
218
280
|
summary: Restful Web Service
|