class Object

Public Instance Methods

check() click to toggle source
# File lib/puppet-lint/plugins/variable_contains_upcase.rb, line 2
def check
  tokens.select { |r|
    Set[:VARIABLE, :UNENC_VARIABLE].include? r.type
  }.each do |token|
    if token.value.gsub(/\[.+?\]/, '').match(/[A-Z]/)
      notify :warning, {
        :message => 'variable contains a capital letter',
        :line    => token.line,
        :column  => token.column,
        :token   => token,
      }
    end
  end
end
fix(problem) click to toggle source
# File lib/puppet-lint/plugins/variable_contains_upcase.rb, line 16
def fix(problem)
  problem[:token].value.downcase!
end