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.
Files changed (2) hide show
  1. data/lib/notes-cli.rb +4 -6
  2. 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 do |filename|
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(name, file)
75
+ def parse_file(filename)
76
+ name = filename.gsub(Dir.pwd, '')
79
77
  counter = 1
80
78
  tasks = []
81
79
 
82
- file.each_line do |line|
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,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notes-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: