chef-handler-motd 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # ChefMOTD handler
2
2
  Update your MOTD after a Chef run with various data
3
3
 
4
- # Prerequisites
4
+ ## Prerequisites
5
5
  Mostly, just having MOTD configured. We use Estately's [motd](https://github.com/estately/cookbooks/tree/master/motd) cookbook
6
6
 
7
- # Usage
7
+ ## Usage
8
8
  Either just pull the handler file into a files directory of one of your
9
9
  cookbooks, or download as a Rubygem and source it that way.
10
10
 
@@ -35,9 +35,12 @@ end
35
35
  ### Arguments
36
36
  * `priority` - Determines where the Chef data is displayed in MOTD (default 05)
37
37
 
38
- # Author
39
- Ops at Simple <ops@simple.com>
38
+ ## Questions?
39
+ Hop on ##simple on Freenode with any questions or concerns.
40
40
 
41
- # License
41
+ ## Author
42
+ Simple Finance <ops@simple.com>
43
+
44
+ ## License
42
45
  Apache License, Version 2.0
43
46
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'chef-handler-motd'
3
- s.version = '0.3.1'
3
+ s.version = '0.3.2'
4
4
  s.author = 'Simple Finance'
5
5
  s.email = 'ops@simple.com'
6
6
  s.homepage = 'http://github.com/SimpleFinance/chef-handler-motd'
@@ -24,13 +24,22 @@ require 'chef'
24
24
  require 'chef/handler'
25
25
 
26
26
  class ChefMOTD < Chef::Handler
27
- attr_reader :priority
27
+ attr_reader :priority, :keep_old_entries
28
28
 
29
- def initialize(options = {:priority => '05'})
29
+ def initialize(options = defaults)
30
30
  @priority = options[:priority]
31
+ @keep_old_entries = options[:keep_old_entries]
32
+ end
33
+
34
+ def defaults
35
+ return {
36
+ :priority => '05',
37
+ :keep_old_entries => false
38
+ }
31
39
  end
32
40
 
33
41
  def delete_outdated
42
+ if @keep_old_entries then return end
34
43
  Dir.entries('/etc/update-motd.d').select do |entry|
35
44
  /chef-motd/.match(entry) && !/^#{@priority}/.match(entry)
36
45
  end.each do |del|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-handler-motd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
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: 2013-05-28 00:00:00.000000000 Z
12
+ date: 2013-10-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Edits MOTD at the end of a Chef run
15
15
  email: ops@simple.com
@@ -46,4 +46,3 @@ signing_key:
46
46
  specification_version: 3
47
47
  summary: Edits MOTD at the end of a Chef run
48
48
  test_files: []
49
- has_rdoc: