flowchef 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dc1506d57750aa44bd7371f0b30d3ce2b058935
4
- data.tar.gz: 6ac9bef590346350e7786c096c85aea599f87c5b
3
+ metadata.gz: 9d411b29d56632e177e76d2662df2c74d189c86b
4
+ data.tar.gz: c20a01b8b58df065c1053d48fbbf2a687163838d
5
5
  SHA512:
6
- metadata.gz: de1b0a178b385235dc17bae77a0cf55d6bce48da6fb51b6492bfe499ab344624f19392b2dfce99579a5dea7631f8aaef36f5d4aa6ea8d55ebad1552da0a87130
7
- data.tar.gz: 931f94c4c28f02536b59508289a937a23211fbbaab1b0ae2be10c0fd8bcd04cd9aa14ebd6f0e7090ba8871ddcafe37cbe7232782435655248092a35d3ef0d36a
6
+ metadata.gz: d5673b174c0591a2582002e4d20545e11040599c2f48853cfb2eac5d5dc80da7c6ff7d8e3e6f3688d873594920aaa7e09797349f9f109e01c2959f99a5457c61
7
+ data.tar.gz: 3ca3fbc04bde76cda38a166a394f1375b143db387d9a44b643d5f7005a865a3e6d35640f9b15390605c6b7968ab6ad280a41f85d193c4b578e6cd8d755566dc5
data/README.md CHANGED
@@ -17,5 +17,24 @@ Or install it yourself as:
17
17
 
18
18
  $ gem install flowchef
19
19
 
20
+ ### Install on your chef client
21
+
22
+ We use a cookbook to manage our handlers, you can install this gem
23
+ in your own cookbook by adding this to your recipe.
24
+
25
+ chef_gem "flowchef" do
26
+ action :install
27
+ end
28
+
20
29
  ## Usage
21
30
 
31
+ You can use the [`chef_handler`](https://github.com/opscode-cookbooks/chef_handler) cookbook to
32
+ register it as so
33
+
34
+ chef_handler "Flowchef::NotifyInbox" do
35
+ source 'flowchef'
36
+ arguments [:api_token => "Your Flow API Token",
37
+ :tags => ["array","of","tags"]]
38
+ supports :exception => true
39
+ action :enable
40
+ end
data/lib/flowchef.rb CHANGED
@@ -35,7 +35,7 @@ module Flowchef
35
35
 
36
36
  def report
37
37
  msg = <<-eos
38
- <h2>Chef failuers on #{node.name}</h2>
38
+ <h2>Chef failures on #{node.name}</h2>
39
39
  #{run_status.formatted_exception}
40
40
  eos
41
41
  flow = Flowdock::Flow.new(:api_token => @api_token,
@@ -44,7 +44,7 @@ module Flowchef
44
44
  :address => "noreply@#{node.fqdn}"})
45
45
  flow.push_to_team_inbox(:subject => "Chef failuers on #{node.name}",
46
46
  :content => msg,
47
- :tags => @tags)
47
+ :tags => [])
48
48
  end
49
49
 
50
50
  def blank?(var)
@@ -1,3 +1,3 @@
1
1
  module Flowchef
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,30 @@
1
+ require "flowchef"
2
+
3
+ describe Flowchef::NotifyInbox do
4
+ it "should create a new flowchef notifier for a single token" do
5
+ lambda {
6
+ Flowchef::NotifyInbox.new(:api_token => "test")
7
+ }.should_not raise_error
8
+ end
9
+
10
+ it "should create a new flowchef notifier for an array of tokens" do
11
+ lambda {
12
+ Flowchef::NotifyInbox.new(:api_token => ["test", "test"])
13
+ }.should_not raise_error
14
+ end
15
+
16
+ it "should set tags" do
17
+ lambda {
18
+ Flowchef::NotifyInbox.new(:api_token => "test",
19
+ :tags => ["tag1","tag2"])
20
+ }.should_not raise_error
21
+ end
22
+
23
+ it "should fail (tags can only be strings)" do
24
+ lambda {
25
+ Flowchef::NotifyInbox.new(:api_token => "test",
26
+ :tags => ["tag1", Array])
27
+ }.should raise_error(Flowchef::NotifyInbox::InvalidParameterError)
28
+ end
29
+
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flowchef
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ómar Kjartan Yasin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-12 00:00:00.000000000 Z
11
+ date: 2013-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -95,6 +95,7 @@ files:
95
95
  - flowchef.gemspec
96
96
  - lib/flowchef.rb
97
97
  - lib/flowchef/version.rb
98
+ - spec/flowchef_spec.rb
98
99
  homepage: ''
99
100
  licenses:
100
101
  - MIT
@@ -119,4 +120,5 @@ rubygems_version: 2.0.0
119
120
  signing_key:
120
121
  specification_version: 4
121
122
  summary: ''
122
- test_files: []
123
+ test_files:
124
+ - spec/flowchef_spec.rb