[DRE-commits] [SCM] ruby-pdf-reader.git branch, master, updated. upstream/0.10.0-15-g3168024

Cédric Boutillier cedric.boutillier at gmail.com
Wed Sep 7 08:55:52 UTC 2011


The following commit has been merged in the master branch:
commit 59badeda90a7072d5550c76d38119a5e632f8ccd
Author: Cédric Boutillier <cedric.boutillier at gmail.com>
Date:   Tue Sep 6 23:29:02 2011 +0200

    fix examples: rubygems, load_path, shebangs

diff --git a/debian/patches/0002-examples_rubygems.patch b/debian/patches/0002-examples_rubygems.patch
new file mode 100644
index 0000000..b7a446b
--- /dev/null
+++ b/debian/patches/0002-examples_rubygems.patch
@@ -0,0 +1,95 @@
+Description: disable rubygems and $LOAD_PATH override in examples
+Author: Cédric Boutillier <cedric.boutillier at gmail.com>
+Last-Update: 2011-09-06
+
+--- a/examples/callbacks.rb
++++ b/examples/callbacks.rb
+@@ -6,7 +6,6 @@
+ # WARNING: this will generate a *lot* of output, so you probably want to pipe
+ #          it through less or to a text file.
+ 
+-require 'rubygems'
+ require 'pdf/reader'
+ 
+ receiver = PDF::Reader::RegisterReceiver.new
+--- a/examples/extract_bates.rb
++++ b/examples/extract_bates.rb
+@@ -14,7 +14,6 @@
+ # used to look for words that look like the numbers you expect in the
+ # page content.
+ 
+-require 'rubygems'
+ require 'pdf/reader'
+ 
+ class BatesReceiver
+--- a/examples/hash.rb
++++ b/examples/hash.rb
+@@ -2,8 +2,6 @@
+ # coding: utf-8
+ 
+ # get direct access to PDF objects
+-#
+-$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
+ 
+ require 'pdf/reader'
+ 
+--- a/examples/metadata.rb
++++ b/examples/metadata.rb
+@@ -3,7 +3,6 @@
+ # coding: utf-8
+ # Extract metadata only
+ 
+-require 'rubygems'
+ require 'pdf/reader'
+ 
+ class MetaDataReceiver
+--- a/examples/page_counter_improved.rb
++++ b/examples/page_counter_improved.rb
+@@ -6,7 +6,6 @@
+ # A simple app to display the number of pages in a PDF File.
+ #
+ 
+-  require 'rubygems'
+   require 'pdf/reader'
+ 
+   class PageReceiver
+--- a/examples/page_counter_naive.rb
++++ b/examples/page_counter_naive.rb
+@@ -3,7 +3,6 @@
+ 
+ # A simple app to count the number of pages in a PDF File.
+ 
+-require 'rubygems'
+ require 'pdf/reader'
+ 
+ class PageReceiver
+--- a/examples/rspec.rb
++++ b/examples/rspec.rb
+@@ -3,7 +3,6 @@
+ 
+ #  Basic RSpec of a generated PDF
+ 
+-require 'rubygems'
+ require 'pdf/reader'
+ require 'pdf/writer'
+ require 'spec'
+--- a/examples/text.rb
++++ b/examples/text.rb
+@@ -3,7 +3,6 @@
+ 
+ # Extract all text from a single PDF
+ 
+-require 'rubygems'
+ require 'pdf/reader'
+ 
+ class PageTextReceiver
+--- a/examples/version.rb
++++ b/examples/version.rb
+@@ -3,7 +3,6 @@
+ 
+ # Determine the PDF version of a file
+ 
+-require 'rubygems'
+ require 'pdf/reader'
+ 
+ class VersionReceiver
diff --git a/debian/patches/0003-examples_fix_shebang.patch b/debian/patches/0003-examples_fix_shebang.patch
new file mode 100644
index 0000000..56a1def
--- /dev/null
+++ b/debian/patches/0003-examples_fix_shebang.patch
@@ -0,0 +1,84 @@
+Description: fix shebang in examples/*
+ According to the policy, it should be /usr/bin/ruby
+Author: Cédric Boutillier <cedric.boutillier at gmail.com>
+Last-Update: 2011-09-06
+
+--- a/examples/callbacks.rb
++++ b/examples/callbacks.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # List all callbacks generated by a single PDF
+--- a/examples/extract_bates.rb
++++ b/examples/extract_bates.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # A sample script that attempts to extract bates numbers from a PDF file.
+--- a/examples/extract_images.rb
++++ b/examples/extract_images.rb
+@@ -1,3 +1,4 @@
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # This demonstrates a way to extract some images (those based on the JPG or
+--- a/examples/hash.rb
++++ b/examples/hash.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # get direct access to PDF objects
+--- a/examples/metadata.rb
++++ b/examples/metadata.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ 
+ # coding: utf-8
+ # Extract metadata only
+--- a/examples/page_counter_improved.rb
++++ b/examples/page_counter_improved.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # Improved Page Counter
+--- a/examples/page_counter_naive.rb
++++ b/examples/page_counter_naive.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # A simple app to count the number of pages in a PDF File.
+--- a/examples/rspec.rb
++++ b/examples/rspec.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ #  Basic RSpec of a generated PDF
+--- a/examples/text.rb
++++ b/examples/text.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # Extract all text from a single PDF
+--- a/examples/version.rb
++++ b/examples/version.rb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env ruby
++#!/usr/bin/ruby
+ # coding: utf-8
+ 
+ # Determine the PDF version of a file
diff --git a/debian/patches/series b/debian/patches/series
index 49dc9f1..bb2f52c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 0001-bin_rubygems_load_path.patch
+0002-examples_rubygems.patch
+0003-examples_fix_shebang.patch

-- 
ruby-pdf-reader.git



More information about the Pkg-ruby-extras-commits mailing list