zabbixapi 0.5.1b11 → 0.5.1b12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,20 +1,12 @@
1
- class Hash
2
-
3
- def deep_include?(sub_hash)
4
- sub_hash.keys.all? do |key|
5
- self.has_key?(key) && if sub_hash[key].is_a?(Hash)
6
- self[key].is_a?(Hash) && self[key].deep_include?(sub_hash[key])
7
- else
8
- self[key] == sub_hash[key]
9
- end
10
- end
11
- end
12
-
13
- end
14
-
15
1
  class ZabbixApi
16
2
  class Basic
17
3
 
4
+ def hash_equals?(a, b)
5
+ hash1 = a.merge(b)
6
+ hash2 = b.merge(a)
7
+ hash1 == hash2
8
+ end
9
+
18
10
  def log(message)
19
11
  puts "#{message}" if @client.options[:debug]
20
12
  end
@@ -34,7 +34,11 @@ class ZabbixApi
34
34
  dump = symbolize_keys(item) if item[key].to_i == data[key.to_sym].to_i
35
35
  end
36
36
 
37
- if dump.deep_include?(data)
37
+ puts "dump: #{dump}"
38
+ puts "data: #{data}"
39
+
40
+ if hash_equals?(dump, data) #dump.deep_include?(data)
41
+ puts "eq keys!"
38
42
  item_id
39
43
  else
40
44
  data_update = array_flag ? [data] : data
@@ -13,9 +13,5 @@ class ZabbixApi
13
13
  "description"
14
14
  end
15
15
 
16
- def create_or_update(data)
17
- raise "Don't use this shit, use get_or_create"
18
- end
19
-
20
16
  end
21
17
  end
@@ -1,3 +1,3 @@
1
1
  class ZabbixApi
2
- VERSION = "0.5.1b11"
2
+ VERSION = "0.5.1b12"
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.1b11
4
+ version: 0.5.1b12
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -79,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
79
79
  version: '0'
80
80
  segments:
81
81
  - 0
82
- hash: -2676631147213702854
82
+ hash: 2277446654334313109
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements: