Class: Puppet::Cleaner::OctalMode
- Defined in:
- lib/puppet-cleaner/workers/octalmode.rb
Instance Method Summary collapse
Methods inherited from Worker
Instance Method Details
#operate(line) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/puppet-cleaner/workers/octalmode.rb', line 7 def operate(line) prev = line.prev.name == :BLANK ? line.prev(2) : line.prev return if prev.value != "mode" pos = line.next.name == :BLANK ? line.position + 2 : line.position + 1 mode = line.parts[pos] if mode.value =~ /^0?[0-7]{1,4}$/ line.parts[pos] = Part.create([:STRING, {:value => mode.value.rjust(4, "0")}]) end end |
#part_names ⇒ Object
3 4 5 |
# File 'lib/puppet-cleaner/workers/octalmode.rb', line 3 def part_names [:FARROW] end |