Class: Gherkin::Stream::SourceEvents
- Inherits:
-
Object
- Object
- Gherkin::Stream::SourceEvents
- Defined in:
- lib/gherkin/stream/source_events.rb
Instance Method Summary collapse
- #enum ⇒ Object
-
#initialize(paths) ⇒ SourceEvents
constructor
A new instance of SourceEvents.
Constructor Details
#initialize(paths) ⇒ SourceEvents
Returns a new instance of SourceEvents.
4 5 6 |
# File 'lib/gherkin/stream/source_events.rb', line 4 def initialize(paths) @paths = paths end |
Instance Method Details
#enum ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gherkin/stream/source_events.rb', line 8 def enum Enumerator.new do |y| @paths.each do |path| event = { type: 'source', uri: path, data: File.open(path, 'r:UTF-8', &:read), media: { encoding: 'utf-8', type: 'text/x.cucumber.gherkin+plain' } } y.yield(event) end end end |