Module: Gherkin

Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/query.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/token.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/errors.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/parser.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/dialect.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/ast_node.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/ast_builder.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/gherkin_line.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/token_matcher.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/token_scanner.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/spec/gherkin/dialect_spec.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/pickles/compiler.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/token_formatter_builder.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin/stream/parser_message_stream.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/spec/gherkin/stream/parser_message_stream_spec.rb

Defined Under Namespace

Modules: Pickles, Stream Classes: AstBuilder, AstBuilderException, AstNode, AstNodeNotLocatedException, CompositeParserException, Dialect, DoubleIterationException, GherkinLine, NoSuchLanguageException, Parser, ParserContext, ParserError, ParserException, Query, Token, TokenFormatterBuilder, TokenMatcher, TokenScanner, UnexpectedEOFException, UnexpectedTokenException

Constant Summary collapse

DEFAULT_OPTIONS =
{
  include_source: true,
  include_gherkin_document: true,
  include_pickles: true
}.freeze
RULE_TYPE =
[
  :None,
  :_EOF, # #EOF
  :_Empty, # #Empty
  :_Comment, # #Comment
  :_TagLine, # #TagLine
  :_FeatureLine, # #FeatureLine
  :_RuleLine, # #RuleLine
  :_BackgroundLine, # #BackgroundLine
  :_ScenarioLine, # #ScenarioLine
  :_ExamplesLine, # #ExamplesLine
  :_StepLine, # #StepLine
  :_DocStringSeparator, # #DocStringSeparator
  :_TableRow, # #TableRow
  :_Language, # #Language
  :_Other, # #Other
  :GherkinDocument, # GherkinDocument! := Feature?
  :Feature, # Feature! := FeatureHeader Background? ScenarioDefinition* Rule*
  :FeatureHeader, # FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper
  :Rule, # Rule! := RuleHeader Background? ScenarioDefinition*
  :RuleHeader, # RuleHeader! := Tags? #RuleLine DescriptionHelper
  :Background, # Background! := #BackgroundLine DescriptionHelper Step*
  :ScenarioDefinition, # ScenarioDefinition! [#Empty|#Comment|#TagLine->#ScenarioLine] := Tags? Scenario
  :Scenario, # Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition*
  :ExamplesDefinition, # ExamplesDefinition! [#Empty|#Comment|#TagLine->#ExamplesLine] := Tags? Examples
  :Examples, # Examples! := #ExamplesLine DescriptionHelper ExamplesTable?
  :ExamplesTable, # ExamplesTable! := #TableRow #TableRow*
  :Step, # Step! := #StepLine StepArg?
  :StepArg, # StepArg := (DataTable | DocString)
  :DataTable, # DataTable! := #TableRow+
  :DocString, # DocString! := #DocStringSeparator #Other* #DocStringSeparator
  :Tags, # Tags! := #TagLine+
  :DescriptionHelper, # DescriptionHelper := #Empty* Description? #Comment*
  :Description, # Description! := #Other+
]
DIALECT_FILE_PATH =
File.expand_path("gherkin-languages.json", File.dirname(__FILE__))
DIALECTS =
JSON.parse File.open(DIALECT_FILE_PATH, 'r:UTF-8').read

Class Method Summary collapse

Class Method Details

.from_paths(paths, options = {}) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin.rb', line 10

def self.from_paths(paths, options={})
  Stream::ParserMessageStream.new(
      paths,
      [],
      options
  ).messages
end

.from_source(uri, data, options = {}) ⇒ Object



26
27
28
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin.rb', line 26

def self.from_source(uri, data, options={})
  from_sources([encode_source_message(uri, data)], options)
end

.from_sources(sources, options = {}) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-gherkin-23.0.1/lib/gherkin.rb', line 18

def self.from_sources(sources, options={})
  Stream::ParserMessageStream.new(
      [],
      sources,
      options
  ).messages
end