chef-journalist 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/chef-journalist.gemspec +1 -1
- data/lib/chef-journalist.rb +12 -15
- metadata +3 -3
data/chef-journalist.gemspec
CHANGED
data/lib/chef-journalist.rb
CHANGED
@@ -1,22 +1,19 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'chef/handler'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
@resource_types = resource_types.map {|t| t.to_sym }
|
10
|
-
end
|
4
|
+
class Journalist < Chef::Handler
|
5
|
+
def initialize(resource_types=[])
|
6
|
+
Chef::Log.info "Generating updated resource report ..."
|
7
|
+
@resource_types = resource_types.map {|t| t.to_sym }
|
8
|
+
end
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
19
|
-
updated_resources.each {|r| Chef::Log.info " #{r.to_s}" }
|
10
|
+
def report
|
11
|
+
updated_resources = case
|
12
|
+
when @resource_types.empty?
|
13
|
+
run_status.updated_resources
|
14
|
+
else
|
15
|
+
run_status.updated_resources.select {|r| @resource_types.include? r.resource_name }
|
20
16
|
end
|
17
|
+
updated_resources.each {|r| Chef::Log.info " #{r}" }
|
21
18
|
end
|
22
19
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-journalist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Porter
|