iibee 0.1.9 → 0.1.10

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: 0079f49da198c801a90b7bd74eec535e47e54734
4
- data.tar.gz: 363dd5ad483d62664fc9a55c03d541ef0fa1c6b9
3
+ metadata.gz: 37bb18add83a131954da1c7cf1fc3c75ee271784
4
+ data.tar.gz: 536731c43a4bbefdb59ab8b281da6be772555f4c
5
5
  SHA512:
6
- metadata.gz: 3058871b52f739edb857dfe2181986c3930367780cd0d55846e665cd85bbeffe30da8035e603e1958d71564e128ea3e23e90facee86a75e0742a999f551b05b6
7
- data.tar.gz: 8060ccc48bd62494265b9c98d634b91eb0caf2768184fd38679019ccf3bd7225190b15a54be3269cf46882b97e215a38630bcc32fa47b2f11c8f21b6c5e3629d
6
+ metadata.gz: 138d58ebff147bb362c1863a676122f0219b1641cd80e3d8916c3ea6313a7fefcaa72ef8f3e1d318ee42d93e229e91673491eb65d56dbe06e790a422c9200688
7
+ data.tar.gz: fc9578b2c869dc28e953a02b2c9094ee47cda234afffa0dbc306a7e9bb11084df1a83449a0989dec74b969d9afd29b6a6e1f924cc97fefa99db9beda1a844b73
data/lib/iibee/broker.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'faraday'
2
2
  require 'oga'
3
+ require 'logger'
3
4
 
4
5
  module Iibee
5
6
  class Broker
@@ -26,10 +27,11 @@ module Iibee
26
27
 
27
28
  end
28
29
 
29
- def self.find(id)
30
- response = Faraday.get("#{Iibee.configuration.base_url}#{CONTEXT_PATH}")
30
+ def self.find_by(options: {})
31
+ url = "#{options[:scheme]}://#{options[:host]}:#{options[:port]}".chomp(":")
32
+ response = Faraday.get("#{url}#{CONTEXT_PATH}")
31
33
  document = Oga.parse_xml(response.body)
32
34
  new(document)
33
- end
35
+ end
34
36
  end
35
37
  end
@@ -19,41 +19,45 @@ module Iibee
19
19
 
20
20
  CONTEXT_PATH = "/apiv1/executiongroups/"
21
21
 
22
- attr_reader :isRunning, :runMode, :isRestricted, :hasChildren, :uri, :propertiesUri, :uuid, :name
22
+ attr_reader :isRunning, :runMode, :isRestricted, :hasChildren, :uri, :propertiesUri, :uuid, :name, :options
23
23
 
24
- def initialize(document)
24
+ def initialize(document, options)
25
25
  document.xpath('@*').each do |attribute|
26
26
  instance_variable_set("@#{attribute.name}", cast_value(attribute.name, attribute.value))
27
27
  end
28
+ @options = options
28
29
  end
29
30
 
30
31
  def properties
31
- response = Faraday.get("#{Iibee.configuration.base_url}/#{self.propertiesUri}")
32
+ url = "#{options[:scheme]}://#{options[:host]}:#{options[:port]}".chomp(":")
33
+ response = Faraday.get("#{url}/#{self.propertiesUri}")
32
34
  document = Oga.parse_xml(response.body)
33
35
  @properties = Iibee::ExecutionGroup::Properties.new(document)
34
36
  end
35
37
 
36
- def self.all
38
+ def self.all(options: {})
37
39
  egs = []
38
- response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/")
40
+ url = "#{options[:scheme]}://#{options[:host]}:#{options[:port]}".chomp(":")
41
+ response = Faraday.get("#{url}/#{CONTEXT_PATH}/")
39
42
  document = Oga.parse_xml(response.body)
40
43
  document.xpath('executionGroups/executionGroup').each do |eg|
41
- egs << new(eg)
44
+ egs << new(eg, options)
42
45
  end
43
46
  return egs
44
47
  end
45
48
 
46
- def self.find_by(name: nil)
47
- where(name: name).first
49
+ def self.find_by(name: nil, options: {})
50
+ where(name: name, options: options).first
48
51
  end
49
52
 
50
- def self.where(name: nil)
53
+ def self.where(name: nil, options: {})
51
54
  egs = []
55
+ url = "#{options[:scheme]}://#{options[:host]}:#{options[:port]}".chomp(":")
52
56
  unless name.nil?
53
- response = Faraday.get("#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{name}")
57
+ response = Faraday.get("#{url}/#{CONTEXT_PATH}/#{name}")
54
58
  document = Oga.parse_xml(response.body)
55
59
  document.xpath("//executionGroup[@name='#{name}']").each do |eg|
56
- egs << new(eg)
60
+ egs << new(eg, options)
57
61
  end
58
62
  end
59
63
  return egs
data/lib/iibee/service.rb CHANGED
@@ -4,7 +4,7 @@ require 'oga'
4
4
  module Iibee
5
5
  class Service
6
6
  class Properties
7
- attr_reader :label, :runMode, :uuid, :isRunning, :shortDesc, :longDesc, :processId, :traceLevel, :soapNodesUseEmbeddedListener,
7
+ attr_reader :version, :label, :runMode, :uuid, :isRunning, :shortDesc, :longDesc, :processId, :traceLevel, :soapNodesUseEmbeddedListener,
8
8
  :compiledXPathCacheSizeEntries, :consoleMode, :httpNodesUseEmbeddedListener, :inactiveUserExitList, :activeUserExitList,
9
9
  :traceNodeLevel, :userTraceLevel, :modifyTime, :deployTime, :barFileName
10
10
  def initialize(document)
@@ -19,43 +19,46 @@ module Iibee
19
19
  CONTEXT_PATH = "apiv1/executiongroups"
20
20
 
21
21
  attr_reader :type, :isRunning, :runMode, :startMode, :hasChildren, :uuid, :name, :propertiesUri, :executionGroupName
22
- attr_accessor :uuid, :name
23
22
 
24
- def initialize(document, executionGroupName)
23
+ def initialize(document, executionGroupName, options)
25
24
  document.xpath('@*').each do |attribute|
26
25
  instance_variable_set("@#{attribute.name}", attribute.value)
27
26
  end
28
27
  @executionGroupName = executionGroupName
28
+ @options = options
29
29
  end
30
30
 
31
31
  def executionGroup
32
- Iibee::ExecutionGroup.find_by(name: executionGroupName)
32
+ Iibee::ExecutionGroup.find_by(name: executionGroupName, options: @options)
33
33
  end
34
34
 
35
35
  def properties
36
- response = Faraday.get("#{Iibee.configuration.base_url}/#{self.propertiesUri}")
36
+ url = "#{self.options[:scheme]}://#{self.options[:host]}:#{self.options[:port]}".chomp(":")
37
+ response = Faraday.get("#{url}/#{self.propertiesUri}")
37
38
  document = Oga.parse_xml(response.body)
38
39
  @properties = Iibee::Service::Properties.new(document)
39
40
  end
40
41
 
41
- def self.find_by(executionGroupName: nil, name: nil)
42
- where(executionGroupName: executionGroupName, name: name).first
42
+ def self.find_by(executionGroupName: nil, name: nil, options: {})
43
+ where(executionGroupName: executionGroupName, name: name, options: options).first
43
44
  end
44
45
 
45
- def self.where(executionGroupName: nil, name: nil)
46
+ def self.where(executionGroupName: nil, name: nil, options: {})
46
47
  services = []
48
+
49
+ url = "#{options[:scheme]}://#{options[:host]}:#{options[:port]}".chomp(":")
47
50
 
48
51
  unless executionGroupName.nil?
49
- service_url = "#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/#{executionGroupName}/?depth=2"
52
+ service_url = "/#{CONTEXT_PATH}/#{executionGroupName}/?depth=2"
50
53
  else
51
- service_url = "#{Iibee.configuration.base_url}/#{CONTEXT_PATH}/?depth=3"
54
+ service_url = "/#{CONTEXT_PATH}/?depth=3"
52
55
  end
53
56
 
54
- response = Faraday.get(service_url)
57
+ response = Faraday.get(url+service_url)
55
58
  document = Oga.parse_xml(response.body)
56
-
59
+
57
60
  document.xpath("//service[@name='#{name}']").each do |service|
58
- services << new(service, document.at_xpath("//executionGroup[services/service/@uuid = '#{service.get('uuid')}']").get('name'))
61
+ services << new(service, document.at_xpath("//executionGroup[services/service/@uuid = '#{service.get('uuid')}']").get('name'), options)
59
62
  end
60
63
 
61
64
  return services
data/lib/iibee/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Iibee
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
data/lib/iibee.rb CHANGED
@@ -6,15 +6,5 @@ require "iibee/service"
6
6
  require "iibee/application"
7
7
 
8
8
  module Iibee
9
- class << self
10
- attr_writer :configuration
11
- end
12
-
13
- def self.configuration
14
- @configuration ||= Configuration.new
15
- end
16
9
 
17
- def self.configure
18
- yield(configuration)
19
- end
20
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iibee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - akil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler