puppet-cleaner 0.3.0 → 0.3.1

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,22 +1,30 @@
1
+ 0.3.1 2013-05-09
2
+ -----------------
3
+ Bug fixes:
4
+ * file resources were incorrectly transformed when a selector was used
5
+ for ensure attributes
6
+
7
+ * comments starting with '##' were transformed to '# #'
8
+
1
9
  0.3.0 2013-05-05
2
10
  -----------------
3
11
  Features:
4
- * New worker for quoting resource titles (-r option)
12
+ * New worker for quoting resource titles (-r option)
5
13
 
6
14
  0.2.1 2013-05-03
7
15
  -----------------
8
16
  Bug fix:
9
- * puppet-diff and puppet-inspect were not updated with puppet 3 support
17
+ * puppet-diff and puppet-inspect were not updated with puppet 3 support
10
18
 
11
19
  0.2.0 2013-04-29
12
20
  -----------------
13
21
  Features:
14
- * puppet 3 support
22
+ * puppet 3 support
15
23
 
16
24
  0.1.1 2013-04-26
17
25
  -----------------
18
26
  Bug fix:
19
- * uninitialized constant Puppet::Cleaner::Worker (NameError) runtime error fixed
27
+ * uninitialized constant Puppet::Cleaner::Worker (NameError) runtime error fixed
20
28
 
21
29
  0.1.0 2013-04-16
22
30
  -----------------
data/README.md CHANGED
@@ -47,7 +47,7 @@ and are not optional.
47
47
  -o, --octalmode represents file modes as a 4 digits string
48
48
  -r, --resourcetitles quotes resource titles
49
49
  -t n, --softtabs n indents by n spaces
50
- -v, --quotedvariables emoves unneeded quotes around variables
50
+ -v, --quotedvariables removes unneeded quotes around variables
51
51
  -w, --trailingws removes trailing white space
52
52
 
53
53
  ### puppet-diff
@@ -91,7 +91,7 @@ module Puppet::Cleaner
91
91
 
92
92
  class Comment < Part
93
93
  def to_s
94
- value.empty? ? "#" : "# #{value}"
94
+ value.empty? || value[0..0] == "#" ? "##{value}" : "# #{value}"
95
95
  end
96
96
  end
97
97
 
@@ -11,9 +11,12 @@ module Puppet::Cleaner
11
11
  return if pos >= line.parts.size || line.parts[pos].name != :LBRACE
12
12
 
13
13
  foreach_colon(line) {|colonpos|
14
- start, pos = get_param(line, 'ensure', colonpos)
14
+ start, endpos = get_param(line, 'ensure', colonpos)
15
15
  next if start.nil?
16
- pos -= 1 if line.parts[pos].name == :COMMA
16
+ pos = start + 1
17
+ pos += 1 while pos < line.parts.size && line.parts[pos].name != :FARROW
18
+ pos += 1
19
+ pos += 1 while pos < line.parts.size && [:BLANK, :RETURN, :COMMENT, :MLCOMMENT].include?(line.parts[pos].name)
17
20
  value = line.parts[pos].value
18
21
  next if [:NAME, :STRING].include?(line.parts[pos].name) && %w(present absent file directory link symlink).include?(value)
19
22
  next if line.parts[pos].name == :VARIABLE
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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-06 00:00:00.000000000 Z
12
+ date: 2013-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: puppet