Sha256: d4dd582f18e4aedb931a8ec470adffdc0315af7c110c5ec302541afcb9d2e1db

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

module Gherkin
  module Stream
    class SourceEvents
      def initialize(paths)
        @paths = paths
      end

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/gherkin-5.1.0/lib/gherkin/stream/source_events.rb
gherkin-5.1.0 lib/gherkin/stream/source_events.rb
gherkin-5.0.0 lib/gherkin/stream/source_events.rb