class FashionPolice::SpacesInFunctionDeclarations

Public Instance Methods

error_message() click to toggle source
# File lib/fashion-police.rb, line 35
def error_message
  "Put spaces in function declarations"
end
test(string) click to toggle source
# File lib/fashion-police.rb, line 28
def test(string)
  return false if string.match(/function\(\.*\)\{/)
  return false if string.match(/function\s+\(.*\)\{/)
  return true if string.match(/function\s+\(.*\)\s+\{/)
  return true
end