iibee 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/iibee/application.rb +28 -14
- data/lib/iibee/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53e0a7b571694003eb4e64a41bbbefbd47059a4d
|
4
|
+
data.tar.gz: 03e2b32a90485a20b30932d6b89a1c012069e670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae49639f14f771147960c15f5a76e3b49939c96e1b873b61bcccc4b3926e168d50d0153d6c70bf480f92e2eef2f5f79559e37494a6b4f014286b2936af55b891
|
7
|
+
data.tar.gz: c1449facd13b5dd63535f549044b8bc667af812b3ac578557e124c5d42959612f5d86c76e7e7099841a38b4eeeaab37c74cb900e24218f3ca4be875098b1a71a
|
data/lib/iibee/application.rb
CHANGED
@@ -16,33 +16,47 @@ module Iibee
|
|
16
16
|
end
|
17
17
|
CONTEXT_PATH = "apiv1/executiongroups"
|
18
18
|
|
19
|
-
attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri
|
19
|
+
attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri, :executionGroupName, :options
|
20
20
|
|
21
|
-
def initialize(document)
|
22
|
-
document.xpath('
|
21
|
+
def initialize(document, executionGroupName, options)
|
22
|
+
document.xpath('@*').each do |attribute|
|
23
23
|
instance_variable_set("@#{attribute.name}", attribute.value)
|
24
24
|
end
|
25
|
+
@executionGroupName = executionGroupName
|
26
|
+
@options = options
|
27
|
+
end
|
28
|
+
|
29
|
+
def executionGroup
|
30
|
+
Iibee::ExecutionGroup.find_by(name: executionGroupName, options: @options)
|
25
31
|
end
|
26
32
|
|
27
33
|
def properties
|
28
|
-
response =
|
34
|
+
response = Iibee::Connection.new(options: options).get("#{self.propertiesUri}")
|
29
35
|
document = Oga.parse_xml(response.body)
|
30
36
|
@properties = Iibee::Application::Properties.new(document)
|
31
37
|
end
|
32
38
|
|
33
|
-
def self.
|
34
|
-
|
35
|
-
response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{egName}/applications/")
|
36
|
-
document = Oga.parse_xml(response.body)
|
37
|
-
document.xpath('applications/application').each do |application|
|
38
|
-
applications << new(document)
|
39
|
-
end
|
39
|
+
def self.find_by(executionGroupName: nil, name: nil, options: {})
|
40
|
+
where(executionGroupName: executionGroupName, name: name, options: options).first
|
40
41
|
end
|
41
42
|
|
42
|
-
def self.
|
43
|
-
|
43
|
+
def self.where(executionGroupName: nil, name: nil, options: {})
|
44
|
+
applications = []
|
45
|
+
|
46
|
+
unless executionGroupName.nil?
|
47
|
+
application_url = "/#{CONTEXT_PATH}/#{executionGroupName}/?depth=2"
|
48
|
+
else
|
49
|
+
application_url = "/#{CONTEXT_PATH}/?depth=3"
|
50
|
+
end
|
51
|
+
|
52
|
+
response = Iibee::Connection.new(options: options).get(application_url)
|
44
53
|
document = Oga.parse_xml(response.body)
|
45
|
-
|
54
|
+
|
55
|
+
document.xpath("//application[@name='#{name}']").each do |application|
|
56
|
+
applications << new(application, application.parent.parent.get('name'), options)
|
57
|
+
end
|
58
|
+
|
59
|
+
return applications
|
46
60
|
end
|
47
61
|
end
|
48
62
|
end
|
data/lib/iibee/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iibee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akil
|
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
195
|
version: '0'
|
196
196
|
requirements: []
|
197
197
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.4.
|
198
|
+
rubygems_version: 2.4.6
|
199
199
|
signing_key:
|
200
200
|
specification_version: 4
|
201
201
|
summary: Gem to wrap the IIB 9 REST API.
|