Class: FashionPolice::SpacesAroundElses
- Inherits:
-
Object
- Object
- FashionPolice::SpacesAroundElses
- Defined in:
- lib/fashion-police.rb
Instance Method Summary collapse
Instance Method Details
#error_message ⇒ Object
51 52 53 |
# File 'lib/fashion-police.rb', line 51 def "Put spaces around elses" end |
#test(string) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# 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 |