Module: Gorillib::Model::LoadLines::ClassMethods
- Defined in:
- lib/gorillib/model/serialization/lines.rb
Instance Method Summary collapse
-
#_each_raw_line(filename, options = {}) { ... } ⇒ Object
Iterate a block over each line of a file.
Instance Method Details
#_each_raw_line(filename, options = {}) { ... } ⇒ Object
Iterate a block over each line of a file
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/gorillib/model/serialization/lines.rb', line 13 def _each_raw_line(filename, ={}) filename = Pathname.path_to(filename) # pop_headers = .delete(:pop_headers) # File.open(filename) do |file| file.readline if pop_headers file.each do |line| line.chomp! ; next if line.empty? yield line end nil end end |