From 689e26ddb018d31b14319cc89f993f6fc552284b Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Sep 19 2019 12:50:02 +0000 Subject: Update to rails-html-sanitizer 1.2.0 also enhance .spec and .gitignore files. --- diff --git a/.gitignore b/.gitignore index 2b1d4cb..db61328 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ -/rails-html-sanitizer-1.0.1.gem -/rails-html-sanitizer-1.0.2.gem -/rails-html-sanitizer-1.0.3.gem -/rails-html-sanitizer-1.0.4.gem +/rails-html-sanitizer-*.gem diff --git a/rubygem-rails-html-sanitizer.spec b/rubygem-rails-html-sanitizer.spec index 7148a9c..a2e340e 100644 --- a/rubygem-rails-html-sanitizer.spec +++ b/rubygem-rails-html-sanitizer.spec @@ -2,8 +2,8 @@ %global gem_name rails-html-sanitizer Name: rubygem-%{gem_name} -Version: 1.0.4 -Release: 4%{?dist} +Version: 1.2.0 +Release: 1%{?dist} Summary: This gem is responsible to sanitize HTML fragments in Rails applications License: MIT URL: https://github.com/rails/rails-html-sanitizer @@ -29,18 +29,10 @@ BuildArch: noarch Documentation for %{name}. %prep -gem unpack %{SOURCE0} - -%setup -q -D -T -n %{gem_name}-%{version} - -gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%setup -q -n %{gem_name}-%{version} %build -# Create the gem as gem install only works on a gem file -gem build %{gem_name}.gemspec - -# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir -# by default, so that we can move it into the buildroot in %%install +gem build ../%{gem_name}-%{version}.gemspec %gem_install %install @@ -49,21 +41,14 @@ cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ - %check pushd .%{gem_instdir} -## Tests are failing. Possible incompatibility with libxml2. -## https://github.com/rails/rails-html-sanitizer/issues/49 -#sed -i '/^ def test_strip_invalid_html$/ a \ skip' \ -# test/sanitizer_test.rb -#sed -i '/^ def test_strip_nested_tags$/ a \ skip' \ -# test/sanitizer_test.rb -#sed -i \ '/^ def test_strip_tags_with_many_open_quotes$/ a \ skip' \ -# test/sanitizer_test.rb -#sed -i \ '/^ def test_strip_links_with_tags_in_tags$/ a \ skip' \ -# test/sanitizer_test.rb -#sed -i \ '/^ def test_should_sanitize_script_tag_with_multiple_open_brackets$/ a \ skip' \ -# test/sanitizer_test.rb +# Some tests are failing, upstream issue +# https://github.com/rails/rails-html-sanitizer/issues/99 +for name in uri_escaping_of_{{name,href,src}_attr,name_action}_in_a_tag_in_safe_list_sanitizer; do +sed -i "/^ def test_${name}$/ a \ skip" \ + test/sanitizer_test.rb +done ruby -Ilib -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' popd @@ -82,6 +67,9 @@ popd %{gem_instdir}/test %changelog +* Wed Sep 18 2019 Pavel Valena - 1.2.0-1 +- Update to rails-html-sanitizer 1.2.0. + * Fri Jul 26 2019 Fedora Release Engineering - 1.0.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources index f3c7506..46933f0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rails-html-sanitizer-1.0.4.gem) = f608f2b642869606fc2c3986298a8ae3e36c676a7eda5e3cce419700961bfed011f8d4a2dcb59e5d32a41f556815ca5f214ec19f8940ce71d1217ba84686b8e1 +SHA512 (rails-html-sanitizer-1.2.0.gem) = efe006ad2857a21d466375f630fe269cceb78aa467d91cdf193ec5eab8fdb0d58443696989b920840f6aafcb9ddfa6a72972f0e09456b2aa57018d86791cc38f