henpecked 0.0.2 → 0.0.3

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.
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - jruby-19mode
data/Gemfile CHANGED
@@ -7,3 +7,4 @@ gemspec
7
7
 
8
8
  gem "rake", "~> 0.9"
9
9
  gem "rspec", "~> 2.8.0"
10
+ gem "delorean", "~> 1.2.0"
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Heckpacked
2
2
  Is a lightweight library for Icinga passive checks. It helps you raise alerts in very easy way in your application :)
3
3
 
4
+ ## Travis
5
+ Ci status
6
+ [![Build Status](https://secure.travis-ci.org/JakubOboza/henpecked.png?branch=master)](http://travis-ci.org/JakubOboza/henpecked)
7
+
4
8
  ## Passive Checks
5
9
  It is implementing passive checks
6
10
  <http://docs.icinga.org/latest/en/passivechecks.html>
@@ -92,4 +92,6 @@ module Henpecked
92
92
 
93
93
  end
94
94
 
95
- end
95
+ end
96
+
97
+
@@ -1,10 +1,10 @@
1
1
  module Henpecked
2
2
 
3
3
  def self.push(alert)
4
- raise Exception.new "Alert object has to have icinga_description method" unless alert.respond_to?(:icinga_description)
5
- File.open(Henpecked.file_path, "w") do |file|
6
- file.write(alert.icinga_description + "\n")
7
- end
4
+ raise Exception.new "Alert object has to have icinga_description method" unless alert.respond_to?(:icinga_description)
5
+ File.open(Henpecked.file_path, "a") do |file|
6
+ file.write(alert.icinga_description + "\n")
7
+ end
8
8
  end
9
9
 
10
10
  end
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Henpecked
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
data/spec/alerts_spec.rb CHANGED
@@ -53,4 +53,24 @@ describe Henpecked do
53
53
  test.command.should eql("TASTY_COOKIE;")
54
54
  end
55
55
 
56
+ describe "alert classes" do
57
+
58
+ before(:each) do
59
+ Delorean.back_to_the_present
60
+ end
61
+
62
+ it "should have AcknowledgeHostProblem class" do
63
+ Henpecked::Alert::AcknowledgeHostProblem.new.icinga_description.should_not be_nil
64
+ Henpecked::Alert::AcknowledgeHostProblemExpire.new.icinga_description.should_not be_nil
65
+ Henpecked::Alert::SendCustomHostNotification.new.icinga_description.should_not be_nil
66
+ end
67
+
68
+ it "should create correct custom host notification" do
69
+ Delorean.time_travel_to "01/01/1985"
70
+ scn = Henpecked::Alert::SendCustomHostNotification.new(1,1,1,"Test Lol!")
71
+ scn.icinga_description.should eql("[473428800] SEND_CUSTOM_HOST_NOTIFICATION; 1;1;1;Test Lol!")
72
+ end
73
+
74
+ end
75
+
56
76
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'bundler/setup'
3
+ require 'delorean'
3
4
  # our gem
4
5
  require 'henpecked'
5
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: henpecked
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
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-05-18 00:00:00.000000000Z
12
+ date: 2012-05-23 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: This gem provides simple api to work with Icinga passive checks
15
15
  email:
@@ -20,6 +20,7 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - .gitignore
22
22
  - .rspec
23
+ - .travis.yml
23
24
  - Gemfile
24
25
  - LICENSE
25
26
  - README.md