g5_integrations_updatable 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c60c0d5d985a175d9ada38975486d12bc7175c98
|
4
|
+
data.tar.gz: b258da0a18fbf2de172371be432284544e3a4d10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b578302581a8fc1b4bce8181342ca932578e835266fc1b0a82dc394b4aefe36002062cc7756fd0a9d2bdb280a82f453f101a4e6881410d33ca3ea2c1f4372b3e
|
7
|
+
data.tar.gz: e8e8661347001845b3e3997ccf7302e5870252d80f9c8d3edd0da3e2a2aa3a311b9213001eb5625eff7df52fecb9f3719c3a9d41ffec1f51bb8ec111c3988606
|
@@ -1,12 +1,7 @@
|
|
1
1
|
module G5IntegrationsUpdatable
|
2
2
|
class FeedFetcher
|
3
|
-
def initialize(uri
|
3
|
+
def initialize(uri)
|
4
4
|
@uri = uri
|
5
|
-
@options = options
|
6
|
-
end
|
7
|
-
|
8
|
-
def root_key
|
9
|
-
@options.fetch(:root_key, 'location_settings')
|
10
5
|
end
|
11
6
|
|
12
7
|
def process
|
@@ -16,7 +11,7 @@ module G5IntegrationsUpdatable
|
|
16
11
|
|
17
12
|
case response.code.to_i
|
18
13
|
when 200
|
19
|
-
JSON.parse(response.body)
|
14
|
+
JSON.parse(response.body).values.first
|
20
15
|
when 404
|
21
16
|
raise G5IntegrationsUpdatable::RecordNotFoundException.new("Couldn't find record at URL '#{@uri}'")
|
22
17
|
else
|
@@ -8,7 +8,7 @@ module G5IntegrationsUpdatable
|
|
8
8
|
|
9
9
|
class << self
|
10
10
|
def load_all_settings(all_uri)
|
11
|
-
result_hash = G5IntegrationsUpdatable::FeedFetcher.new(all_uri
|
11
|
+
result_hash = G5IntegrationsUpdatable::FeedFetcher.new(all_uri).process
|
12
12
|
find_or_create_all result_hash
|
13
13
|
end
|
14
14
|
|