zabby 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,12 @@
2
2
 
3
3
  List of visible changes:
4
4
 
5
+ == v0.1.1 (2012/03/14)
6
+
7
+ * Initialization code (the argument given to "Zabby.init") was not executed.
8
+ * Update documentation and code sample for the barebone API ot get it working on
9
+ Ruby 1.8.x.
10
+
5
11
  == v0.1.0 (2012/03/14)
6
12
 
7
13
  * Major refactoring: Zabbix items are now represented by classes instead
@@ -177,8 +177,8 @@ The barebone API can be used in Ruby like this:
177
177
  login
178
178
  end
179
179
 
180
- pp z.run { Host.get "filter" => { "host" => "master.example.com" } }
181
- pp z.run { Item.get "host" => "master.example.com", "output" => "shorten" }
180
+ pp z.run { Zabby::Host.get "filter" => { "host" => "master.example.com" } }
181
+ pp z.run { Zabby::Item.get "host" => "master.example.com", "output" => "shorten" }
182
182
 
183
183
 
184
184
  - The _server_, _user_ and _passord_ are necessary.
@@ -186,6 +186,12 @@ The barebone API can be used in Ruby like this:
186
186
  to the URI automatically.
187
187
  - The <em>proxy_*</em> settings are optionnal.
188
188
 
189
+ ==== Note
190
+
191
+ When using the barebone API you have to prefix the Zabbix classes (Host, Item, Trigger, etc.) with the "Zabby::"
192
+ namespace, otherwise Ruby won't find the classes. This is apparently the way Ruby 1.8.x looks up constants, the
193
+ problem should not happen with Ruby 1.9.x...
194
+
189
195
  == Requirements
190
196
 
191
197
  - Ruby 1.8.5. <b>IT BASICALLY RUNS ANYWHERE!</b>
@@ -21,6 +21,8 @@ require 'zabby/runner'
21
21
 
22
22
  module Zabby
23
23
  def self.init &block
24
- Zabby::Runner.instance &block
24
+ z = Zabby::Runner.instance
25
+ z.run(&block) if block_given?
26
+ z
25
27
  end
26
28
  end
@@ -20,14 +20,11 @@ module Zabby
20
20
 
21
21
  attr_reader :config, :connection
22
22
 
23
- def initialize &block
23
+ def initialize
24
24
  @config = Zabby::Config.new
25
25
  @connection = Zabby::Connection.new
26
26
  @pure_binding = instance_eval "binding"
27
27
 
28
- # Configure the application
29
- run(&block) if block_given?
30
-
31
28
  # Configure Readline for the shell, if available
32
29
  if Object.const_defined?(:Readline)
33
30
  @readline = true
@@ -4,5 +4,5 @@
4
4
  # License:: Simplified BSD License
5
5
 
6
6
  module Zabby
7
- VERSION = "0.1.0"
7
+ VERSION = "0.1.1"
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Farzad FARID