Class: Watnow::Extractor
Constant Summary
Constants included from Config
Config::FILE_EXTENSION_IGNORE, Config::FOLDER_IGNORE, Config::PATTERNS
Instance Method Summary collapse
-
#initialize ⇒ Extractor
constructor
A new instance of Extractor.
Methods included from Config
Constructor Details
#initialize ⇒ Extractor
Returns a new instance of Extractor.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/watnow.rb', line 12 def initialize # Parse options and scan given directory = OptParser.parse(ARGV) scan([:directory]) # If open command is parsed (`watnow open 13`) if [:open] id = Integer([:open]) annotation_line = AnnotationLine.find(id) open_file_at_line(annotation_line.annotation.file, annotation_line.lineno) # If remove command is parsed (`watnow remove 13`) elsif [:remove] id = Integer([:remove]) annotation_line = AnnotationLine.find(id) remove_line_of_file(annotation_line.annotation.file, annotation_line.lineno) # No specific command parsed. Output the annotations list else output(Annotation.all) end end |