class String

Public Instance Methods

remove_comments(padding) click to toggle source
# File lib/ruval.rb, line 33
def remove_comments(padding)
  # not a perfect regex but good enough to detect most comments. eg it wont work for lines like "fun('#not a comment')"
  self.gsub(/ *#.*/, '').chop.ljust(padding) + ' # '
end