repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/examples/i18n/lv/lib/calculator.rb | examples/i18n/lv/lib/calculator.rb | # frozen_string_literal: true
class Calculator
def initialize
@stack = []
end
def push(arg)
@stack.push(arg)
end
def add
@stack.inject(0) { |n, sum| sum + n }
end
def divide
@stack[0].to_f / @stack[1]
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/examples/i18n/da/features/step_definitions/lommeregner_steps.rb | examples/i18n/da/features/step_definitions/lommeregner_steps.rb | # frozen_string_literal: true
begin
require 'rspec/expectations'
rescue LoadError
require 'spec/expectations'
end
require 'cucumber/formatter/unicode'
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib")
require 'lommeregner'
Before do
@calc = Lommeregner.new
end
After do
end
Given(/at jeg har indtastet... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/examples/i18n/da/lib/lommeregner.rb | examples/i18n/da/lib/lommeregner.rb | # frozen_string_literal: true
class Lommeregner
def initialize
@stack = []
end
def push(arg)
@stack.push(arg)
end
def add
@stack.inject(0) { |n, sum| sum + n }
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb | examples/i18n/et/features/step_definitions/kalkulaator_steps.rb | # frozen_string_literal: true
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib")
require 'kalkulaator'
Before do
@calc = Kalkulaator.new
end
After do
end
Given(/olen sisestanud kalkulaatorisse numbri (\d+)/) do |n|
@calc.push n.to_i
end
When(/ma vajutan (\w+)/) do |op|
@result = @calc.send op
end
The... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/examples/i18n/et/lib/kalkulaator.rb | examples/i18n/et/lib/kalkulaator.rb | # frozen_string_literal: true
class Kalkulaator
def initialize
@stack = []
end
def push(arg)
@stack.push(arg)
end
def liida
@stack.inject(0) { |n, sum| sum + n }
end
def jaga
@stack[0].to_f / @stack[1]
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/simplecov_setup.rb | lib/simplecov_setup.rb | # frozen_string_literal: true
if ENV['SIMPLECOV']
begin
# Suppress warnings in order not to pollute stdout which tests expectations rely on
$VERBOSE = nil if defined?(JRUBY_VERSION)
require 'simplecov'
SimpleCov.root(File.expand_path("#{File.dirname(__FILE__)}/.."))
SimpleCov.start do
add... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber.rb | lib/cucumber.rb | # frozen_string_literal: true
require 'yaml'
require 'cucumber/encoding'
require 'cucumber/platform'
require 'cucumber/runtime'
require 'cucumber/cli/main'
require 'cucumber/step_definitions'
require 'cucumber/term/ansicolor'
module Cucumber
class << self
attr_accessor :wants_to_quit
attr_reader :use_legacy... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events.rb | lib/cucumber/events.rb | # frozen_string_literal: true
Dir["#{File.dirname(__FILE__)}/events/*.rb"].map(&method(:require))
module Cucumber
# Events tell you what's happening while Cucumber runs your features.
#
# They're designed to be read-only, appropriate for writing formatters and other
# output tools. If you need to be able to i... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/running_test_case.rb | lib/cucumber/running_test_case.rb | # frozen_string_literal: true
require 'delegate'
module Cucumber
# Represents the current status of a running test case.
#
# This wraps a `Cucumber::Core::Test::Case` and delegates
# many methods to that object.
#
# We decorete the core object with the current result.
# In the first Before hook of a sce... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/platform.rb | lib/cucumber/platform.rb | # frozen_string_literal: true
require 'rbconfig'
require 'cucumber/core/platform'
module Cucumber
VERSION = File.read(File.expand_path('../../VERSION', __dir__)).strip
BINARY = File.expand_path("#{File.dirname(__FILE__)}/../../bin/cucumber")
LIBDIR = File.expand_path("#{File.dirname(__FILE__... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/unit.rb | lib/cucumber/unit.rb | # frozen_string_literal: true
module Cucumber
class Unit
def initialize(step_collection)
@step_collection = step_collection
end
def step_count
@step_collection.length
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/repository.rb | lib/cucumber/repository.rb | # frozen_string_literal: true
module Cucumber
# In memory repository i.e. a thread based link to cucumber-query
class Repository
attr_accessor :meta, :test_run_started, :test_run_finished
attr_reader :attachments_by_test_case_started_id, :attachments_by_test_run_hook_started_id,
:hook_by_id... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/multiline_argument.rb | lib/cucumber/multiline_argument.rb | # frozen_string_literal: true
require 'delegate'
require 'cucumber/multiline_argument/data_table'
require 'cucumber/multiline_argument/doc_string'
module Cucumber
module MultilineArgument
class << self
def from_core(node)
builder.wrap(node)
end
def from(argument, location = nil, conte... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/errors.rb | lib/cucumber/errors.rb | # frozen_string_literal: true
require 'cucumber/core/test/result'
module Cucumber
# Raised when there is no matching StepDefinition for a step.
class Undefined < Core::Test::Result::Undefined
def self.from(result, step_name)
return result.with_message(with_prefix(result.message)) if result.is_a?(self)
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/step_match_search.rb | lib/cucumber/step_match_search.rb | # frozen_string_literal: true
module Cucumber
module StepMatchSearch
def self.new(search, configuration)
CachesStepMatch.new(
AssertUnambiguousMatch.new(
configuration.guess? ? AttemptToGuessAmbiguousMatch.new(search) : search,
configuration
)
)
end
class ... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/hooks.rb | lib/cucumber/hooks.rb | # frozen_string_literal: true
require 'pathname'
require 'cucumber/core/test/location'
require 'cucumber/core/test/around_hook'
module Cucumber
# Hooks quack enough like `Cucumber::Core::Ast` source nodes that we can use them as
# source for test steps
module Hooks
class << self
def before_hook(id, lo... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/query.rb | lib/cucumber/query.rb | # frozen_string_literal: true
require 'cucumber/repository'
# Given one Cucumber Message, find another.
#
# Queries can be made while the test run is incomplete - and this will naturally return incomplete results
# see <a href="https://github.com/cucumber/messages?tab=readme-ov-file#message-overview">Cucumber Message... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/encoding.rb | lib/cucumber/encoding.rb | # frozen_string_literal: true
# See https://github.com/cucumber/cucumber/issues/693
if defined? Encoding
Encoding.default_external = 'utf-8'
Encoding.default_internal = 'utf-8'
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/configuration.rb | lib/cucumber/configuration.rb | # frozen_string_literal: true
require 'cucumber/constantize'
require 'cucumber/cli/rerun_file'
require 'cucumber/events'
require 'cucumber/messages'
require 'cucumber/core/event_bus'
require 'cucumber/core/test/result'
require 'forwardable'
require 'cucumber'
module Cucumber
# The base class for configuring setting... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/load_path.rb | lib/cucumber/load_path.rb | # frozen_string_literal: true
module Cucumber
module LoadPath
def add_dirs(*dirs)
dirs.each do |dir|
$LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir)
end
end
module_function :add_dirs
end
end
Cucumber::LoadPath.add_dirs('lib')
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/constantize.rb | lib/cucumber/constantize.rb | # frozen_string_literal: true
require 'cucumber/platform'
module Cucumber
module Constantize # :nodoc:
def constantize(camel_cased_word)
try = 0
begin
try += 1
names = camel_cased_word.split('::')
names.shift if names.empty? || names.first.empty?
constant = ::Object
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/step_definitions.rb | lib/cucumber/step_definitions.rb | # frozen_string_literal: true
module Cucumber
class StepDefinitions
def initialize(configuration = Configuration.default)
configuration = Configuration.new(configuration)
@support_code = Runtime::SupportCode.new(nil, configuration)
@support_code.load_files_from_paths(configuration.autoload_code... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime.rb | lib/cucumber/runtime.rb | # frozen_string_literal: true
require 'fileutils'
require 'cucumber/configuration'
require 'cucumber/load_path'
require 'cucumber/formatter/duration'
require 'cucumber/file_specs'
require 'cucumber/filters'
require 'cucumber/formatter/fanout'
require 'cucumber/gherkin/i18n'
require 'cucumber/glue/registry_wrapper'
req... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/filters.rb | lib/cucumber/filters.rb | # frozen_string_literal: true
require 'cucumber/filters/activate_steps'
require 'cucumber/filters/apply_after_step_hooks'
require 'cucumber/filters/apply_before_hooks'
require 'cucumber/filters/apply_after_hooks'
require 'cucumber/filters/apply_around_hooks'
require 'cucumber/filters/broadcast_test_run_started_event'
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/file_specs.rb | lib/cucumber/file_specs.rb | # frozen_string_literal: true
require 'cucumber'
require 'cucumber/core/test/location'
module Cucumber
class FileSpecs
FILE_COLON_LINE_PATTERN = /^([\w\W]*?)(?::([\d:]+))?$/.freeze # :nodoc:
def initialize(file_specs)
Cucumber.logger.debug("Features:\n")
@file_specs = file_specs.map { |spec| Fi... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/project_initializer.rb | lib/cucumber/project_initializer.rb | # frozen_string_literal: true
module Cucumber
# Generates generic file structure for a cucumber project
class ProjectInitializer
def run
create_directory('features')
create_directory('features/step_definitions')
create_directory('features/support')
create_file('features/support/env.rb')... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/step_definition_light.rb | lib/cucumber/step_definition_light.rb | # frozen_string_literal: true
module Cucumber
# TODO: pointless, ancient, kill with fire.
# Only used for keeping track of available and invoked step definitions
# in a way that also works for other programming languages (i.e. cuke4duke)
# Used for reporting purposes only (usage formatter).
class StepDefinit... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/step_match.rb | lib/cucumber/step_match.rb | # frozen_string_literal: true
require 'cucumber/multiline_argument'
module Cucumber
# Represents the match found between a Test Step and its activation
class StepMatch # :nodoc:
attr_reader :step_definition, :step_arguments
def initialize(step_definition, step_name, step_arguments)
raise "step_argu... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/rspec/doubles.rb | lib/cucumber/rspec/doubles.rb | # frozen_string_literal: true
require 'rspec/mocks'
World(RSpec::Mocks::ExampleMethods)
Before do
if RSpec::Mocks::Version::STRING >= '2.9.9'
RSpec::Mocks.setup
else
RSpec::Mocks.setup(self)
end
end
After do
RSpec::Mocks.verify
ensure
RSpec::Mocks.teardown
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/rspec/disable_option_parser.rb | lib/cucumber/rspec/disable_option_parser.rb | # frozen_string_literal: true
require 'optparse'
module Spec # :nodoc:
module Runner # :nodoc:
# Neuters RSpec's option parser.
# (RSpec's option parser tries to parse ARGV, which
# will fail when running cucumber)
class OptionParser < ::OptionParser # :nodoc:
NEUTERED_RSPEC = Object.new
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/multiline_argument/data_table.rb | lib/cucumber/multiline_argument/data_table.rb | # frozen_string_literal: true
require 'forwardable'
require 'cucumber/gherkin/data_table_parser'
require 'cucumber/gherkin/formatter/escaping'
require 'cucumber/multiline_argument/data_table/diff_matrices'
module Cucumber
module MultilineArgument
# Step Definitions that match a plain text Step with a multiline ... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/multiline_argument/doc_string.rb | lib/cucumber/multiline_argument/doc_string.rb | # frozen_string_literal: true
module Cucumber
module MultilineArgument
class DocString < SimpleDelegator
def append_to(array)
array << to_s
end
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/multiline_argument/data_table/diff_matrices.rb | lib/cucumber/multiline_argument/data_table/diff_matrices.rb | # frozen_string_literal: true
module Cucumber
module MultilineArgument
class DataTable
class DiffMatrices # :nodoc:
attr_accessor :cell_matrix, :other_table_cell_matrix, :options
def initialize(cell_matrix, other_table_cell_matrix, options)
@cell_matrix = cell_matrix
@o... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/publish_banner_printer.rb | lib/cucumber/formatter/publish_banner_printer.rb | # frozen_string_literal: true
require 'cucumber/term/banner'
module Cucumber
module Formatter
class PublishBannerPrinter
include Term::Banner
def initialize(configuration)
return if configuration.publish_enabled?
configuration.on_event :test_run_finished do |_event|
displ... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/stepdefs.rb | lib/cucumber/formatter/stepdefs.rb | # frozen_string_literal: true
require 'cucumber/formatter/usage'
module Cucumber
module Formatter
class Stepdefs < Usage
def print_steps(stepdef_key); end
def max_step_length
0
end
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/rerun.rb | lib/cucumber/formatter/rerun.rb | # frozen_string_literal: true
require 'cucumber/formatter/io'
module Cucumber
module Formatter
class Rerun
include Formatter::Io
def initialize(config)
@io = ensure_io(config.out_stream, config.error_stream)
@config = config
@failures = {}
config.on_event :test_case_... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/io.rb | lib/cucumber/formatter/io.rb | # frozen_string_literal: true
require 'cucumber/formatter/http_io'
require 'cucumber/formatter/url_reporter'
require 'cucumber/cli/options'
module Cucumber
module Formatter
module Io
module_function
def ensure_io(path_or_url_or_io, error_stream)
return nil if path_or_url_or_io.nil?
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/fanout.rb | lib/cucumber/formatter/fanout.rb | # frozen_string_literal: true
module Cucumber
module Formatter
# Forwards any messages sent to this object to all recipients
# that respond to that message.
class Fanout < BasicObject
attr_reader :recipients
private :recipients
def initialize(recipients)
@recipients = recipient... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/usage.rb | lib/cucumber/formatter/usage.rb | # frozen_string_literal: true
require 'cucumber/formatter/progress'
require 'cucumber/step_definition_light'
require 'cucumber/formatter/console'
module Cucumber
module Formatter
class Usage < Progress
include Console
class StepDefKey
attr_accessor :mean_duration, :status
attr_reader... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/duration.rb | lib/cucumber/formatter/duration.rb | # frozen_string_literal: true
module Cucumber
module Formatter
module Duration
# Helper method for formatters that need to
# format a duration in seconds to the UNIX
# <tt>time</tt> format.
def format_duration(seconds)
m, s = seconds.divmod(60)
"#{m}m#{format('%<seconds>.3... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/interceptor.rb | lib/cucumber/formatter/interceptor.rb | # frozen_string_literal: true
module Cucumber
module Formatter
module Interceptor
class Pipe
attr_reader :pipe
def initialize(pipe)
@pipe = pipe
@buffer = StringIO.new
@wrapped = true
@lock = Mutex.new
end
def write(str)
@l... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/steps.rb | lib/cucumber/formatter/steps.rb | # frozen_string_literal: true
require 'cucumber/formatter/console'
module Cucumber
module Formatter
# The formatter used for <tt>--format steps</tt>
class Steps
include Console
def initialize(runtime, path_or_io, options)
@io = ensure_io(path_or_io, nil)
@options = options
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/errors.rb | lib/cucumber/formatter/errors.rb | # frozen_string_literal: true
module Cucumber
module Formatter
class TestCaseUnknownError < StandardError; end
class TestStepUnknownError < StandardError; end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/fail_fast.rb | lib/cucumber/formatter/fail_fast.rb | # frozen_string_literal: true
require 'cucumber/formatter/io'
require 'cucumber/formatter/console'
module Cucumber
module Formatter
class FailFast
def initialize(configuration)
@previous_test_case = nil
configuration.on_event :test_case_finished do |event|
test_case, result = *ev... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/io_http_buffer.rb | lib/cucumber/formatter/io_http_buffer.rb | # frozen_string_literal: true
module Cucumber
module Formatter
class IOHTTPBuffer
attr_reader :uri, :method, :headers
def initialize(uri, method, headers = {}, https_verify_mode = nil, reporter = nil)
@uri = URI(uri)
@method = method
@headers = headers
@write_io = Tem... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/message_builder.rb | lib/cucumber/formatter/message_builder.rb | # frozen_string_literal: true
require 'base64'
require 'cucumber/formatter/backtrace_filter'
require 'cucumber/formatter/query/hook_by_test_step'
require 'cucumber/formatter/query/pickle_by_test'
require 'cucumber/formatter/query/pickle_step_by_test_step'
require 'cucumber/formatter/query/step_definitions_by_test_step... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/console.rb | lib/cucumber/formatter/console.rb | # frozen_string_literal: true
require 'cucumber/formatter/ansicolor'
require 'cucumber/formatter/duration'
require 'cucumber/gherkin/i18n'
module Cucumber
module Formatter
# This module contains helper methods that are used by formatters that
# print output to the terminal.
#
# FORMAT is a hash of P... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/http_io.rb | lib/cucumber/formatter/http_io.rb | # frozen_string_literal: true
require 'net/http'
require 'tempfile'
require_relative 'curl_option_parser'
require_relative 'io_http_buffer'
module Cucumber
module Formatter
class HTTPIO
# Returns an IO that will write to a HTTP request's body
# https_verify_mode can be set to OpenSSL::SSL::VERIFY_NO... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/json.rb | lib/cucumber/formatter/json.rb | # frozen_string_literal: true
require 'json'
require 'base64'
require 'cucumber/formatter/backtrace_filter'
require 'cucumber/formatter/io'
require 'cucumber/formatter/ast_lookup'
module Cucumber
module Formatter
# The formatter used for <tt>--format json</tt>
class Json
include Io
def initiali... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/console_issues.rb | lib/cucumber/formatter/console_issues.rb | # frozen_string_literal: true
require 'cucumber/formatter/console'
module Cucumber
module Formatter
class ConsoleIssues
include Console
def initialize(config, ast_lookup = AstLookup.new(config))
@previous_test_case = nil
@issues = Hash.new { |h, k| h[k] = [] }
@config = conf... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/ast_lookup.rb | lib/cucumber/formatter/ast_lookup.rb | # frozen_string_literal: true
module Cucumber
module Formatter
class AstLookup
def initialize(config)
@gherkin_documents = {}
@test_case_lookups = {}
@test_step_lookups = {}
@step_keyword_lookups = {}
config.on_event :gherkin_source_parsed, &method(:on_gherkin_source... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/url_reporter.rb | lib/cucumber/formatter/url_reporter.rb | # frozen_string_literal: true
module Cucumber
module Formatter
class URLReporter
def initialize(io)
@io = io
end
def report(banner)
@io.puts(banner)
end
end
class NoReporter
def report(_banner); end
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/message.rb | lib/cucumber/formatter/message.rb | # frozen_string_literal: true
require 'cucumber/formatter/io'
require 'cucumber/formatter/message_builder'
module Cucumber
module Formatter
# The formatter used for <tt>--format message</tt>
class Message < MessageBuilder
include Io
def initialize(config)
@io = ensure_io(config.out_stre... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/pretty.rb | lib/cucumber/formatter/pretty.rb | # frozen_string_literal: true
require 'fileutils'
require 'gherkin/dialect'
require 'cucumber/formatter/console'
require 'cucumber/formatter/io'
require 'cucumber/gherkin/formatter/escaping'
require 'cucumber/formatter/console_counts'
require 'cucumber/formatter/console_issues'
require 'cucumber/formatter/duration_ext... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/junit.rb | lib/cucumber/formatter/junit.rb | # frozen_string_literal: true
require 'builder'
require 'cucumber/formatter/backtrace_filter'
require 'cucumber/formatter/io'
require 'cucumber/formatter/interceptor'
require 'fileutils'
require 'cucumber/formatter/ast_lookup'
module Cucumber
module Formatter
# The formatter used for <tt>--format junit</tt>
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/curl_option_parser.rb | lib/cucumber/formatter/curl_option_parser.rb | # frozen_string_literal: true
require 'shellwords'
module Cucumber
module Formatter
class CurlOptionParser
def self.parse(options)
args = Shellwords.split(options)
url = nil
http_method = 'PUT'
headers = {}
until args.empty?
arg = args.shift
ca... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/backtrace_filter.rb | lib/cucumber/formatter/backtrace_filter.rb | # frozen_string_literal: true
require 'cucumber/platform'
module Cucumber
module Formatter
class BacktraceFilter
def initialize(exception)
@exception = exception
@backtrace_filters = standard_ruby_paths + dynamic_ruby_paths
end
def exception
return @exception if ::Cucu... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/unicode.rb | lib/cucumber/formatter/unicode.rb | # frozen_string_literal: true
# Require this file if you need Unicode support.
# Tips for improvement - esp. ruby 1.9: http://www.ruby-forum.com/topic/184730
require 'cucumber/platform'
require 'cucumber/formatter/ansicolor'
if Cucumber::WINDOWS
if ENV['CUCUMBER_OUTPUT_ENCODING']
Cucumber::CODEPAGE = ENV['CUCUM... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/ansicolor.rb | lib/cucumber/formatter/ansicolor.rb | # frozen_string_literal: true
require 'cucumber/platform'
require 'cucumber/term/ansicolor'
Cucumber::Term::ANSIColor.coloring = false unless $stdout.tty?
module Cucumber
module Formatter
# This module allows to format cucumber related outputs using ANSI escape sequences.
#
# For example, it provides a... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/duration_extractor.rb | lib/cucumber/formatter/duration_extractor.rb | # frozen_string_literal: true
module Cucumber
module Formatter
class DurationExtractor
attr_reader :result_duration
def initialize(result)
@result_duration = 0
result.describe_to(self)
end
def passed(*) end
def failed(*) end
def undefined(*) end
def ... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/console_counts.rb | lib/cucumber/formatter/console_counts.rb | # frozen_string_literal: true
require 'cucumber/formatter/console'
module Cucumber
module Formatter
class ConsoleCounts
include Console
def initialize(config)
@summary = Core::Report::Summary.new(config.event_bus)
end
def to_s
[
[scenario_count, status_counts(... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/ignore_missing_messages.rb | lib/cucumber/formatter/ignore_missing_messages.rb | # frozen_string_literal: true
module Cucumber
module Formatter
class IgnoreMissingMessages < BasicObject
def initialize(receiver)
@receiver = receiver
end
def method_missing(message, *args)
@receiver.respond_to?(message) ? @receiver.send(message, *args) : super
end
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/summary.rb | lib/cucumber/formatter/summary.rb | # frozen_string_literal: true
require 'cucumber/formatter/io'
require 'cucumber/formatter/console'
require 'cucumber/formatter/console_counts'
require 'cucumber/formatter/console_issues'
require 'cucumber/core/test/result'
require 'cucumber/formatter/ast_lookup'
module Cucumber
module Formatter
# Summary format... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/progress.rb | lib/cucumber/formatter/progress.rb | # frozen_string_literal: true
require 'cucumber/formatter/backtrace_filter'
require 'cucumber/formatter/console'
require 'cucumber/formatter/console_counts'
require 'cucumber/formatter/console_issues'
require 'cucumber/formatter/io'
require 'cucumber/formatter/duration_extractor'
require 'cucumber/formatter/ast_lookup... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/html.rb | lib/cucumber/formatter/html.rb | # frozen_string_literal: true
require 'cucumber/formatter/io'
require 'cucumber/html_formatter'
require 'cucumber/formatter/message_builder'
module Cucumber
module Formatter
class HTML < MessageBuilder
include Io
def initialize(config)
@io = ensure_io(config.out_stream, config.error_stream)... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/query/step_definitions_by_test_step.rb | lib/cucumber/formatter/query/step_definitions_by_test_step.rb | # frozen_string_literal: true
require 'cucumber/formatter/errors'
module Cucumber
module Formatter
module Query
class StepDefinitionsByTestStep
def initialize(config)
@step_definition_ids_by_test_step_id = {}
@step_match_arguments_by_test_step_id = {}
config.on_event... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/query/pickle_by_test.rb | lib/cucumber/formatter/query/pickle_by_test.rb | # frozen_string_literal: true
require 'cucumber/formatter/errors'
module Cucumber
module Formatter
module Query
class PickleByTest
def initialize(config)
@pickle_id_by_test_case_id = {}
config.on_event :test_case_created, &method(:on_test_case_created)
end
def ... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/query/test_run_started.rb | lib/cucumber/formatter/query/test_run_started.rb | # frozen_string_literal: true
module Cucumber
module Formatter
module Query
class TestRunStarted
def initialize(config)
@config = config
end
def id
@id ||= @config.id_generator.new_id
end
end
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/query/test_case_started_by_test_case.rb | lib/cucumber/formatter/query/test_case_started_by_test_case.rb | # frozen_string_literal: true
require 'cucumber/formatter/errors'
module Cucumber
module Formatter
module Query
class TestCaseStartedByTestCase
def initialize(config)
@config = config
config.on_event :test_case_created, &method(:on_test_case_created)
config.on_event :... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/query/hook_by_test_step.rb | lib/cucumber/formatter/query/hook_by_test_step.rb | # frozen_string_literal: true
require 'cucumber/formatter/errors'
module Cucumber
module Formatter
module Query
class HookByTestStep
def initialize(config)
@hook_id_by_test_step_id = {}
config.on_event :test_step_created, &method(:on_test_step_created)
config.on_even... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/formatter/query/pickle_step_by_test_step.rb | lib/cucumber/formatter/query/pickle_step_by_test_step.rb | # frozen_string_literal: true
require 'cucumber/formatter/errors'
module Cucumber
module Formatter
module Query
class PickleStepByTestStep
def initialize(config)
@pickle_id_step_by_test_step_id = {}
config.on_event :test_step_created, &method(:on_test_step_created)
end
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/gherkin/data_table_parser.rb | lib/cucumber/gherkin/data_table_parser.rb | # frozen_string_literal: true
require 'gherkin'
require 'gherkin/dialect'
module Cucumber
module Gherkin
class DataTableParser
def initialize(builder)
@builder = builder
end
def parse(text)
gherkin_document = nil
messages = ::Gherkin.from_source('dummy', feature_header... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/gherkin/i18n.rb | lib/cucumber/gherkin/i18n.rb | # frozen_string_literal: true
module Cucumber
module Gherkin
module I18n
class << self
def code_keyword_for(gherkin_keyword)
gherkin_keyword.gsub(/[\s',!]/, '').strip
end
def code_keywords_for(gherkin_keywords)
gherkin_keywords.reject { |kw| kw == '* ' }.map { |... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/gherkin/steps_parser.rb | lib/cucumber/gherkin/steps_parser.rb | # frozen_string_literal: true
require 'gherkin'
require 'gherkin/dialect'
module Cucumber
module Gherkin
class StepsParser
def initialize(builder, language)
@builder = builder
@language = language
end
def parse(text)
dialect = ::Gherkin::Dialect.for(@language)
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/gherkin/formatter/ansi_escapes.rb | lib/cucumber/gherkin/formatter/ansi_escapes.rb | # frozen_string_literal: true
module Cucumber
module Gherkin
module Formatter
# Defines aliases for ANSI coloured output. Default colours can be overridden by defining
# a <tt>GHERKIN_COLORS</tt> variable in your shell, very much like how you can
# tweak the familiar POSIX command <tt>ls</tt> w... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/gherkin/formatter/escaping.rb | lib/cucumber/gherkin/formatter/escaping.rb | # frozen_string_literal: true
module Cucumber
module Gherkin
module Formatter
module Escaping
# Escapes a pipes and backslashes:
#
# * | becomes \|
# * \ becomes \\
#
# This is used in the pretty formatter.
def escape_cell(sym)
sym.gsub(/\\(... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime/meta_message_builder.rb | lib/cucumber/runtime/meta_message_builder.rb | # frozen_string_literal: true
require 'cucumber/messages'
require 'cucumber/ci_environment'
module Cucumber
class Runtime
# Builder to instantiate a Cucumber::Messages::Meta message filled-in with
# the runtime meta-data:
# - protocol version: the version of the Cucumber::Messages protocol
# - imple... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime/step_hooks.rb | lib/cucumber/runtime/step_hooks.rb | # frozen_string_literal: true
module Cucumber
class Runtime
class StepHooks
def initialize(id_generator, hooks, event_bus)
@hooks = hooks
@id_generator = id_generator
@event_bus = event_bus
end
def apply(test_steps)
test_steps.flat_map do |test_step|
[... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime/before_hooks.rb | lib/cucumber/runtime/before_hooks.rb | # frozen_string_literal: true
require 'cucumber/hooks'
module Cucumber
class Runtime
class BeforeHooks
def initialize(id_generator, hooks, scenario, event_bus)
@hooks = hooks
@scenario = scenario
@id_generator = id_generator
@event_bus = event_bus
end
def apply... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime/user_interface.rb | lib/cucumber/runtime/user_interface.rb | # frozen_string_literal: true
require 'timeout'
module Cucumber
class Runtime
module UserInterface
attr_writer :visitor
# Suspends execution and prompts +question+ to the console (STDOUT).
# An operator (manual tester) can then enter a line of text and hit
# <ENTER>. The entered text is... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime/support_code.rb | lib/cucumber/runtime/support_code.rb | # frozen_string_literal: true
require 'cucumber/constantize'
require 'cucumber/runtime/for_programming_languages'
require 'cucumber/runtime/step_hooks'
require 'cucumber/runtime/before_hooks'
require 'cucumber/runtime/after_hooks'
require 'cucumber/gherkin/steps_parser'
require 'cucumber/step_match_search'
module Cuc... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime/for_programming_languages.rb | lib/cucumber/runtime/for_programming_languages.rb | # frozen_string_literal: true
require 'forwardable'
require 'cucumber/core/test/doc_string'
module Cucumber
class Runtime
# This is what a programming language will consider to be a runtime.
#
# It's a thin class that directs the handful of methods needed by the programming languages to the right place
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/runtime/after_hooks.rb | lib/cucumber/runtime/after_hooks.rb | # frozen_string_literal: true
module Cucumber
class Runtime
class AfterHooks
def initialize(id_generator, hooks, scenario, event_bus)
@hooks = hooks
@scenario = scenario
@id_generator = id_generator
@event_bus = event_bus
end
def apply_to(test_case)
test... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/term/banner.rb | lib/cucumber/term/banner.rb | # frozen_string_literal: true
require 'cucumber/term/ansicolor'
module Cucumber
module Term
module Banner
def display_banner(lines, io, border_modifiers = nil)
BannerMaker.new.display_banner(lines, io, border_modifiers || %i[green bold])
end
class BannerMaker
include Term::ANS... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/term/ansicolor.rb | lib/cucumber/term/ansicolor.rb | # frozen_string_literal: true
module Cucumber
module Term
# This module allows to colorize text using ANSI escape sequences.
#
# Include the module in your class and use its methods to colorize text.
#
# Example:
#
# require 'cucumber/term/ansicolor'
#
# class MyFormatter
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/step_activated.rb | lib/cucumber/events/step_activated.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired when a step is activated
class StepActivated < Core::Event.new(:test_step, :step_match)
# The test step that was matched.
#
# @return [Cucumber::Core::Test::Step]
attr_reader :tes... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/envelope.rb | lib/cucumber/events/envelope.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
class Envelope < Core::Event.new(:envelope)
attr_reader :envelope
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_step_created.rb | lib/cucumber/events/test_step_created.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired when a TestStep is created from a PickleStep
class TestStepCreated < Core::Event.new(:test_step, :pickle_step)
attr_reader :test_step, :pickle_step
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_case_started.rb | lib/cucumber/events/test_case_started.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Signals that a {Cucumber::Core::Test::Case} is about to be executed
class TestCaseStarted < Core::Events::TestCaseStarted
# @return [Cucumber::Core::Test::Case] the test case to be executed
attr_reader :... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_case_finished.rb | lib/cucumber/events/test_case_finished.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Signals that a {Cucumber::Core::Test::Case} has finished executing
class TestCaseFinished < Core::Events::TestCaseFinished
# @return [Cucumber::Core::Test::Case] that was executed
attr_reader :test_case
... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_run_started.rb | lib/cucumber/events/test_run_started.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired once all test cases have been filtered before
# the first one is executed.
class TestRunStarted < Core::Event.new(:test_cases)
# @return [Array<Cucumber::Core::Test::Case>] the test cases to be... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_step_finished.rb | lib/cucumber/events/test_step_finished.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Signals that a {Cucumber::Core::Test::Step} has finished executing
class TestStepFinished < Core::Events::TestStepFinished
# @return [Cucumber::Core::Test::Step] the test step that was executed
attr_read... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/gherkin_source_read.rb | lib/cucumber/events/gherkin_source_read.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Fired after we've read in the contents of a feature file
class GherkinSourceRead < Core::Event.new(:path, :body)
# The path to the file
attr_reader :path
# The raw Gherkin source
attr_reader... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_run_finished.rb | lib/cucumber/events/test_run_finished.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired after all test cases have finished executing
class TestRunFinished < Core::Event.new(:success)
attr_reader :success
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/gherkin_source_parsed.rb | lib/cucumber/events/gherkin_source_parsed.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Fired after we've parsed the contents of a feature file
class GherkinSourceParsed < Core::Event.new(:gherkin_document)
# The Gherkin Ast
attr_reader :gherkin_document
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/hook_test_step_created.rb | lib/cucumber/events/hook_test_step_created.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired when a step is created from a hook
class HookTestStepCreated < Core::Event.new(:test_step, :hook)
attr_reader :test_step, :hook
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/step_definition_registered.rb | lib/cucumber/events/step_definition_registered.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired after each step definition has been registered
class StepDefinitionRegistered < Core::Event.new(:step_definition)
# The step definition that was just registered.
#
# @return [RbSupport:... | ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_case_ready.rb | lib/cucumber/events/test_case_ready.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired when a Test::Case is ready to be ran (matching has been done, hooks added etc)
class TestCaseReady < Core::Event.new(:test_case)
attr_reader :test_case
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/test_case_created.rb | lib/cucumber/events/test_case_created.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
# Event fired when a Test::Case is created from a Pickle
class TestCaseCreated < Core::Event.new(:test_case, :pickle)
attr_reader :test_case, :pickle
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
cucumber/cucumber-ruby | https://github.com/cucumber/cucumber-ruby/blob/50c37055b0e5e74de50a026756ca915f0f7b7820/lib/cucumber/events/undefined_parameter_type.rb | lib/cucumber/events/undefined_parameter_type.rb | # frozen_string_literal: true
require 'cucumber/core/events'
module Cucumber
module Events
class UndefinedParameterType < Core::Event.new(:type_name, :expression)
attr_reader :type_name, :expression
end
end
end
| ruby | MIT | 50c37055b0e5e74de50a026756ca915f0f7b7820 | 2026-01-04T15:43:43.142161Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.