[DRE-commits] [nanoc] 04/09: add some patches
Cédric Boutillier
boutil at moszumanska.debian.org
Sun Feb 9 23:31:13 UTC 2014
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository nanoc.
commit f96e623ed80ad6cb2f21a30195cd84d091fd5e8f
Author: Cédric Boutillier <boutil at debian.org>
Date: Thu Jan 23 21:46:24 2014 +0100
add some patches
---
debian/patches/add_if_have.patch | 65 +++++++++++++++++++++++
debian/patches/deactivate_test_huge_site.patch | 29 ++++++++++
debian/patches/deactivate_uglify_test.patch | 18 +++++++
debian/patches/no_bundler_no_loadpath_modif.patch | 19 +++++++
debian/patches/no_rdoc4.patch | 39 ++++++++++++++
debian/patches/series | 4 ++
6 files changed, 174 insertions(+)
diff --git a/debian/patches/add_if_have.patch b/debian/patches/add_if_have.patch
new file mode 100644
index 0000000..d6a37fe
--- /dev/null
+++ b/debian/patches/add_if_have.patch
@@ -0,0 +1,65 @@
+--- a/test/extra/checking/checks/test_css.rb
++++ b/test/extra/checking/checks/test_css.rb
+@@ -3,34 +3,38 @@
+ class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
+
+ def test_run_ok
+- with_site do |site|
+- # Create files
+- FileUtils.mkdir_p('output')
+- File.open('output/blah.html', 'w') { |io| io.write('<h1>Hi!</h1>') }
+- File.open('output/style.css', 'w') { |io| io.write('h1 { color: red; }') }
+-
+- # Run check
+- check = Nanoc::Extra::Checking::Checks::CSS.new(site)
+- check.run
+-
+- # Check
+- assert check.issues.empty?
++ if_have(w3c_validators) do
++ with_site do |site|
++ # Create files
++ FileUtils.mkdir_p('output')
++ File.open('output/blah.html', 'w') { |io| io.write('<h1>Hi!</h1>') }
++ File.open('output/style.css', 'w') { |io| io.write('h1 { color: red; }') }
++
++ # Run check
++ check = Nanoc::Extra::Checking::Checks::CSS.new(site)
++ check.run
++
++ # Check
++ assert check.issues.empty?
++ end
+ end
+ end
+
+ def test_run_error
+- with_site do |site|
+- # Create files
+- FileUtils.mkdir_p('output')
+- File.open('output/blah.html', 'w') { |io| io.write('<h1>Hi!</h1>') }
+- File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
+-
+- # Run check
+- check = Nanoc::Extra::Checking::Checks::CSS.new(site)
+- check.run
+-
+- # Check
+- refute check.issues.empty?
++ if_have(w3c_validators) do
++ with_site do |site|
++ # Create files
++ FileUtils.mkdir_p('output')
++ File.open('output/blah.html', 'w') { |io| io.write('<h1>Hi!</h1>') }
++ File.open('output/style.css', 'w') { |io| io.write('h1 { coxlor: rxed; }') }
++
++ # Run check
++ check = Nanoc::Extra::Checking::Checks::CSS.new(site)
++ check.run
++
++ # Check
++ refute check.issues.empty?
++ end
+ end
+ end
+
diff --git a/debian/patches/deactivate_test_huge_site.patch b/debian/patches/deactivate_test_huge_site.patch
new file mode 100644
index 0000000..2bb2f28
--- /dev/null
+++ b/debian/patches/deactivate_test_huge_site.patch
@@ -0,0 +1,29 @@
+Description: deactivate test about compiling huge sites
+ these tests cause the following error:
+ Errno::EMLINK: Too many links
+Author: Cédric Boutillier <boutil at debian.org>
+Forwarded: no
+Last-Update: 2013-10-01
+
+--- a/test/data_sources/test_filesystem_unified.rb
++++ b/test/data_sources/test_filesystem_unified.rb
+@@ -459,7 +459,7 @@
+ assert_equal nil, data_source.send(:filename_for, '/foo', nil)
+ end
+
+- def test_compile_huge_site
++ def _test_compile_huge_site
+ if_implemented do
+ # Create data source
+ data_source = new_data_source
+--- a/test/data_sources/test_filesystem_verbose.rb
++++ b/test/data_sources/test_filesystem_verbose.rb
+@@ -334,7 +334,7 @@
+ assert_equal 'foo/bar/index', data_source.send(:filename_for, 'foo/bar', '')
+ end
+
+- def test_compile_huge_site
++ def _test_compile_huge_site
+ if_implemented do
+ # Create data source
+ data_source = new_data_source
diff --git a/debian/patches/deactivate_uglify_test.patch b/debian/patches/deactivate_uglify_test.patch
new file mode 100644
index 0000000..6660f0e
--- /dev/null
+++ b/debian/patches/deactivate_uglify_test.patch
@@ -0,0 +1,18 @@
+Description: deactivate test failing with ruby-uglifier 1.x
+Author: Cédric Boutillier <boutil at debian.org>
+Forwarded: not-needed
+Last-Update: 2013-10-01
+
+--- a/test/filters/test_uglify_js.rb
++++ b/test/filters/test_uglify_js.rb
+@@ -22,8 +22,8 @@
+ result = filter.setup_and_run(input, :output => { :beautify => false })
+ assert_equal 'donkey&&alert("It is a donkey!");', result
+
+- result = filter.setup_and_run(input, :output => { :beautify => true })
+- assert_equal 'donkey && alert("It is a donkey!");', result
++ # result = filter.setup_and_run(input, :output => { :beautify => true })
++ # assert_equal 'donkey && alert("It is a donkey!");', result
+ end
+ end
+
diff --git a/debian/patches/no_bundler_no_loadpath_modif.patch b/debian/patches/no_bundler_no_loadpath_modif.patch
new file mode 100644
index 0000000..ddf0d52
--- /dev/null
+++ b/debian/patches/no_bundler_no_loadpath_modif.patch
@@ -0,0 +1,19 @@
+--- a/bin/nanoc
++++ b/bin/nanoc
+@@ -1,16 +1,6 @@
+ #!/usr/bin/env ruby
+ # encoding: utf-8
+
+-# Try loading bundler if it's possible
+-begin
+- require 'bundler/setup'
+-rescue LoadError
+- # no problem
+-end
+-
+-# Add lib to load path
+-$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
+-
+ # Load nanoc
+ require 'nanoc'
+ require 'nanoc/cli'
diff --git a/debian/patches/no_rdoc4.patch b/debian/patches/no_rdoc4.patch
new file mode 100644
index 0000000..1ae271e
--- /dev/null
+++ b/debian/patches/no_rdoc4.patch
@@ -0,0 +1,39 @@
+Description: do not force RDoc v4 with rubygems
+ That is basically reverting the following upstream commit
+ https://github.com/nanoc/nanoc/commit/e404ac286970720095535e306db84e1117a88a08
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2013-09-02
+
+--- a/lib/nanoc/filters/rdoc.rb
++++ b/lib/nanoc/filters/rdoc.rb
+@@ -3,11 +3,10 @@
+ module Nanoc::Filters
+ class RDoc < Nanoc::Filter
+
+- requires 'rdoc'
+-
+- def self.setup
+- gem 'rdoc', '~> 4.0'
+- super
++ if /^2.0/ =~ RUBY_VERSION
++ requires 'rdoc'
++ else
++ requires 'rdoc/markup', 'rdoc/markup/to_html'
+ end
+
+ # Runs the content through [RDoc::Markup](http://rdoc.rubyforge.org/RDoc/Markup.html).
+@@ -17,8 +16,12 @@
+ #
+ # @return [String] The filtered content
+ def run(content, params={})
+- options = ::RDoc::Options.new
+- to_html = ::RDoc::Markup::ToHtml.new(options)
++ if /^2.0/ =~ RUBY_VERSION
++ options = ::RDoc::Options.new
++ to_html = ::RDoc::Markup::ToHtml.new(options)
++ else
++ to_html = ::RDoc::Markup::ToHtml.new
++ end
+ ::RDoc::Markup.new.convert(content, to_html)
+ end
+
diff --git a/debian/patches/series b/debian/patches/series
index e8f221d..3a2e326 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,5 @@
deactivate_rubygems_in_tests.patch
+deactivate_test_huge_site.patch
+no_rdoc4.patch
+deactivate_uglify_test.patch
+no_bundler_no_loadpath_modif.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/nanoc.git
More information about the Pkg-ruby-extras-commits
mailing list