From bc4de2d70827e2c5740f2a412991dcde3a2122ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Fri, 7 Sep 2018 10:49:11 +0200 Subject: [PATCH] Fix wire protocol. --- ...Pass-the-registry-to-the-Wire-plugin.patch | 70 +++++++++++++++++++ rubygem-cucumber.spec | 11 ++- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch diff --git a/rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch b/rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch new file mode 100644 index 0000000..b0b8f2d --- /dev/null +++ b/rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch @@ -0,0 +1,70 @@ +From 486e4fe98b93580b63b504579d99c37790f4557d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= +Date: Mon, 23 Jul 2018 13:35:05 +0200 +Subject: [PATCH] Pass the registry to the Wire plugin. + +Also, the class StepArgument is only used in the Wire plugin, so move +it to Cucumber-Wire. +--- + lib/cucumber/glue/step_definition.rb | 1 - + lib/cucumber/runtime.rb | 2 +- + lib/cucumber/step_argument.rb | 25 -------------------------- + 3 files changed, 1 insertion(+), 27 deletions(-) + delete mode 100644 lib/cucumber/step_argument.rb + +diff --git a/lib/cucumber/glue/step_definition.rb b/lib/cucumber/glue/step_definition.rb +index 81b3630b4..a8f43c0f2 100644 +--- a/lib/cucumber/glue/step_definition.rb ++++ b/lib/cucumber/glue/step_definition.rb +@@ -1,7 +1,6 @@ + # frozen_string_literal: true + + require 'cucumber/step_match' +-require 'cucumber/step_argument' + require 'cucumber/core_ext/string' + require 'cucumber/glue/invoke_in_world' + +diff --git a/lib/cucumber/runtime.rb b/lib/cucumber/runtime.rb +index fa9f88e0d..f60cf64b9 100644 +--- a/lib/cucumber/runtime.rb ++++ b/lib/cucumber/runtime.rb +@@ -273,7 +273,7 @@ def load_step_definitions + end + + def install_wire_plugin +- Cucumber::Wire::Plugin.new(@configuration).install if @configuration.all_files_to_load.any? { |f| f =~ %r{\.wire$} } ++ Cucumber::Wire::Plugin.new(@configuration, @support_code.registry).install if @configuration.all_files_to_load.any? { |f| f =~ /\.wire$/ } + end + + def log +diff --git a/lib/cucumber/step_argument.rb b/lib/cucumber/step_argument.rb +deleted file mode 100644 +index c5d0cf076..000000000 +--- a/lib/cucumber/step_argument.rb ++++ /dev/null +@@ -1,25 +0,0 @@ +-# frozen_string_literal: true +- +-module Cucumber +- # Defines the location and value of a captured argument from the step +- # text +- class StepArgument +- def self.arguments_from(regexp, step_name) +- match = regexp.match(step_name) +- if match +- n = 0 +- match.captures.map do |val| +- n += 1 +- offset = match.offset(n)[0] +- new(offset, val) +- end +- end +- end +- +- attr_reader :offset, :val +- +- def initialize(offset, val) +- @offset, @val = offset, val +- end +- end +-end diff --git a/rubygem-cucumber.spec b/rubygem-cucumber.spec index 26df6de..f923204 100644 --- a/rubygem-cucumber.spec +++ b/rubygem-cucumber.spec @@ -4,7 +4,7 @@ Name: rubygem-%{gem_name} Version: 3.1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tool to execute plain-text documents as functional tests Group: Development/Languages License: MIT @@ -16,6 +16,9 @@ Source1: %{name}-%{version}-spec.tar.gz # git clone https://github.com/cucumber/cucumber-ruby.git && cd cucumber-ruby # git checkout v3.1.2 && tar czvf rubygem-cucumber-3.1.2-features.tar.gz features/ Source2: %{name}-%{version}-features.tar.gz +# Fix wire protocol. +# https://github.com/cucumber/cucumber-ruby/commit/486e4fe98b93580b63b504579d99c37790f4557d +Patch0: rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch Requires: js-jquery < 4 BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -55,6 +58,9 @@ Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} -b 1 -b 2 +%patch0 -p1 +%gemspec_remove_file "lib/cucumber/step_argument.rb" + # We don't have gherkin 5.1.0 in Fedora yet %gemspec_remove_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '~> 5.1.0' %gemspec_add_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '>= 4.1.0' @@ -128,6 +134,9 @@ popd %doc %{gem_instdir}/CHANGELOG.md %changelog +* Fri Sep 07 2018 Vít Ondruch - 3.1.2-2 +- Fix wire protocol. + * Thu Aug 23 2018 Jaroslav Prokop - 3.1.2-1 - Update to Cucumber 3.1.2.