apidiesel 0.13 → 0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -20
- data/lib/apidiesel/errors.rb +1 -1
- data/lib/apidiesel/request.rb +2 -1
- data/lib/apidiesel/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0004f40573101e0eb5c1e4b5ade4b83db6a1cf1
|
4
|
+
data.tar.gz: 7da784a402c3518d5c08c0c22fc928478ba214b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4daab8712e12862ae40666603b40b738044397df5868d4e578a9b127c8682062dfecc34709213d92e99db0b2e7e30ede9ea7f5e0776d7c4bd2f76ff3875c3226
|
7
|
+
data.tar.gz: 993684cd775ab09b38dfa218c2ae181da0a34cfe3d4ad5736d8879b5d0b1c9ebd851498910bf458a27f0c5390ffde9d25355f4e494b6e1eb7fb0b6fc6ffa04b3
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Apidiesel
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/apidiesel.svg)](https://badge.fury.io/rb/apidiesel) [![Dependency Status](https://gemnasium.com/janfoeh/apidiesel.svg)](https://gemnasium.com/janfoeh/apidiesel)
|
4
|
+
|
3
5
|
Apidiesel is a DSL for building API clients. It is made to be highly readable,
|
4
6
|
easily extensible and to assume as little as possible about your API.
|
5
7
|
|
@@ -24,31 +26,33 @@ Or install it yourself as:
|
|
24
26
|
Apidiesel consists of three main parts: the base `Api`, one `Action` for each API
|
25
27
|
endpoint and `Handler` plugins for processing incoming and outgoing data.
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
```ruby
|
30
|
+
module Actions
|
31
|
+
class GetUsers < Apidiesel::Action
|
32
|
+
url path: '/users'
|
33
|
+
|
34
|
+
expects do
|
35
|
+
string :firstname, optional: true
|
36
|
+
string :lastname, optional: true
|
37
|
+
boolean :active, default: true
|
38
|
+
end
|
36
39
|
|
37
|
-
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
40
|
+
responds_with do
|
41
|
+
objects :users, wrapped_in: MyUserModel
|
41
42
|
end
|
43
|
+
end
|
44
|
+
end
|
42
45
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
+
class Api < Apidiesel::Api
|
47
|
+
url 'https://foo.example'
|
48
|
+
http_method :post
|
46
49
|
|
47
|
-
|
48
|
-
|
50
|
+
register_actions
|
51
|
+
end
|
49
52
|
|
50
|
-
|
51
|
-
|
53
|
+
api = Api.new
|
54
|
+
api.get_users(firstname: 'Jane', lastname: 'Doe')
|
55
|
+
```
|
52
56
|
|
53
57
|
## Development
|
54
58
|
|
data/lib/apidiesel/errors.rb
CHANGED
data/lib/apidiesel/request.rb
CHANGED
data/lib/apidiesel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apidiesel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.14'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan-Christian Foeh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -207,4 +207,3 @@ signing_key:
|
|
207
207
|
specification_version: 4
|
208
208
|
summary: Build API clients through an expressive DSL
|
209
209
|
test_files: []
|
210
|
-
has_rdoc:
|