easy-resources 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/easy/resource.rb +15 -1
- data/lib/easy/resources/version.rb +1 -1
- metadata +22 -23
- data/lib/easy/resources/microservice_base.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b85a42c7639123ae5e49f48cb3dd8839d59a35d5059f2ee03376c127a0f7ced1
|
4
|
+
data.tar.gz: 6357e94c84e9b9d14763879ca5687d0b8931be7e4b475ff2a9ccfa989130a0ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6e0cf8e924c4fee86ae9cfcb61a89ecababc5af0cfd9c821c526554e1c8cf4e0d5f6d223a8abcb85e70875344594c89a155db9582f5f0a747352c5c4a27bc10
|
7
|
+
data.tar.gz: 29b8b4f9b8e47dbd3d275034f469a73e0ecd8b25bbd1df087df6d91ed36d76ab95b53f4cd4b35f528ea117da8908deecd0f7982d733ba5473773013850cc3d78
|
data/lib/easy/resource.rb
CHANGED
@@ -2,7 +2,21 @@ module Easy
|
|
2
2
|
class Resource < ActiveResource::Base
|
3
3
|
|
4
4
|
def self.configure(conf)
|
5
|
-
|
5
|
+
if conf.is_a?(::Hash)
|
6
|
+
if conf[:url].present? && conf[:token].present?
|
7
|
+
configure_bearer(conf[:url], conf[:token])
|
8
|
+
elsif conf[:url].present?
|
9
|
+
self.site = conf[:url]
|
10
|
+
end
|
11
|
+
elsif conf.is_a?(::OAuth2::AccessToken)
|
12
|
+
configure_bearer(conf.client.site, conf.token)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.configure_bearer(url, token)
|
17
|
+
self.site = url
|
18
|
+
self.connection.auth_type = :bearer
|
19
|
+
self.connection.bearer_token = token
|
6
20
|
end
|
7
21
|
|
8
22
|
def becomes(entity_class)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- petr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -134,7 +134,6 @@ files:
|
|
134
134
|
- Rakefile
|
135
135
|
- lib/easy/resource.rb
|
136
136
|
- lib/easy/resources.rb
|
137
|
-
- lib/easy/resources/microservice_base.rb
|
138
137
|
- lib/easy/resources/railtie.rb
|
139
138
|
- lib/easy/resources/redmine/easy_contact.rb
|
140
139
|
- lib/easy/resources/redmine/easy_crm_case.rb
|
@@ -199,40 +198,40 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
198
|
- !ruby/object:Gem::Version
|
200
199
|
version: '0'
|
201
200
|
requirements: []
|
202
|
-
rubygems_version: 3.0.
|
201
|
+
rubygems_version: 3.0.3
|
203
202
|
signing_key:
|
204
203
|
specification_version: 4
|
205
204
|
summary: Summary of Easy::Resources.
|
206
205
|
test_files:
|
207
|
-
- spec/
|
208
|
-
- spec/
|
206
|
+
- spec/easy_resources_spec.rb
|
207
|
+
- spec/support/active_resource.rb
|
208
|
+
- spec/support/redmine_active_resource.rb
|
209
|
+
- spec/support/fixtures.rb
|
210
|
+
- spec/models/easy-resources/resource_spec.rb
|
211
|
+
- spec/models/easy-resources/redmine/easy_web_application_spec.rb
|
212
|
+
- spec/models/easy-resources/redmine/user_spec.rb
|
209
213
|
- spec/models/easy-resources/redmine/easy_crm_case_spec.rb
|
214
|
+
- spec/models/easy-resources/redmine/redmine_base_spec.rb
|
210
215
|
- spec/models/easy-resources/redmine/easy_contact_spec.rb
|
211
216
|
- spec/models/easy-resources/redmine/issue_spec.rb
|
212
|
-
- spec/models/easy-resources/redmine/redmine_base_spec.rb
|
213
217
|
- spec/models/easy-resources/redmine/easy_web_application_activity_spec.rb
|
214
|
-
- spec/models/easy-resources/redmine/
|
215
|
-
- spec/
|
216
|
-
- spec/
|
217
|
-
- spec/
|
218
|
-
- spec/
|
219
|
-
- spec/support/redmine_active_resource.rb
|
220
|
-
- spec/easy_resources_spec.rb
|
218
|
+
- spec/models/easy-resources/redmine/project_spec.rb
|
219
|
+
- spec/fixtures/files/project/show.xml
|
220
|
+
- spec/fixtures/files/easy_server/show.xml
|
221
|
+
- spec/fixtures/files/easy_server/index.xml
|
222
|
+
- spec/fixtures/files/project.json
|
221
223
|
- spec/fixtures/files/easy_contact/show.xml
|
222
|
-
- spec/fixtures/files/easy_crm_case.json
|
223
224
|
- spec/fixtures/files/easy_crm_case/show.xml
|
224
|
-
- spec/fixtures/files/
|
225
|
+
- spec/fixtures/files/easy_crm_case.json
|
225
226
|
- spec/fixtures/files/issue.json
|
226
227
|
- spec/fixtures/files/user/show.xml
|
227
|
-
- spec/fixtures/files/project/show.xml
|
228
|
-
- spec/fixtures/files/issue/show.xml
|
229
228
|
- spec/fixtures/files/easy_contact.json
|
230
|
-
- spec/fixtures/files/easy_server/index.xml
|
231
|
-
- spec/fixtures/files/easy_server/show.xml
|
232
|
-
- spec/fixtures/files/easy_web_application/index.xml
|
233
229
|
- spec/fixtures/files/easy_web_application/with_ewaa.xml
|
234
|
-
- spec/fixtures/files/easy_web_application/with_custom_fields.xml
|
235
230
|
- spec/fixtures/files/easy_web_application/show.xml
|
236
231
|
- spec/fixtures/files/easy_web_application/with_easy_contact.xml
|
237
|
-
- spec/fixtures/files/easy_web_application/
|
232
|
+
- spec/fixtures/files/easy_web_application/with_custom_fields.xml
|
233
|
+
- spec/fixtures/files/easy_web_application/index.xml
|
238
234
|
- spec/fixtures/files/easy_web_application/show.json
|
235
|
+
- spec/fixtures/files/easy_web_application/with_easy_crm_case.xml
|
236
|
+
- spec/fixtures/files/issue/show.xml
|
237
|
+
- spec/spec_helper.rb
|