blanket_wrapper 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/blanket/version.rb +1 -1
- data/lib/blanket/wrapper.rb +1 -1
- data/spec/blanket/wrapper_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8252184153a5c8734c3512c6ff6eea2e5a89d077
|
4
|
+
data.tar.gz: c8562c25b4f679bbc6a2dda18dab57cf5e340d29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a2729a2ed218ccf1302a3202401f503ee9609d30424e035b52b9714f662634bff0781d29d70e43d1ecebf4fa60026f197f0793099054442cdb14d4c425c1ddb
|
7
|
+
data.tar.gz: a39dedce0183fcf27d055944eb4e6d3276677c3a79c40df1766ff7e55274e10c853877bcb388ac26858eb3615d8a58eab7ac5e6407103994d25ab0bb394bb7df
|
data/README.md
CHANGED
@@ -85,6 +85,13 @@ github.users('inf0rmer').repos
|
|
85
85
|
|
86
86
|
The final `get` method performs a GET HTTP request. You can also use it to append a final part to your request, so you can write something like:
|
87
87
|
|
88
|
+
As this magic works using `method_missingp`, you can `send` slashed uri parts to the wrapper and it will play nicely. This is especially usefull when APIs give you URLs:
|
89
|
+
```ruby
|
90
|
+
github.get('users/inf0rmer/repos')
|
91
|
+
# or, if you don't wnat to perform the request yet, or have to append more parts to the uri
|
92
|
+
github.send('users/inf0rmer').repos#.get
|
93
|
+
```
|
94
|
+
|
88
95
|
```ruby
|
89
96
|
github = Blanket.wrap("https://api.github.com")
|
90
97
|
github.users.get('inf0rmer')
|
data/lib/blanket/version.rb
CHANGED
data/lib/blanket/wrapper.rb
CHANGED
@@ -16,6 +16,14 @@ describe "Blanket::Wrapper" do
|
|
16
16
|
expect(HTTParty).to have_received(:get).with("http://api.example.org/videos", anything())
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'allows full paths for uri construction' do
|
20
|
+
allow(HTTParty).to receive(:get) { StubbedResponse.new }
|
21
|
+
|
22
|
+
api.get('flexible/path')
|
23
|
+
|
24
|
+
expect(HTTParty).to have_received(:get).with("http://api.example.org/flexible/path", anything())
|
25
|
+
end
|
26
|
+
|
19
27
|
describe "Response" do
|
20
28
|
before :each do
|
21
29
|
stub_request(:get, "http://api.example.org/users")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blanket_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Abrantes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|