Method: Gloo::Persist::FileLoader#tab_count
- Defined in:
- lib/gloo/persist/file_loader.rb
#tab_count(line) ⇒ Object
Get the number of leading tabs.
169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/gloo/persist/file_loader.rb', line 169 def tab_count( line ) i = 0 if line[ i ] == ' ' i += 1 while line[ i ] == ' ' tab_equiv = ( i / SPACE_CNT ).to_i puts "Found #{i} spaces => #{tab_equiv}" if @debug return tab_equiv end i += 1 while line[ i ] == "\t" return i end |