Class: Source2MD::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/source2md/scanner.rb

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Scanner

Returns a new instance of Scanner.



3
4
5
# File 'lib/source2md/scanner.rb', line 3

def initialize(content)
  @content = content
end

Instance Method Details

#to_aObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/source2md/scanner.rb', line 7

def to_a
  v = @content
  v = v.rstrip + "\n\n"
  if Source2MD.xmp_out_exclude
    v = v.remove(RE.stdout_re)
  end
  v = v.scan(paragraph_re)
  v = v.collect { |e| e.rstrip + "\n" }
  v = v.find_all(&:present?)
end