notes-cli 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/notes-cli.rb +4 -6
- metadata +1 -1
data/lib/notes-cli.rb
CHANGED
@@ -68,18 +68,16 @@ class Notes
|
|
68
68
|
|
69
69
|
# Read and parse all files as specified in the options
|
70
70
|
def find_all
|
71
|
-
Notes.files.each
|
72
|
-
name = filename.gsub(Dir.pwd, '')
|
73
|
-
File.open(filename, "r") { |file| Notes.parse_file(name, file) }
|
74
|
-
end
|
71
|
+
Notes.files.each { |f| Notes.parse_file(f) }
|
75
72
|
end
|
76
73
|
|
77
74
|
# Scan a file for annotations and output numbered lines for each
|
78
|
-
def parse_file(
|
75
|
+
def parse_file(filename)
|
76
|
+
name = filename.gsub(Dir.pwd, '')
|
79
77
|
counter = 1
|
80
78
|
tasks = []
|
81
79
|
|
82
|
-
|
80
|
+
File.read(filename).each_line do |line|
|
83
81
|
if @options[:flags].any? { |flag| line.include?(flag) || line.include?(flag.downcase) }
|
84
82
|
tasks << {
|
85
83
|
:line_num => counter,
|