zabbixapi 0.5.1b9 → 0.5.1b10

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,7 @@ class ZabbixApi
20
20
 
21
21
  def create_or_update(data)
22
22
  puts "[DEBUG] Call create_or_update with parametrs: #{data.inspect}" if @client.options[:debug]
23
+
23
24
  id = get_id(indentify.to_sym => data[indentify.to_sym])
24
25
  id ? update(data.merge(key.to_sym => id.to_s)) : create(data)
25
26
  end
@@ -34,7 +35,8 @@ class ZabbixApi
34
35
  end
35
36
 
36
37
  unless dump.deep_include?(data, key.to_sym)
37
- result = @client.api_request(:method => "#{method_name}.update", :params => data)
38
+ data_update = array_flag ? [data] : data
39
+ result = @client.api_request(:method => "#{method_name}.update", :params => data_update)
38
40
  parse_keys result
39
41
  else
40
42
  item_id
@@ -89,7 +91,7 @@ class ZabbixApi
89
91
 
90
92
  def get_or_create(data)
91
93
  puts "[DEBUG] Call get_or_create with parametrs: #{data.inspect}" if @client.options[:debug]
92
-
94
+
93
95
  unless id = get_id(data)
94
96
  id = create(data)
95
97
  end
@@ -1,3 +1,3 @@
1
1
  class ZabbixApi
2
- VERSION = "0.5.1b9"
2
+ VERSION = "0.5.1b10"
3
3
  end
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.5.1b9
4
+ version: 0.5.1b10
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
63
63
  version: '0'
64
64
  segments:
65
65
  - 0
66
- hash: 2937401785949579712
66
+ hash: -675997134437473761
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements: