Class: Reacco::Extractor
- Inherits:
-
Object
- Object
- Reacco::Extractor
- Defined in:
- lib/reacco/extractor.rb,
lib/reacco/extractor/block.rb
Overview
Reacco::Extractor [class] Extracts comments from list of files.
#### Instantiating Call the constructor with a list of files.
ex = Extractor.new(Dir['./**/*.rb'])
Defined Under Namespace
Classes: Block
Instance Method Summary collapse
-
#blocks ⇒ Object
blocks [method] Returns an array of ‘Block` instances.
-
#initialize(files, root = nil, options = {}) ⇒ Extractor
constructor
A new instance of Extractor.
Constructor Details
Instance Method Details
#blocks ⇒ Object
blocks [method] Returns an array of ‘Block` instances.
ex.blocks
ex.blocks.map { |b| puts "file: #{b.file}" }
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/reacco/extractor.rb', line 28 def blocks @blocks ||= begin @files.map do |file| if File.file?(file) input = File.read(file) get_blocks(input, unroot(file)) end end.compact.flatten end end |