Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/prak/bootstrap.rb

Instance Method Summary collapse

Instance Method Details

#expand_tabs(shift = 0) ⇒ Object



12
13
14
15
16
# File 'lib/prak/bootstrap.rb', line 12

def expand_tabs(shift=0)
  expanded = dup
  1 while expanded.sub!(/\t+/){ " "*($&.size*8 - ($`.size+shift)%8) }
  expanded
end