bootic_client 0.0.16 → 0.0.17
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/CHANGELOG.md +15 -0
- data/Gemfile +0 -1
- data/README.md +7 -0
- data/bootic_client.gemspec +2 -2
- data/lib/bootic_client/strategies/strategy.rb +4 -0
- data/lib/bootic_client/version.rb +1 -1
- data/spec/authorized_strategy_spec.rb +11 -0
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6d9d6472ee6d6d5ee26f1990f332eb1237b5769
|
4
|
+
data.tar.gz: 31a1c0ac6719d1ec0491b9da3a595491e50379e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebae4dfbebe06f14fd5c6d63931a92f5be0421beca9c37a9d0507a7049a71118af2341c8d1077c127c55a711c089917d477a49ab7d0eded308fd6a2152d61995
|
7
|
+
data.tar.gz: 3ba8bf14ac98e1413726778b0a1eacaaf87ab148c056b51435156f8268487b982956973afd4e3a79f8d99f6d77d54f4d63a825982cf30e7e68741dad904e1336
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [Unreleased](https://github.com/bootic/bootic_client.rb/tree/HEAD)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bootic/bootic_client.rb/compare/v0.0.16...HEAD)
|
6
|
+
|
7
|
+
**Merged pull requests:**
|
8
|
+
|
9
|
+
- Client\#from\_url\(url\) [\#9](https://github.com/bootic/bootic_client.rb/pull/9) ([ismasan](https://github.com/ismasan))
|
10
|
+
|
11
|
+
## [v0.0.16](https://github.com/bootic/bootic_client.rb/tree/v0.0.16) (2017-04-01)
|
12
|
+
[Full Changelog](https://github.com/bootic/bootic_client.rb/compare/v0.0.15...v0.0.16)
|
13
|
+
|
14
|
+
**Merged pull requests:**
|
15
|
+
|
16
|
+
- Add Relation\#to\_hash [\#8](https://github.com/bootic/bootic_client.rb/pull/8) ([ismasan](https://github.com/ismasan))
|
17
|
+
|
3
18
|
## [v0.0.15](https://github.com/bootic/bootic_client.rb/tree/v0.0.15) (2016-12-03)
|
4
19
|
[Full Changelog](https://github.com/bootic/bootic_client.rb/compare/v0.0.14...v0.0.15)
|
5
20
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -254,6 +254,13 @@ new_message = messaging_api.send_message(title: 'This is a new message')
|
|
254
254
|
messaging_api.delete_message(id: new_message.id)
|
255
255
|
```
|
256
256
|
|
257
|
+
It's also possibe to load a root resource directly from a URL:
|
258
|
+
|
259
|
+
```ruby
|
260
|
+
messaging_api_root = client.from_url("https://some.api.com")
|
261
|
+
messaging_api.do_something(foo: "bar") # etc
|
262
|
+
```
|
263
|
+
|
257
264
|
## Contributing
|
258
265
|
|
259
266
|
1. Fork it
|
data/bootic_client.gemspec
CHANGED
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.3"
|
29
29
|
spec.add_development_dependency "rake"
|
30
30
|
spec.add_development_dependency "rspec", "3.5.0"
|
31
|
-
spec.add_development_dependency "jwt"
|
32
|
-
spec.add_development_dependency "dalli"
|
31
|
+
spec.add_development_dependency "jwt", "~> 1.5"
|
32
|
+
spec.add_development_dependency "dalli", "~> 2.7"
|
33
33
|
end
|
@@ -17,6 +17,10 @@ module BooticClient
|
|
17
17
|
wrapper_class.new hash, self
|
18
18
|
end
|
19
19
|
|
20
|
+
def from_url(url, wrapper_class = Entity)
|
21
|
+
request_and_wrap :get, url, wrapper_class
|
22
|
+
end
|
23
|
+
|
20
24
|
def request_and_wrap(request_method, href, wrapper_class, payload = {})
|
21
25
|
pre_flight
|
22
26
|
retryable do
|
@@ -153,5 +153,16 @@ describe 'BooticClient::Strategies::Authorized' do
|
|
153
153
|
expect(entity.can?(:delete)).to be true
|
154
154
|
end
|
155
155
|
end
|
156
|
+
|
157
|
+
describe '#from_url' do
|
158
|
+
it 'builds and returns an entity' do
|
159
|
+
authorized_request = stub_request(:get, "https://api.bootic.net/v1/shops").
|
160
|
+
to_return(status: 200, :body => JSON.dump(title: 'All shops'))
|
161
|
+
|
162
|
+
entity = client.from_url('https://api.bootic.net/v1/shops')
|
163
|
+
expect(entity).to be_kind_of(BooticClient::Entity)
|
164
|
+
expect(entity.title).to eql('All shops')
|
165
|
+
end
|
166
|
+
end
|
156
167
|
end
|
157
168
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootic_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ismael Celis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -140,30 +140,30 @@ dependencies:
|
|
140
140
|
name: jwt
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '1.5'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
152
|
+
version: '1.5'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: dalli
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '2.7'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '2.7'
|
167
167
|
description: Official Ruby client for the Bootic API
|
168
168
|
email:
|
169
169
|
- ismaelct@gmail.com
|