!17 [sync] PR-16: update to 6.1.4.1

From: @openeuler-sync-bot 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2022-03-31 01:31:57 +00:00 committed by Gitee
commit 871d73fdad
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 90 additions and 87 deletions

BIN
rails-6.1.4.1-tools.txz Normal file

Binary file not shown.

Binary file not shown.

BIN
railties-6.1.4.1-tests.txz Normal file

Binary file not shown.

BIN
railties-6.1.4.1.gem Normal file

Binary file not shown.

View File

@ -1,33 +0,0 @@
From b25471833462b769df5d20fb4019aee46881489e Mon Sep 17 00:00:00 2001
From: Pavel Valena <pvalena@redhat.com>
Date: Fri, 16 Mar 2018 21:40:58 +0100
Subject: [PATCH] Check value of result.source_location in
test_unit/reporter.rb#format_rerun_snippet
With Ruby 2.5 format_rerun_snippet can return nil, which crashes the test
suite, F.e.:
TestUnitReporterTest#test_outputs_failures_inline:
NoMethodError: undefined method `sub' for nil:NilClass
test/test_unit/reporter_test.rb:62:in `block in <class:TestUnitReporterTest>'
bin/rails test test/test_unit/reporter_test.rb:61
---
railties/lib/rails/test_unit/reporter.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb
index 28b93ce..86d769d 100644
--- a/railties/lib/rails/test_unit/reporter.rb
+++ b/railties/lib/rails/test_unit/reporter.rb
@@ -68,7 +68,7 @@ def format_line(result)
end
def format_rerun_snippet(result)
- location, line = if result.respond_to?(:source_location)
+ location, line = if result.respond_to?(:source_location) && result.source_location
result.source_location
else
result.method(result.name).source_location
--
1.8.3.1

View File

@ -1,31 +1,40 @@
%global gem_name railties %global gem_name railties
%bcond_with test %bcond_with bootstrap
%{?_with_bootstrap: %global bootstrap 1} %bcond_with webpacker
%global bootstrap 1
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 5.2.4.4 Version: 6.1.4.1
Release: 4 Release: 1
Summary: Tools for creating, working with, and running Rails applications Summary: Tools for creating, working with, and running Rails applications
License: MIT License: MIT
URL: http://rubyonrails.org URL: http://rubyonrails.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/rails/rails/archive/v%{version}.tar.gz # Get the test suite:
# Check value of result.source_location in # git clone http://github.com/rails/rails.git
# test_unit/reporter.rb#format_rerun_snippet # cd rails/railties && git archive -v -o railties-6.1.4.1-tests.txz v6.1.4.1 test/
# https://github.com/rails/rails/pull/32297 Source1: %{gem_name}-%{version}-tests.txz
Patch0: rubygem-railties-5.1.5-check-value-of-result-source-location.patch # The tools are needed for the test suite, are however unpackaged in gem file.
# You may check it out like so
# git clone http://github.com/rails/rails.git --no-checkout
# cd rails && git archive -v -o rails-6.1.4.1-tools.txz v6.1.4.1 tools/
Source2: rails-%{version}-tools.txz
Recommends: ruby(irb)
Suggests: %{_bindir}/sqlite3 Suggests: %{_bindir}/sqlite3
BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 rubygem(actioncable) = %{version} BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.2 rubygem(did_you_mean)
%if %{without bootstrap}
BuildRequires: rubygem(actionmailer) = %{version} rubygem(actionpack) = %{version} BuildRequires: rubygem(actionmailer) = %{version} rubygem(actionpack) = %{version}
BuildRequires: rubygem(activerecord) = %{version} rubygem(activesupport) = %{version} BuildRequires: rubygem(activerecord) = %{version} rubygem(activesupport) = %{version}
BuildRequires: rubygem(activestorage) = %{version} rubygem(bundler) rubygem(method_source) BuildRequires: rubygem(activestorage) = %{version} rubygem(bundler) rubygem(method_source)
BuildRequires: rubygem(rake) >= 0.8.7 rubygem(rack-cache) rubygem(sqlite3) rubygem(puma) BuildRequires: rubygem(rake) >= 0.8.7 rubygem(rack-cache) rubygem(sqlite3) rubygem(puma)
BuildRequires: rubygem(bootsnap) rubygem(capybara) sqlite rubygem(sprockets-rails) BuildRequires: rubygem(bootsnap) rubygem(capybara) sqlite rubygem(sprockets-rails)
BuildRequires: rubygem(thor) >= 0.18.1 rubygem(turbolinks) git BuildRequires: rubygem(thor) >= 0.18.1 rubygem(turbolinks) git
%if ! 0%{?bootstrap} BuildRequires: rubygem(jquery-rails) rubygem(uglifier) rubygem(rails) nodejs
BuildRequires: rubygem(jquery-rails) rubygem(uglifier) rubygem(rails) %{_bindir}/node BuildRequires: rubygem(actioncable) = %{version} ruby(irb)
%if %{with webpacker}
BuildRequires: %{_bindir}/webpacker
%endif
%endif %endif
Requires: rubygem(bundler) ruby-devel sqlite-devel
BuildArch: noarch BuildArch: noarch
%description %description
Rails internals: application bootup, plugins, generators, and rake tasks. Rails internals: application bootup, plugins, generators, and rake tasks.
@ -42,13 +51,11 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%prep %prep
%setup -q -c -T %setup -q -n %{gem_name}-%{version} -b1 -b2
%gem_install -n %{SOURCE0}
pushd .%{gem_instdir}
%patch0 -p2
popd
%build %build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install
%install %install
mkdir -p %{buildroot}%{gem_dir} mkdir -p %{buildroot}%{gem_dir}
@ -59,7 +66,7 @@ cp -p .%{_bindir}/* \
%{buildroot}%{_bindir}/ %{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x find %{buildroot}%{gem_instdir}/exe -type f | xargs chmod a+x
%if %{with test} %if %{without bootstrap}
%check %check
ln -s %{gem_dir}/specifications/rails-%{version}.gemspec .%{gem_dir}/gems/rails.gemspec ln -s %{gem_dir}/specifications/rails-%{version}.gemspec .%{gem_dir}/gems/rails.gemspec
ln -s %{gem_dir}/gems/activesupport-%{version}/ .%{gem_dir}/gems/activesupport ln -s %{gem_dir}/gems/activesupport-%{version}/ .%{gem_dir}/gems/activesupport
@ -69,9 +76,10 @@ ln -s %{gem_dir}/gems/activerecord-%{version}/ .%{gem_dir}/gems/activerecord
ln -s %{gem_dir}/gems/actionview-%{version}/ .%{gem_dir}/gems/actionview ln -s %{gem_dir}/gems/actionview-%{version}/ .%{gem_dir}/gems/actionview
ln -s %{gem_dir}/gems/actioncable-%{version}/ .%{gem_dir}/gems/actioncable ln -s %{gem_dir}/gems/actioncable-%{version}/ .%{gem_dir}/gems/actioncable
ln -s ${PWD}%{gem_instdir} .%{gem_dir}/gems/railties ln -s ${PWD}%{gem_instdir} .%{gem_dir}/gems/railties
mkdir -p .%{gem_dir}/gems/tmp/templates/app_template
pushd .%{gem_dir}/gems/railties pushd .%{gem_dir}/gems/railties
tar xzf %{SOURCE1} ln -s %{_builddir}/tools ..
ln -s rails-%{version}/railties/test test mv %{_builddir}/test .
echo '%{version}' > ../RAILS_VERSION echo '%{version}' > ../RAILS_VERSION
touch ../Gemfile touch ../Gemfile
echo 'gem "actioncable"' >> ../Gemfile echo 'gem "actioncable"' >> ../Gemfile
@ -93,49 +101,74 @@ echo 'gem "puma"' >> ../Gemfile
echo 'gem "bootsnap"' >> ../Gemfile echo 'gem "bootsnap"' >> ../Gemfile
echo 'gem "capybara"' >> ../Gemfile echo 'gem "capybara"' >> ../Gemfile
echo 'gem "irb"' >> ../Gemfile echo 'gem "irb"' >> ../Gemfile
%if ! 0%{?bootstrap}
echo 'gem "jquery-rails"' >> ../Gemfile echo 'gem "jquery-rails"' >> ../Gemfile
echo 'gem "rails"' >> ../Gemfile echo 'gem "rails"' >> ../Gemfile
echo 'gem "uglifier", require: false' >> ../Gemfile echo 'gem "uglifier", require: false' >> ../Gemfile
%else
mv test/application/assets_test.rb{,.disable}
mv test/application/asset_debugging_test.rb{,.disable}
sed -i '/def test_scaffold_.*tests_pass_by_default$/,/^ end$/ s/^/#/' test/application/rake_test.rb
sed -i '/def test_rake_routes_with_rake_options$/,/^ end$/ s/^/#/' test/application/rake_test.rb
sed -i '/def test_rails_routes_displays_message_when_no_routes_are_defined$/,/^ end$/ s/^/#/' test/application/rake_test.rb
sed -i '/def test_rails_routes_calls_the_route_inspector$/,/^ end$/ s/^/#/' test/application/rake_test.rb
sed -i '/def test_generated_controller_works_with_rails_test$/,/^ end$/ s/^/#/' test/application/test_runner_test.rb
sed -i '/def test_generated_scaffold_works_with_rails_test$/,/^ end$/ s/^/#/' test/application/test_runner_test.rb
mv test/application/bin_setup_test.rb{,.disable}
mv test/test_unit/reporter_test.rb{,.disable}
mv test/application/configuration/custom_test.rb{,.disable}
sed -i '/def test_generation_runs_bundle_install_with_full_and_mountable$/,/^ end$/ s/^/#/' test/generators/plugin_generator_test.rb
sed -i '/def test_generate_application_.*_when_does_not_exist_in_mountable_engine$/,/^ end$/ s/^/#/' test/generators/plugin_generator_test.rb
sed -i '/def test_controller_tests_pass_by_default_inside_mountable_engine$/,/^ end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb
sed -i '/def test_controller_tests_pass_by_default_inside_full_engine$/,/^ end$/ s/^/#/' test/generators/scaffold_controller_generator_test.rb
sed -i '/def test_application_new_exits_with_message_and_non_zero_code_when_generating_inside_existing_rails_directory$/,/^ end$/ s/^/#/' test/generators/app_generator_test.rb
sed -i '/def test_application_new_show_help_message_inside_existing_rails_directory$/,/^ end$/ s/^/#/' test/generators/app_generator_test.rb
%endif
sed -i '/^ def test_sqlite3_db_without_defined_rails_root$/,/^ end$/ s/^/#/' test/commands/dbconsole_test.rb
sed -i '/test "database middleware doesn.t initialize when activerecord is not in frameworks" do$/,/^ end$/ s/^/#/' \
test/application/initializers/frameworks_test.rb
sed -i '/test "i18n files have lower priority than application ones" do$/,/^ end$/ s/^/#/' \
test/railties/engine_test.rb
sed -i '/def test_system_tests_are_run_through_rake_test_when_given_in_TEST$/,/^ end$/ s/^/#/' \ sed -i '/def test_system_tests_are_run_through_rake_test_when_given_in_TEST$/,/^ end$/ s/^/#/' \
test/application/test_runner_test.rb test/application/test_runner_test.rb
sed -i '/def test_reset_sessions_before_rollback_on_system_tests$/,/^ end$/ s/^/#/' \ sed -i '/def test_reset_sessions_before_rollback_on_system_tests$/,/^ end$/ s/^/#/' \
test/application/test_runner_test.rb test/application/test_runner_test.rb
sed -i '/def test_output_inline_by_default$/,/^ end$/ s/^/#/' \ sed -i '/test "database middleware doesn.t initialize when activerecord is not in frameworks" do$/,/^ end$/ s/^/#/' \
test/generators/plugin_test_runner_test.rb test/application/initializers/frameworks_test.rb
mv test/application/rake/dbs_test.rb{,.disable} mv test/application/rake/dbs_test.rb{,.disable}
mv test/commands/dbconsole_test.rb{,.disable} sed -i '/test "i18n files have lower priority than application ones" do$/,/^ end$/ s/^/#/' \
sed -i '/^ def test_new_application_load_defaults$/,/^ end$/ s/^/#/' \ test/railties/engine_test.rb
test/generators/app_generator_test.rb sed -i -e '/require..minitest.retry./ s/^/#/' \
sed -i 's/^\(\s*secrets\.secret_\)token/\1key_base/' \ test/isolation/abstract_unit.rb
test/path_generation_test.rb
export RUBYOPT="-I${PWD}/../railties/lib" export RUBYOPT="-I${PWD}/../railties/lib"
export PATH="${PWD}/../railties/exe:$PATH" export PATH="${PWD}/../railties/exe:$PATH"
export BUNDLE_GEMFILE=${PWD}/../Gemfile export BUNDLE_GEMFILE=${PWD}/../Gemfile
sed -i -e '/^\s*sh .yarn/ s/^/#/g' \
test/isolation/abstract_unit.rb
%if %{without webpacker}
sed -i -e '/^\s*sh .bin.rails webpacker/ s/^/#/g' \
test/isolation/abstract_unit.rb
mv -v test/app_loader_test.rb{,.disable}
mv -v test/engine/test_test.rb{,.disable}
mv -v test/secrets_test.rb{,.disable}
for tname in \
railtie \
engine \
mounted_engine \
;do
mv -v test/railties/${tname}_test.rb{,.disable}
done
for tname in \
credentials \
encrypted \
initializers \
notes \
routes \
secrets \
server \
;do
mv -v test/commands/${tname}_test.rb{,.disable}
done
rm -rf test/application/
sed -i '/^\s*def test_ensure_that_migration_tasks_work_with_mountable_option/ a \ skip' \
test/generators/plugin_generator_test.rb
sed -i -e '/^\s*def test_scaffold_tests_pass_by_default_inside_mountable_engine/ a \ skip' \
-e '/^\s*def test_scaffold_tests_pass_by_default_inside_namespaced_mountable_engine/ a \ skip' \
-e '/^\s*def test_scaffold_tests_pass_by_default_inside_full_engine/ a \ skip' \
-e '/^\s*def test_scaffold_tests_pass_by_default_inside_api_full_engine/ a \ skip' \
-e '/^\s*def test_scaffold_tests_pass_by_default_inside_api_mountable_engine/ a \ skip' \
test/generators/scaffold_generator_test.rb
sed -i '/^\s*def test_skip_webpack_install/ a \ skip' \
test/generators/app_generator_test.rb
%endif
sed -i -e '/^\s*test "outputs errors inline" do/ a \ skip' \
-e '/^\s*test "outputs colored failed results" do/ a \ skip' \
test/test_unit/reporter_test.rb
sed -i '/^\s*def test_generation_use_original_bundle_environment/ a \ skip' \
test/generators/app_generator_test.rb
sed -i -e '/^\s*test "outputs colored failed results" do/ a \ skip' \
-e '/^\s*test "outputs errors inline" do/ a \ skip' \
test/test_unit/reporter_test.rb
sed -i '/^\s*def test_template_is_executed_when_supplied_an_https_path/ a \ skip' \
test/generators/shared_generator_tests.rb
git config --global init.defaultBranch master
find test -type f -name '*_test.rb' -print0 | \ find test -type f -name '*_test.rb' -print0 | \
sort -z | \ sort -z | \
xargs -0 -n1 -i sh -c "echo '* Test file: {}'; ruby -Itest -- '{}' || exit 255" xargs -0 -n1 -i sh -c "echo '* Test file: {}'; ruby -Itest -- '{}' || exit 255"
@ -158,6 +191,9 @@ popd
%doc %{gem_instdir}/README.rdoc %doc %{gem_instdir}/README.rdoc
%changelog %changelog
* Fri Mar 04 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 6.1.4.1-1
- update to 6.1.4.1
* Tue Apr 6 2021 lingsheng <lingsheng@huawei.com> - 5.2.4.4-4 * Tue Apr 6 2021 lingsheng <lingsheng@huawei.com> - 5.2.4.4-4
- Add requires ruby-devel sqlite-devel - Add requires ruby-devel sqlite-devel

Binary file not shown.