Class: Puppet::Cleaner::UnneededQuotes

Inherits:
Worker
  • Object
show all
Defined in:
lib/puppet-cleaner/workers/unneededquotes.rb

Instance Method Summary collapse

Methods inherited from Worker

#get_param

Instance Method Details

#operate(line) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/puppet-cleaner/workers/unneededquotes.rb', line 7

def operate(line)
  return unless line.prev.name == :DQPRE && line.next.name == :DQPOST
  return unless line.prev.value.empty? && line.next.value.empty?
  pos = line.position
  line.remove(pos + 1)
  line.remove(pos - 1)
  line.back!
end

#part_namesObject



3
4
5
# File 'lib/puppet-cleaner/workers/unneededquotes.rb', line 3

def part_names
  [:VARIABLE]
end