rest-in-peace 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTEyZmE5YWI2NjhjODFjOGI1ZDkyNTUyYjBmMTJkNzRkODc4ZmUyMw==
4
+ YjJhMTBkMjI0NmNmMWExZDAwMWVkNjY4ODMyNTk3NzgxOWQxMTZhZA==
5
5
  data.tar.gz: !binary |-
6
- NDA5YWIyZmY5MWE2MjNkYmMxN2M4MDE2MDY4ZjdjMzIxZjRmZDIwYQ==
6
+ YzA2ZDYyOTI1YTUyMjFjNTUwNWE1NjYwZTNkZWRiNTZhMTE4ZTY0MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTRmZmU0MTZmOWQ1OGE1ZTgxM2FjYzY4OTVkOWY1NWNhMWQ0ZTY0NTkzOTU2
10
- MDhiNmY5NzJjZGMxZWUxYjRkMWFkNTVmNjExN2ZhMTQ2MWJlOWU0NjcyMDAz
11
- MmI3MWRjYjdkOWEwYmI2YjdiZmJjM2Y0YTE5ODg1ZWI5M2Q4MjA=
9
+ NDY4Yzk2OGRjNmNkYjVlNTE5MDkyMzBiOTBjYWZjNjRjZWIzYmE2NDhiY2I4
10
+ YmIzNTM1NGM1ZGY4Njc5NmJlM2E4ZDhlMGI5OTQwYWYyMjFlNmVjMzRlNzYy
11
+ YTgyNDc2MWM2ZDQwNGViNWNjYzBlNzQ1N2FhNmRkYjcyZWExMDM=
12
12
  data.tar.gz: !binary |-
13
- MmVlYzE0MWU1M2U1YzRhYjdlNmQ1YWU0Mzk4NDVmMjU5YWE1N2Q3ZDgyZjgz
14
- Njc5ZTFkODBmMGFhYzk2YjdhNTk5ZjhjMTcxMTVjNGZiZmUwOGY0ZWQxMjI3
15
- ZjAzMGU0ZWUyNjljMzgxYzA3ZTIzYzE5MzIzN2UyNmRjOTJkMzk=
13
+ NTcwMjliYTVlZDlmYTE2NTk4NjQ2ZjU1ZjM3MWRlMzJlZjE5N2Q3Yzc3NDI4
14
+ ZDFjYzdhNmRmYzg3NTA2ODU4NDUwYzA1ODUxMjMxMDFjZjIxOWIzOTNmMzE4
15
+ NGUyODRjODQ3ZjJhYTcyNTkzYWU1YTJkYzFlMGE4NmFlYmU3MDA=
data/README.md CHANGED
@@ -59,12 +59,16 @@ You need to specify the HTTP client library to use. You can either specify a blo
59
59
 
60
60
  ```ruby
61
61
  class Resource
62
+ include RESTinPeace
63
+
62
64
  rest_in_peace do
63
65
  use_api ->() { Faraday.new(url: 'http://rip.dev') }
64
66
  end
65
67
  end
66
68
 
67
69
  class ResourceTwo
70
+ include RESTinPeace
71
+
68
72
  rest_in_peace do
69
73
  use_api Faraday.new(url: 'http://rip.dev')
70
74
  end
@@ -76,6 +80,8 @@ end
76
80
  If you define anything inside the `resource` block, it will define a method on the instances of the class:
77
81
  ```ruby
78
82
  class Resource
83
+ include RESTinPeace
84
+
79
85
  rest_in_peace do
80
86
  resource do
81
87
  get :reload, '/rip/:id'
@@ -97,6 +103,8 @@ If you define anything inside the `collection` block, it will define a method on
97
103
 
98
104
  ```ruby
99
105
  class Resource
106
+ include RESTinPeace
107
+
100
108
  rest_in_peace do
101
109
  collection do
102
110
  get :find, '/rip/:id'
@@ -115,6 +123,8 @@ You can define your own pagination module which will be mixed in when calling th
115
123
 
116
124
  ```ruby
117
125
  class Resource
126
+ include RESTinPeace
127
+
118
128
  rest_in_peace do
119
129
  collection do
120
130
  get :all, '/rips', paginate_with: MyClient::Paginator
@@ -139,7 +149,7 @@ For easy interoperability with Rails, there is the ability to include ActiveMode
139
149
  require 'rest_in_peace'
140
150
 
141
151
  module MyClient
142
- class Fabric < Struct.new(:id, :name, :ip)
152
+ class Fabric
143
153
  include RESTinPeace
144
154
 
145
155
  rest_in_peace do
@@ -231,4 +241,4 @@ Faraday.new do |faraday|
231
241
  faraday.response :rip_raise_errors
232
242
  # ...
233
243
  end
234
- ```
244
+ ```
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.2
@@ -8,6 +8,7 @@ module RESTinPeace
8
8
  def initialize(url_template, params)
9
9
  @url_template = url_template
10
10
  @params = params.dup
11
+ @url = nil
11
12
  end
12
13
 
13
14
  def url
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
  s.require_paths = ['lib']
19
19
 
20
- s.add_runtime_dependency 'activemodel', '> 3.2', '<= 4.1'
20
+ s.add_runtime_dependency 'activemodel', '>= 3.2', '< 4.2'
21
21
 
22
22
  s.add_development_dependency 'rake', '~> 10.0'
23
23
  s.add_development_dependency 'rspec', '~> 3.0'
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-in-peace
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raffael Schmid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-06 00:00:00.000000000 Z
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>'
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.2'
20
- - - <=
20
+ - - <
21
21
  - !ruby/object:Gem::Version
22
- version: '4.1'
22
+ version: '4.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ! '>'
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.2'
30
- - - <=
30
+ - - <
31
31
  - !ruby/object:Gem::Version
32
- version: '4.1'
32
+ version: '4.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rake
35
35
  requirement: !ruby/object:Gem::Requirement