promotion 1.3.2 → 1.3.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/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == Version 1.3.3
2
+ - Schedule in newsyslog handles $-formats (starting with 'D', 'W', or 'M')
3
+ and @-formats (containing 'T') as well as integer hours and '*'
4
+
1
5
  == Version 1.3.2
2
6
  - Fixed defect in crontab where comments were not prefixed with #
3
7
 
@@ -37,7 +37,16 @@ module Newsyslog
37
37
  contents << "%-7s" % (nsl.attributes["Mode"] || "0640")
38
38
  contents << "%-7s" % (nsl.attributes["Count"] || "*")
39
39
  contents << "%-7s" % (nsl.attributes["Size"] || "*")
40
- contents << "%-9s" % (nsl.attributes["When"] || "*")
40
+ # treat as $-format if starts with D,W,M; treat as integer if integer
41
+ # else treat as @-format if digits with a 'T'
42
+ sched = nsl.attributes["When"] || "*"
43
+ if sched[0] == "D" or sched[0] == "W" or sched[0] == "M"
44
+ contents << "$%-9s" % sched
45
+ elsif sched.include?("T")
46
+ contents << "@%-9s" % sched
47
+ else
48
+ contents << "%-9s" % sched
49
+ end
41
50
  contents << "Z" if (nsl.attributes["Zip"] || "true") == "true"
42
51
  contents << "B" if (nsl.attributes["Binary"] || "false") == "true"
43
52
  contents << "\n"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promotion
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 2
10
- version: 1.3.2
9
+ - 3
10
+ version: 1.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richard Kernahan