activerecord-zabbix 0.1.3 → 0.1.4

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.
@@ -22,26 +22,26 @@ Gem::Specification.new do |spec|
22
22
  # du -a lib spec README* *.gemspec | awk '{print($2)}' | while read file; do echo "'$file',"; done
23
23
  #
24
24
 
25
+ 'lib/activerecord/zabbix.rb',
25
26
  'lib/activerecord-zabbix.rb',
26
27
  'lib/boot.rb',
27
28
  'lib/zabbix/connect.rb',
29
+ 'lib/zabbix/event.rb',
28
30
  'lib/zabbix/function.rb',
29
31
  'lib/zabbix/host.rb',
30
32
  'lib/zabbix/item.rb',
33
+ 'lib/zabbix/proxy.rb',
31
34
  'lib/zabbix/trigger.rb',
32
35
  'lib/zabbix/version.rb',
33
36
  'lib/zabbix/zabbix.rb',
34
- 'lib/zabbix',
35
- 'lib',
36
37
  'spec/README',
37
38
  'spec/spec_helper.rb',
38
39
  'spec/zabbix/connect_spec.rb',
39
40
  'spec/zabbix/function_spec.rb',
40
41
  'spec/zabbix/host_spec.rb',
41
42
  'spec/zabbix/item_spec.rb',
43
+ 'spec/zabbix/proxy_spec.rb',
42
44
  'spec/zabbix/trigger_spec.rb',
43
- 'spec/zabbix',
44
- 'spec',
45
45
  'README.md',
46
46
  'activerecord-zabbix.gemspec'
47
47
 
File without changes
@@ -0,0 +1,11 @@
1
+ module Zabbix
2
+
3
+ class Event < ::ActiveRecord::Base
4
+
5
+ self.table_name = 'events'
6
+ self.primary_key = 'eventid'
7
+
8
+
9
+ end
10
+
11
+ end
@@ -0,0 +1,26 @@
1
+ module Zabbix
2
+
3
+ #
4
+ # inherit might not work on account of the belongs_to :proxies in Host
5
+ #
6
+ # class Proxy < Host
7
+ #
8
+ # threw a ConnectionNotEstablished when extending Host ??? (activerecord bug?)
9
+ #
10
+ class Proxy < ::ActiveRecord::Base
11
+
12
+ self.table_name = 'hosts'
13
+ self.primary_key = 'hostid'
14
+
15
+ default_scope where(:status => [5,6] )
16
+
17
+ scope :active, where(:status => 5 )
18
+ scope :passive, where(:status => 6 )
19
+
20
+ has_many :items, :class_name => "Item", :foreign_key => "hostid"
21
+ #has_many :host_group, :class_name => "HostGroup", :foreign_key => "hostid"
22
+ #has_many :groups, :through => :host_group
23
+
24
+ end
25
+
26
+ end
@@ -2,8 +2,8 @@ GEM_NAME = 'activerecord-zabbix'
2
2
 
3
3
  module Zabbix
4
4
 
5
- Version = VERSION = '0.1.3'
6
-
5
+ Version = VERSION = '0.1.4'
6
+
7
7
  end
8
8
 
9
9
  MODULE_NAME = Zabbix
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe Zabbix::Proxy do
4
+
5
+ # pending
6
+
7
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-zabbix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,12 +36,15 @@ executables: []
36
36
  extensions: []
37
37
  extra_rdoc_files: []
38
38
  files:
39
+ - lib/activerecord/zabbix.rb
39
40
  - lib/activerecord-zabbix.rb
40
41
  - lib/boot.rb
41
42
  - lib/zabbix/connect.rb
43
+ - lib/zabbix/event.rb
42
44
  - lib/zabbix/function.rb
43
45
  - lib/zabbix/host.rb
44
46
  - lib/zabbix/item.rb
47
+ - lib/zabbix/proxy.rb
45
48
  - lib/zabbix/trigger.rb
46
49
  - lib/zabbix/version.rb
47
50
  - lib/zabbix/zabbix.rb
@@ -51,6 +54,7 @@ files:
51
54
  - spec/zabbix/function_spec.rb
52
55
  - spec/zabbix/host_spec.rb
53
56
  - spec/zabbix/item_spec.rb
57
+ - spec/zabbix/proxy_spec.rb
54
58
  - spec/zabbix/trigger_spec.rb
55
59
  - README.md
56
60
  - activerecord-zabbix.gemspec
@@ -74,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
78
  version: '0'
75
79
  requirements: []
76
80
  rubyforge_project:
77
- rubygems_version: 1.8.23
81
+ rubygems_version: 1.8.24
78
82
  signing_key:
79
83
  specification_version: 3
80
84
  summary: ActiveRecord access into Zabbix