lazy_ant 0.1.2 → 0.2.0
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/.rubocop.yml +1 -2
- data/README.md +5 -0
- data/lazy_ant.gemspec +0 -1
- data/lib/lazy_ant/dsl/connection.rb +6 -2
- data/lib/lazy_ant/group.rb +10 -5
- data/lib/lazy_ant/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 896a03bb79a1a9b695a09885267d69c309f6ed8a
|
4
|
+
data.tar.gz: 1834d0d47a5642f1c8a38a93b4cf252e915d1f0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2eb5d43ec09f5632c33d1304a41e9a773491197d32c425b9f7ccf8b21d638bebcea8e5b932d3695454b734fd488fb8be302480d6fed92fd8fd877ee853ef5df6
|
7
|
+
data.tar.gz: 2c4c6a77639767cb02aabb8b1a4a0eab5de2f97449bc7041a3dd8323dfcd9551887814e8796375ef3849058941ef788074e27dca391e5abe280dcda4ccad8a80
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -46,6 +46,11 @@ class MyApiClient
|
|
46
46
|
group :user do
|
47
47
|
api :find, get: '/users/:id.json', entity: :User
|
48
48
|
api :search, get: '/users/search.json', multi: true, entity: :User
|
49
|
+
|
50
|
+
group :posts do
|
51
|
+
base_url 'https://myapi2.example.com'
|
52
|
+
api :find, get: '/users/:user_id/posts/:id.json'
|
53
|
+
end
|
49
54
|
end
|
50
55
|
end
|
51
56
|
```
|
data/lazy_ant.gemspec
CHANGED
@@ -19,11 +19,15 @@ module LazyAnt
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def default_callback
|
22
|
-
|
22
|
+
@default_callback ||=
|
23
|
+
self.class.instance_variable_get(:@default_callback) ||
|
24
|
+
@parent && @parent.default_callback
|
23
25
|
end
|
24
26
|
|
25
27
|
def converter_name
|
26
|
-
|
28
|
+
@coverter_name ||=
|
29
|
+
self.class.instance_variable_get(:@converter_name) ||
|
30
|
+
@parent && @parent.converter_name
|
27
31
|
end
|
28
32
|
|
29
33
|
module ClassMethods
|
data/lib/lazy_ant/group.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
module LazyAnt
|
2
2
|
class Group
|
3
|
+
include LazyAnt::DSL::Endpoint
|
4
|
+
|
3
5
|
def initialize(parent)
|
4
6
|
@parent = parent
|
5
7
|
end
|
@@ -7,14 +9,17 @@ module LazyAnt
|
|
7
9
|
def inspect
|
8
10
|
"<LazyAnt::Group #{name}>"
|
9
11
|
end
|
10
|
-
include LazyAnt::DSL::Endpoint
|
11
12
|
|
12
|
-
def
|
13
|
-
|
13
|
+
def config
|
14
|
+
@parent.config
|
14
15
|
end
|
15
16
|
|
16
|
-
def
|
17
|
-
@parent.
|
17
|
+
def base_url
|
18
|
+
@parent.base_url
|
19
|
+
end
|
20
|
+
|
21
|
+
def name
|
22
|
+
self.class.name
|
18
23
|
end
|
19
24
|
|
20
25
|
def self.name=(name)
|
data/lib/lazy_ant/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy_ant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- masarakki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -206,20 +206,6 @@ dependencies:
|
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: activemodel
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - ">="
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '0'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - ">="
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '0'
|
223
209
|
description: Generate an api client easily.
|
224
210
|
email:
|
225
211
|
- masaki@hisme.net
|