restpack-core-client 0.1.3 → 0.1.4
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.
@@ -20,9 +20,9 @@ module RestPack
|
|
20
20
|
hydrate_channel(data)
|
21
21
|
end
|
22
22
|
|
23
|
-
def get_domain(
|
24
|
-
p "API.get_domain(#{
|
25
|
-
json = RestClient.get("http://:#{@password}@#{@domain}/api/v1/domains/search.json?
|
23
|
+
def get_domain(host)
|
24
|
+
p "API.get_domain(#{host})"
|
25
|
+
json = RestClient.get("http://:#{@password}@#{@domain}/api/v1/domains/search.json?host=#{host}")
|
26
26
|
result = JSON.parse(json, :symbolize_keys => true)
|
27
27
|
result[:domains].first
|
28
28
|
end
|
@@ -13,14 +13,14 @@ module RestPack
|
|
13
13
|
Cache.new(api)
|
14
14
|
end
|
15
15
|
|
16
|
-
def get_channel(
|
17
|
-
channel_id = get_channel_id(
|
16
|
+
def get_channel(host)
|
17
|
+
channel_id = get_channel_id(host)
|
18
18
|
|
19
19
|
@channels[channel_id] ||= @api.get_channel(channel_id)
|
20
20
|
end
|
21
21
|
|
22
|
-
def get_channel_id(
|
23
|
-
@channel_ids[
|
22
|
+
def get_channel_id(host)
|
23
|
+
@channel_ids[host] ||= @api.get_domain(host)[:channel_id]
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
@@ -19,8 +19,8 @@ module RestPack::Core::Client
|
|
19
19
|
@domains.find { |a| a.id == id }
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
23
|
-
@domains.find { |a| a.
|
22
|
+
def get_domain_by_host(host)
|
23
|
+
@domains.find { |a| a.host == host }
|
24
24
|
end
|
25
25
|
|
26
26
|
def get_configuration(id)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module RestPack::Core::Client
|
2
2
|
class Domain
|
3
|
-
attr_accessor :id, :
|
3
|
+
attr_accessor :id, :host, :channel, :application, :configurations
|
4
4
|
|
5
5
|
def initialize(data, channel)
|
6
6
|
@configurations = []
|
7
7
|
|
8
8
|
@id = data[:id]
|
9
|
-
@
|
9
|
+
@host = data[:host]
|
10
10
|
|
11
11
|
@channel = channel
|
12
12
|
@application = channel.get_application(data[:application_id])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restpack-core-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|