zabbixapi 0.1.5a1 → 0.1.5a2

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.
@@ -63,12 +63,18 @@ module Zabbix
63
63
  response = send_request(message)
64
64
 
65
65
  unless response.empty? then
66
- template_ids = response.keys()
67
66
  result = {}
68
67
 
69
- template_ids.each() do |template_id|
70
- template_name = response[template_id]['host']
71
- result[template_id] = template_name
68
+ if reponse.kind_of? Hash
69
+ template_ids = response.keys()
70
+ template_ids.each() do |template_id|
71
+ template_name = response[template_id]['host']
72
+ result[template_id] = template_name
73
+ end
74
+ elsif response.kind_of? Array
75
+ response.each do |template_info|
76
+ result[template_info['hostid']] = template_info['host']
77
+ end
72
78
  end
73
79
  else
74
80
  result = nil
data/zabbixapi.gemspec CHANGED
@@ -4,7 +4,7 @@ require 'rake'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
 
7
- spec.version = '0.1.5a1'
7
+ spec.version = '0.1.5a2'
8
8
  spec.name = 'zabbixapi'
9
9
  spec.summary = 'Ruby module for work with zabbix api.'
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbixapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5a1
4
+ version: 0.1.5a2
5
5
  prerelease: 5
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: 2012-06-18 00:00:00.000000000Z
12
+ date: 2012-07-27 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: ! 'Ruby module for work with zabbix api. '
15
15
  email: verm666@gmail.com
@@ -64,3 +64,4 @@ signing_key:
64
64
  specification_version: 3
65
65
  summary: Ruby module for work with zabbix api.
66
66
  test_files: []
67
+ has_rdoc: true