Module: OrgParse::Utils

Included in:
StructParser, StructScanner
Defined in:
lib/org-parse/utils.rb

Instance Method Summary collapse

Instance Method Details

#get_indent(str) ⇒ Object

とりあえず



7
8
9
10
11
# File 'lib/org-parse/utils.rb', line 7

def get_indent(str)
  return 0 if str.empty?
  str =~ /^(\s*)/
  $1.gsub(/([^\t]{8})|([^\t]*)\t/n){ [$+].pack("A8") }.size
end