chef-handler-status_notifier 0.0.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +4 -0
- data/chef-handler-status_notifier.gemspec +2 -2
- data/lib/chef/handler/status_notifier.rb +5 -2
- data/spec/chef.rb +2 -0
- data/spec/chef/handler.rb +25 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/status_notifier_spec.rb +26 -0
- metadata +27 -5
- data/lib/chef/handler/status_notifier/version.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25b94d5fb43b033b90f22b3172eea91b5c6a355e
|
4
|
+
data.tar.gz: 1ad7aa9146a72435bcf24e7d1ca99386138b8449
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6fc054b86f2cd59f33e7403e46ffb7da65dc45c576a787a9b4d55c338249c718b5a50e6261d7dce327fa3b9ba668a2698db5231904f23c7c67f2fa71c926751
|
7
|
+
data.tar.gz: 3d370da722ce30f628fce809b6e75f37d06524322859fce88274b22101720cb8f965a91ed3f066f67b00e51bfc345dfb77ea370951aeb2de2899eb36dcab942a
|
data/.rspec
ADDED
@@ -1,10 +1,9 @@
|
|
1
1
|
lib = File.expand_path('../lib', __FILE__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'chef/handler/status_notifier/version'
|
4
3
|
|
5
4
|
Gem::Specification.new do |spec|
|
6
5
|
spec.name = "chef-handler-status_notifier"
|
7
|
-
spec.version =
|
6
|
+
spec.version = "0.3.0"
|
8
7
|
spec.authors = ["Faizal Zakaria"]
|
9
8
|
spec.email = ["phaibusiness@gmail.com"]
|
10
9
|
spec.summary = %q{Chef status notifier handler}
|
@@ -18,4 +17,5 @@ Gem::Specification.new do |spec|
|
|
18
17
|
spec.require_paths = ["lib"]
|
19
18
|
spec.add_runtime_dependency "hipchat"
|
20
19
|
spec.add_runtime_dependency "slack-notifier"
|
20
|
+
spec.add_development_dependency "rspec"
|
21
21
|
end
|
data/spec/chef.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
class Chef::Handler
|
2
|
+
class RunStatus
|
3
|
+
def failed?
|
4
|
+
true
|
5
|
+
end
|
6
|
+
|
7
|
+
def formatted_exception
|
8
|
+
"formatted exception"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class Node
|
13
|
+
def name
|
14
|
+
"node"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def run_status
|
19
|
+
@run_status ||= RunStatus.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def node
|
23
|
+
@node ||= Node.new
|
24
|
+
end
|
25
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe StatusNotifierHandler do
|
4
|
+
|
5
|
+
let(:slack_params) do
|
6
|
+
{
|
7
|
+
enabled: true,
|
8
|
+
webhook_url: "https://slacktest.com",
|
9
|
+
channel: "#test",
|
10
|
+
username: "FaiNow-Test"
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:hipchat_params) do
|
15
|
+
{
|
16
|
+
enabled: true
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should run without error' do
|
21
|
+
allow_any_instance_of(StatusNotifierHandler).to receive(:send_to_slack).and_return(true)
|
22
|
+
allow_any_instance_of(StatusNotifierHandler).to receive(:send_to_hipchat).and_return(true)
|
23
|
+
expect{StatusNotifierHandler.new(slack_params, hipchat_params).report}.to_not raise_error
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-handler-status_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Faizal Zakaria
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hipchat
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: Chef status notifier handler
|
42
56
|
email:
|
43
57
|
- phaibusiness@gmail.com
|
@@ -46,13 +60,17 @@ extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
62
|
- ".gitignore"
|
63
|
+
- ".rspec"
|
49
64
|
- Gemfile
|
50
65
|
- LICENSE.txt
|
51
66
|
- README.md
|
52
67
|
- Rakefile
|
53
68
|
- chef-handler-status_notifier.gemspec
|
54
69
|
- lib/chef/handler/status_notifier.rb
|
55
|
-
-
|
70
|
+
- spec/chef.rb
|
71
|
+
- spec/chef/handler.rb
|
72
|
+
- spec/spec_helper.rb
|
73
|
+
- spec/status_notifier_spec.rb
|
56
74
|
homepage: ''
|
57
75
|
licenses:
|
58
76
|
- MIT
|
@@ -73,8 +91,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
91
|
version: '0'
|
74
92
|
requirements: []
|
75
93
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.4.
|
94
|
+
rubygems_version: 2.4.7
|
77
95
|
signing_key:
|
78
96
|
specification_version: 4
|
79
97
|
summary: Chef status notifier handler
|
80
|
-
test_files:
|
98
|
+
test_files:
|
99
|
+
- spec/chef.rb
|
100
|
+
- spec/chef/handler.rb
|
101
|
+
- spec/spec_helper.rb
|
102
|
+
- spec/status_notifier_spec.rb
|