class FashionPolice::SpacesAroundElses
Public Instance Methods
error_message()
click to toggle source
# File lib/fashion-police.rb, line 51 def error_message "Put spaces around elses" end
test(string)
click to toggle source
# File lib/fashion-police.rb, line 41 def test(string) return true if string.match(/\} else \{/) return false if string.match(/\}else\{/) return false if string.match(/\} +else\{/) return false if string.match(/\}else +\{/) return false if string.match(/\} +else ?\{/) return false if string.match(/\} ?else +\{/) return true end