Class: Provider::File::BufferedStdIn

Inherits:
Base show all
Defined in:
lib/providers.rb

Instance Attribute Summary

Attributes inherited from Base

#folders

Instance Method Summary collapse

Methods inherited from Base

#reverse

Constructor Details

#initialize(*ignored) ⇒ BufferedStdIn

Returns a new instance of BufferedStdIn.



108
109
110
# File 'lib/providers.rb', line 108

def initialize(*ignored)
  super nil
end

Instance Method Details

#eachObject



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/providers.rb', line 112

def each
  file = []
  until STDIN.eof?
    file << STDIN.readline.rstrip
  end
  file.each do |line|
    next if line.empty?
    path, file = ::File.split(line)
    yield path, file
  end
end