!1 package-init

Merge pull request !1 from DisNight/master
This commit is contained in:
openeuler-ci-bot 2020-09-01 09:55:37 +08:00 committed by Gitee
commit 355ce957fe
5 changed files with 163 additions and 0 deletions

BIN
cucumber-3.1.2.gem Normal file

Binary file not shown.

View File

@ -0,0 +1,70 @@
From 486e4fe98b93580b63b504579d99c37790f4557d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= <B.Rasmusson@computer.org>
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

89
rubygem-cucumber.spec Normal file
View File

@ -0,0 +1,89 @@
%global gem_name cucumber
%{?_with_bootstrap: %global bootstrap 1}
Name: rubygem-%{gem_name}
Version: 3.1.2
Release: 1
Summary: Tool to execute plain-text documents as functional tests
License: MIT
URL: https://cucumber.io/
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/%{gem_name}/%{gem_name}-ruby/archive/v%{version}.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) rubygems-devel ruby js-jquery < 4 web-assets-devel
%if ! 0%{?bootstrap}
BuildRequires: rubygem(aruba)
%endif
BuildRequires: rubygem(builder) rubygem(bundler) rubygem(cucumber-core)
BuildRequires: rubygem(cucumber-expressions) rubygem(cucumber-wire) rubygem(multi_json)
BuildRequires: rubygem(multi_test) rubygem(nokogiri) rubygem(rspec)
BuildArch: noarch
%description
Cucumber lets software development teams describe how software should behave
in plain text. The text is written in a business-readable domain-specific
language and serves as documentation, automated tests and development-aid.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1
%patch0 -p1
%gemspec_remove_file "lib/cucumber/step_argument.rb"
rm %{_builddir}/%{gem_name}-ruby-%{version}/spec/cucumber/step_argument_spec.rb
%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'
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
ln -sf %{_jsdir}/jquery/latest/jquery.min.js %{buildroot}%{gem_libdir}/cucumber/formatter/jquery-min.js
%check
pushd .%{gem_instdir}
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/cucumber.yml cucumber.yml
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/spec spec
sed -i '/require.*pry/ s/^/#/' spec/spec_helper.rb
rspec spec
%if ! 0%{?bootstrap}
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/features features
sed -i '/Scenario: Passing feature/i\ @skip' features/docs/raketask.feature
sed -i '/Scenario: Ambiguous steps$/i\ @skip' features/docs/defining_steps/ambiguous_steps.feature
touch Gemfile
RUBYOPT=-Ilib cucumber --tags 'not @skip'
%endif
popd
%files
%dir %{gem_instdir}
%{_bindir}/cucumber
%license %{gem_instdir}/LICENSE
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CONTRIBUTING.md
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/CHANGELOG.md
%changelog
* Wed Aug 19 2020 fanjiachen <fanjiachen3@huawei.com> - 3.1.2-1
- package init

4
rubygem-cucumber.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: cucumber/cucumber-ruby
tag_prefix: "v"
seperator: "."

BIN
v3.1.2.tar.gz Normal file

Binary file not shown.