rapidash 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/lib/rapidash/base.rb +2 -2
- data/lib/rapidash/http_client.rb +1 -1
- data/lib/rapidash/version.rb +1 -1
- data/spec/rapidash/base_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a24e88b9990655513929505bdfded740ae3bc5d0
|
4
|
+
data.tar.gz: 10b580d030b0db97f695b353bdcbc8f4f5046fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 737c8447bca4d1c56110fa957f7cfe5fa0e8752baf9a7974f8a3e5cbec657e6f30bd0740a1ecbdffe17d0b1a57dc09a667e86243f5a69d511871713cea291fb8
|
7
|
+
data.tar.gz: dcaa32a236b129363fc317b2219c69954e85216d10c9403b8431730b8dfd2e40b0d42014374497e4eaeba94532d318cf440405ef61416bedaed8914d4b962d09
|
data/lib/rapidash/base.rb
CHANGED
@@ -49,8 +49,8 @@ module Rapidash
|
|
49
49
|
def call!
|
50
50
|
self.options ||= {}
|
51
51
|
options.delete(:previous_url)
|
52
|
-
options[:
|
53
|
-
options[:
|
52
|
+
options[:headers] ||= {}
|
53
|
+
options[:headers]["content-type"] = "application/json"
|
54
54
|
method = options.delete(:method) || :get
|
55
55
|
client.send(method, url, options)
|
56
56
|
end
|
data/lib/rapidash/http_client.rb
CHANGED
@@ -29,7 +29,7 @@ module Rapidash
|
|
29
29
|
url = "#{url}.#{(self.class.url_extension)}"
|
30
30
|
end
|
31
31
|
url = connection.build_url(url, options[:params]).to_s
|
32
|
-
response = connection.run_request(verb, url, options[:body], options[:
|
32
|
+
response = connection.run_request(verb, url, options[:body], options[:headers])
|
33
33
|
|
34
34
|
# "foo"[0] does not work in 1.8.7, "foo"[0,1] is required
|
35
35
|
case response.status.to_s[0,1]
|
data/lib/rapidash/version.rb
CHANGED
data/spec/rapidash/base_spec.rb
CHANGED
@@ -118,13 +118,13 @@ describe Rapidash::Base do
|
|
118
118
|
describe ".call!" do
|
119
119
|
it "should call get on the client" do
|
120
120
|
subject.url = "tester/1"
|
121
|
-
client.should_receive(:get).with("tester/1", {:
|
121
|
+
client.should_receive(:get).with("tester/1", {:headers => headers})
|
122
122
|
subject.call!
|
123
123
|
end
|
124
124
|
|
125
125
|
|
126
126
|
it "should call a post on the client if set" do
|
127
|
-
client.should_receive(:post).with("tester", {:
|
127
|
+
client.should_receive(:post).with("tester", {:headers => headers})
|
128
128
|
subject.options = {:method => :post}
|
129
129
|
subject.url = "tester"
|
130
130
|
subject.call!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapidash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary 'Gazler' Rennie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.0.
|
170
|
+
rubygems_version: 2.0.0
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: An opinionated core for creating clients for RESTful APIs quickly
|