pdf-writer 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,5 +1,10 @@
1
1
  = PDF::Writer Change Log
2
2
 
3
+ == PDF::Writer 1.0.1
4
+ * Fixed a few minor gem issues.
5
+ * Renamed bin/manual to bin/techbook.
6
+ * Fixed the manual.pwd locator for the default install.
7
+
3
8
  == PDF::Writer 1.0.0
4
9
  * Integrated ezwriter.rb functionality with writer.rb.
5
10
  * Factored out some functionality into modules and classes.
@@ -39,6 +44,6 @@
39
44
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
40
45
  # for full licensing information.
41
46
  #
42
- # $Id: ChangeLog,v 1.8 2005/06/07 04:19:57 austin Exp $
47
+ # $Id: ChangeLog,v 1.10 2005/06/13 20:03:53 austin Exp $
43
48
  #++
44
49
  # vim: sts=2 sw=2 ts=4 et ai tw=77
data/README CHANGED
@@ -2,7 +2,8 @@
2
2
  This library provides the ability to create PDF documents using only native
3
3
  Ruby libraries. There are several demo programs available in the demo/
4
4
  directory. The canonical documentation for PDF::Writer is "manual.pdf", which
5
- can be generated by "manual.rb" and "manual.pwd".
5
+ can be generated using bin/techbook (just "techbook" for RubyGem users) and
6
+ the manual file "manual.pwd".
6
7
 
7
8
  Homepage:: http://rubyforge.org/projects/ruby-pdf/
8
9
  Copyright:: 2003�2005, Austin Ziegler
@@ -27,6 +28,6 @@ Transaction::Simple 1.3.0 or better.
27
28
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
28
29
  # for full licensing information.
29
30
  #
30
- # $Id: README,v 1.6 2005/05/16 03:59:21 austin Exp $
31
+ # $Id: README,v 1.7 2005/06/13 20:03:53 austin Exp $
31
32
  #++
32
33
  # vim: sts=2 sw=2 ts=4 et ai tw=77
data/bin/techbook ADDED
@@ -0,0 +1,24 @@
1
+ #! /usr/bin/env ruby
2
+ #--
3
+ # PDF::Writer for Ruby.
4
+ # http://rubyforge.org/projects/ruby-pdf/
5
+ # Copyright 2003 - 2005 Austin Ziegler.
6
+ #
7
+ # Licensed under a MIT-style licence. See LICENCE in the main distribution
8
+ # for full licensing information.
9
+ #
10
+ # $Id: techbook,v 1.1 2005/06/13 20:03:53 austin Exp $
11
+ #++
12
+ begin
13
+ require 'pdf/techbook'
14
+ rescue LoadError => le
15
+ if le.message =~ %r{pdf/techbook$}
16
+ root = File.dirname(File.dirname(File.expand_path(__FILE__)))
17
+ $LOAD_PATH.unshift(File.join(root, "lib"))
18
+ require 'pdf/techbook'
19
+ else
20
+ raise
21
+ end
22
+ end
23
+
24
+ PDF::TechBook.run(ARGV)
File without changes
data/demo/chunkybacon.rb CHANGED
@@ -10,10 +10,18 @@
10
10
  # and are from "Why's (Poignant) Guide to Ruby" at
11
11
  # <http://poignantguide.net/ruby> with permission.
12
12
  #
13
- # $Id: chunkybacon.rb,v 1.5 2005/06/07 04:19:57 austin Exp $
13
+ # $Id: chunkybacon.rb,v 1.6 2005/06/13 19:32:37 austin Exp $
14
14
  #++
15
- load '../bin/loader'
16
- ClassLoader.new('pdf/writer')
15
+ begin
16
+ require 'pdf/writer'
17
+ rescue LoadError => le
18
+ if le.message =~ %r{pdf/writer$}
19
+ $LOAD_PATH.unshift("../lib")
20
+ require 'pdf/writer'
21
+ else
22
+ raise
23
+ end
24
+ end
17
25
 
18
26
  pdf = PDF::Writer.new
19
27
  pdf.select_font "Times-Roman"
data/demo/code.rb CHANGED
@@ -11,10 +11,18 @@
11
11
  # I'll need to play with the X position some to get it right. This will NOT
12
12
  # make it into the 1.0 release. Maybe 1.1 or 1.2.
13
13
  #
14
- # $Id: code.rb,v 1.2 2005/06/07 04:19:57 austin Exp $
14
+ # $Id: code.rb,v 1.3 2005/06/13 19:32:37 austin Exp $
15
15
  #++
16
- load '../bin/loader'
17
- ClassLoader.new('pdf/writer')
16
+ begin
17
+ require 'pdf/writer'
18
+ rescue LoadError => le
19
+ if le.message =~ %r{pdf/writer$}
20
+ $LOAD_PATH.unshift("../lib")
21
+ require 'pdf/writer'
22
+ else
23
+ raise
24
+ end
25
+ end
18
26
 
19
27
  pdf = PDF::Writer.new
20
28
  pdf.select_font "Times-Roman"
data/demo/colornames.rb CHANGED
@@ -6,10 +6,18 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: colornames.rb,v 1.1 2005/06/12 15:35:43 austin Exp $
9
+ # $Id: colornames.rb,v 1.2 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
- load '../bin/loader'
12
- ClassLoader.new('pdf/writer')
11
+ begin
12
+ require 'pdf/writer'
13
+ rescue LoadError => le
14
+ if le.message =~ %r{pdf/writer$}
15
+ $LOAD_PATH.unshift("../lib")
16
+ require 'pdf/writer'
17
+ else
18
+ raise
19
+ end
20
+ end
13
21
 
14
22
  pdf = PDF::Writer.new
15
23
 
data/demo/demo.rb CHANGED
@@ -6,10 +6,18 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: demo.rb,v 1.4 2005/06/07 04:19:57 austin Exp $
9
+ # $Id: demo.rb,v 1.5 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
- load '../bin/loader'
12
- ClassLoader.new('pdf/writer')
11
+ begin
12
+ require 'pdf/writer'
13
+ rescue LoadError => le
14
+ if le.message =~ %r{pdf/writer$}
15
+ $LOAD_PATH.unshift("../lib")
16
+ require 'pdf/writer'
17
+ else
18
+ raise
19
+ end
20
+ end
13
21
 
14
22
  if ARGV.empty?
15
23
  line = 'Ruby Rocks'
data/demo/gettysburg.rb CHANGED
@@ -6,10 +6,18 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: gettysburg.rb,v 1.3 2005/06/07 04:19:57 austin Exp $
9
+ # $Id: gettysburg.rb,v 1.4 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
- load '../bin/loader'
12
- ClassLoader.new('pdf/writer')
11
+ begin
12
+ require 'pdf/writer'
13
+ rescue LoadError => le
14
+ if le.message =~ %r{pdf/writer$}
15
+ $LOAD_PATH.unshift("../lib")
16
+ require 'pdf/writer'
17
+ else
18
+ raise
19
+ end
20
+ end
13
21
 
14
22
  pdf = PDF::Writer.new
15
23
 
data/demo/hello.rb CHANGED
@@ -6,10 +6,18 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: hello.rb,v 1.5 2005/06/07 04:19:57 austin Exp $
9
+ # $Id: hello.rb,v 1.6 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
- load '../bin/loader'
12
- ClassLoader.new('pdf/writer')
11
+ begin
12
+ require 'pdf/writer'
13
+ rescue LoadError => le
14
+ if le.message =~ %r{pdf/writer$}
15
+ $LOAD_PATH.unshift("../lib")
16
+ require 'pdf/writer'
17
+ else
18
+ raise
19
+ end
20
+ end
13
21
 
14
22
  pdf = PDF::Writer.new
15
23
  pdf.select_font "Times-Roman"
data/demo/individual-i.rb CHANGED
@@ -6,10 +6,18 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: individual-i.rb,v 1.3 2005/06/07 04:19:57 austin Exp $
9
+ # $Id: individual-i.rb,v 1.4 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
- load '../bin/loader'
12
- ClassLoader.new('pdf/writer')
11
+ begin
12
+ require 'pdf/writer'
13
+ rescue LoadError => le
14
+ if le.message =~ %r{pdf/writer$}
15
+ $LOAD_PATH.unshift("../lib")
16
+ require 'pdf/writer'
17
+ else
18
+ raise
19
+ end
20
+ end
13
21
 
14
22
  require 'color/palette/monocontrast'
15
23
 
data/demo/pac.rb CHANGED
@@ -6,10 +6,18 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: pac.rb,v 1.3 2005/06/07 04:19:57 austin Exp $
9
+ # $Id: pac.rb,v 1.4 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
- load '../bin/loader'
12
- ClassLoader.new('pdf/writer')
11
+ begin
12
+ require 'pdf/writer'
13
+ rescue LoadError => le
14
+ if le.message =~ %r{pdf/writer$}
15
+ $LOAD_PATH.unshift("../lib")
16
+ require 'pdf/writer'
17
+ else
18
+ raise
19
+ end
20
+ end
13
21
 
14
22
  pdf = PDF::Writer.new(:orientation => :landscape)
15
23
 
data/demo/pagenumber.rb CHANGED
@@ -6,10 +6,18 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: pagenumber.rb,v 1.4 2005/06/07 04:19:57 austin Exp $
9
+ # $Id: pagenumber.rb,v 1.5 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
- load '../bin/loader'
12
- ClassLoader.new('pdf/writer')
11
+ begin
12
+ require 'pdf/writer'
13
+ rescue LoadError => le
14
+ if le.message =~ %r{pdf/writer$}
15
+ $LOAD_PATH.unshift("../lib")
16
+ require 'pdf/writer'
17
+ else
18
+ raise
19
+ end
20
+ end
13
21
 
14
22
  def grey_page(pdf)
15
23
  @page_num ||= 0
data/demo/qr-language.rb CHANGED
@@ -10,10 +10,18 @@
10
10
  #
11
11
  # See LICENCE in the main distribution for full licensing information.
12
12
  #
13
- # $Id: qr-language.rb,v 1.10 2005/06/02 21:20:35 austin Exp $
13
+ # $Id: qr-language.rb,v 1.11 2005/06/13 19:32:37 austin Exp $
14
14
  #++
15
- load '../bin/loader'
16
- ClassLoader.new 'pdf/writer'
15
+ begin
16
+ require 'pdf/writer'
17
+ rescue LoadError => le
18
+ if le.message =~ %r{pdf/writer$}
19
+ $LOAD_PATH.unshift("../lib")
20
+ require 'pdf/writer'
21
+ else
22
+ raise
23
+ end
24
+ end
17
25
 
18
26
  require 'pdf/quickref'
19
27
 
data/demo/qr-library.rb CHANGED
@@ -10,10 +10,18 @@
10
10
  #
11
11
  # See LICENCE in the main distribution for full licensing information.
12
12
  #
13
- # $Id: qr-library.rb,v 1.4 2005/06/02 21:20:35 austin Exp $
13
+ # $Id: qr-library.rb,v 1.5 2005/06/13 19:32:37 austin Exp $
14
14
  #++
15
- load '../bin/loader'
16
- ClassLoader.new 'pdf/writer'
15
+ begin
16
+ require 'pdf/writer'
17
+ rescue LoadError => le
18
+ if le.message =~ %r{pdf/writer$}
19
+ $LOAD_PATH.unshift("../lib")
20
+ require 'pdf/writer'
21
+ else
22
+ raise
23
+ end
24
+ end
17
25
 
18
26
  require 'pdf/quickref'
19
27
 
Binary file
@@ -6,7 +6,7 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: stddev.rb,v 1.5 2005/06/08 22:18:05 austin Exp $
9
+ # $Id: stddev.rb,v 1.6 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
11
  require 'pdf/writer'
12
12
  require 'pdf/charts'
@@ -20,7 +20,7 @@ require 'ostruct'
20
20
  # The scale of responses is the vertical scale; the average data points
21
21
  # and standard deviation values are the horizontal scale.
22
22
  class PDF::Charts::StdDev
23
- VERSION = '1.0.0'
23
+ VERSION = '1.0.1'
24
24
 
25
25
  # A data element.
26
26
  DataPoint = Struct.new(:label, :average, :stddev)
data/lib/pdf/quickref.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: quickref.rb,v 1.7 2005/06/08 12:16:11 austin Exp $
9
+ # $Id: quickref.rb,v 1.8 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
11
  require 'pdf/simpletable'
12
12
 
@@ -51,7 +51,7 @@ require 'pdf/simpletable'
51
51
  # qr.lines "Text to put after the header."
52
52
  # qr.save_as "MyQuickRef.pdf"
53
53
  class PDF::QuickRef
54
- VERSION = '1.0.0'
54
+ VERSION = '1.0.1'
55
55
 
56
56
  # Create the quick reference document. +paper+ is passed unchanged to
57
57
  # the PDF::Writer.new; the page is always created landscape. Margins
@@ -6,7 +6,7 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: simpletable.rb,v 1.9 2005/06/11 14:33:17 austin Exp $
9
+ # $Id: simpletable.rb,v 1.10 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
11
  require 'pdf/writer'
12
12
  require 'transaction/simple/group'
@@ -14,7 +14,7 @@ require 'transaction/simple/group'
14
14
  # This class will create tables with a relatively simple API and internal
15
15
  # implementation.
16
16
  class PDF::SimpleTable
17
- VERSION = '1.0.0'
17
+ VERSION = '1.0.1'
18
18
 
19
19
  include Transaction::Simple
20
20
 
data/lib/pdf/techbook.rb CHANGED
@@ -7,7 +7,7 @@
7
7
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
8
8
  # for full licensing information.
9
9
  #
10
- # $Id: techbook.rb,v 1.11 2005/06/08 12:16:11 austin Exp $
10
+ # $Id: techbook.rb,v 1.13 2005/06/13 20:03:53 austin Exp $
11
11
  #++
12
12
  require 'pdf/simpletable'
13
13
  require 'pdf/charts/stddev'
@@ -787,6 +787,8 @@ class PDF::TechBook < PDF::Writer
787
787
  @gen_toc
788
788
  end
789
789
 
790
+ attr_accessor :techbook_source_dir
791
+
790
792
  def self.run(args)
791
793
  config = OpenStruct.new
792
794
  config.regen = false
@@ -812,12 +814,18 @@ class PDF::TechBook < PDF::Writer
812
814
  config.document = "manual.pwd"
813
815
  unless File.exist?(config.document)
814
816
  dirn = File.dirname(__FILE__)
815
- config.document = File.join(dirn, config.document)
817
+ config.document = File.join(dirn, File.basename(config.document))
816
818
  unless File.exist?(config.document)
817
819
  dirn = File.join(dirn, "..")
818
- config.document = File.join(dirn, config.document)
820
+ config.document = File.join(dirn, File.basename(config.document))
819
821
  unless File.exist?(config.document)
820
- $stderr.puts PDF::Writer::Lang[:techbook_cannot_find_document]
822
+ dirn = File.join(dirn, "..")
823
+ config.document = File.join(dirn,
824
+ File.basename(config.document))
825
+ unless File.exist?(config.document)
826
+ $stderr.puts PDF::Writer::Lang[:techbook_cannot_find_document]
827
+ exit(1)
828
+ end
821
829
  end
822
830
  end
823
831
  end
@@ -848,7 +856,7 @@ class PDF::TechBook < PDF::Writer
848
856
  pdf = File.open(files[:cache], "rb") { |cf| Marshal.load(cf.read) }
849
857
  pdf.save_as(files[:pdf], config.compressed)
850
858
  File.open(files[:pdf], "wb") { |pf| pf.write pdf.render }
851
- exit 0
859
+ exit(0)
852
860
  else
853
861
  $stderr.puts PDF::Writer::Lang[:techbook_regenerating]
854
862
  end
@@ -859,6 +867,7 @@ class PDF::TechBook < PDF::Writer
859
867
 
860
868
  # Create the manual object.
861
869
  pdf = PDF::TechBook.new
870
+ pdf.techbook_source_dir = File.expand_path(dirn)
862
871
 
863
872
  document = open(files[:document]) { |io| io.read.split($/) }
864
873
  progress = ProgressBar.new(base.capitalize, document.size)
data/lib/pdf/writer.rb CHANGED
@@ -6,7 +6,7 @@
6
6
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
7
  # for full licensing information.
8
8
  #
9
- # $Id: writer.rb,v 1.31 2005/06/09 11:10:18 austin Exp $
9
+ # $Id: writer.rb,v 1.32 2005/06/13 19:32:37 austin Exp $
10
10
  #++
11
11
  require 'thread'
12
12
  require 'open-uri'
@@ -19,7 +19,7 @@ require 'color'
19
19
  module PDF
20
20
  class Writer
21
21
  # The version of PDF::Writer.
22
- VERSION = '1.0.0'
22
+ VERSION = '1.0.1'
23
23
 
24
24
  # Escape the text so that it's safe for insertion into the PDF
25
25
  # document.
data/manual.pwd CHANGED
@@ -196,7 +196,8 @@ Copyright
196
196
  INFO
197
197
 
198
198
  pdf.text(info, :font_size => 18, :justification => :right)
199
- pdf.add_image_from_file("images/pdfwriter-small.jpg", 400, 100)
199
+ image = File.join(pdf.techbook_source_dir, "images", "pdfwriter-small.jpg")
200
+ pdf.add_image_from_file(image, 400, 100)
200
201
  pdf.open_here('Fit')
201
202
 
202
203
  pdf.start_page_numbering(pnx, pny, 6, :right, "<PAGENUM>", 1)
@@ -4966,7 +4967,9 @@ Event detection: callbacks on page change, etc. This will be necessary to suppor
4966
4967
  .newpage
4967
4968
  1<Revision History>
4968
4969
 
4969
- 2<Version 1.0.0>
4970
+ 2<Version 1.0.1: June 13, 2005>
4971
+
4972
+ 2<Version 1.0.0: June 12, 2005>
4970
4973
  .blist {{{
4971
4974
  First production-ready release of PDF::Writer. Dozens of bug fixes, new features, and a major rewrite of the API.
4972
4975
  Integrated ezwriter.rb functionality with writer.rb.
@@ -4985,12 +4988,12 @@ Fixed a bug where entities would generate the width specified for the component
4985
4988
  Fixed a performance bug. Thanks again to Leslie Hensley.
4986
4989
  .endblist }}}
4987
4990
 
4988
- 2<Version 0.1.2 (CVS only)>
4991
+ 2<Version 0.1.2: CVS only>
4989
4992
  .blist {{{
4990
4993
  Fixed a problem with the improper reading of character numbers from .afm files that are not default files. Other font issues remain but will be fixed at a later date.
4991
4994
  .endblist }}}
4992
4995
 
4993
- 2<Version 0.1.0>
4996
+ 2<Version 0.1.0: September, 2003>
4994
4997
  .blist {{{
4995
4998
  Initial technology-preview release of PDF::Writer, based on version 009e of the PHP cPDF class by R&OS.
4996
4999
  .endblist }}}
@@ -5143,7 +5146,7 @@ pdf.stop_page_numbering(true, :current)
5143
5146
  # Licensed under a MIT-style licence. See LICENCE in the main distribution
5144
5147
  # for full licensing information.
5145
5148
  #
5146
- # $Id: manual.pwd,v 1.40 2005/06/12 21:39:46 austin Exp $
5149
+ # $Id: manual.pwd,v 1.41 2005/06/13 19:32:37 austin Exp $
5147
5150
  # vim: sts=2 sw=2 ts=4 et ai tw=77 foldmethod=marker foldcolumn=2
5148
5151
  #++
5149
5152
  # Blue Smoke image by Matthew "thesaint" Bowden, <matthewbowden@gmail.com>.
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: pdf-writer
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.0
7
- date: 2005-06-12
6
+ version: 1.0.1
7
+ date: 2005-06-13
8
8
  summary: A pure Ruby PDF document creation library.
9
9
  require_paths:
10
10
  - lib
@@ -14,7 +14,8 @@ rubyforge_project: ruby-pdf
14
14
  description: "This library provides the ability to create PDF documents using only native Ruby
15
15
  libraries. There are several demo programs available in the demo/ directory. The
16
16
  canonical documentation for PDF::Writer is \"manual.pdf\", which can be
17
- generated by \"manual.rb\" and \"manual.pwd\"."
17
+ generated using bin/techbook (just \"techbook\" for RubyGem users) and the
18
+ manual file \"manual.pwd\"."
18
19
  autorequire: pdf/writer
19
20
  default_executable:
20
21
  bindir: bin
@@ -33,9 +34,8 @@ files:
33
34
  - README
34
35
  - LICENCE
35
36
  - ChangeLog
36
- - bin/loader
37
- - bin/manual
38
- - bin/manual.bat
37
+ - bin/techbook
38
+ - bin/techbook.bat
39
39
  - lib/pdf
40
40
  - lib/pdf/charts
41
41
  - lib/pdf/charts.rb
@@ -109,6 +109,7 @@ files:
109
109
  - images/chunkybacon.png
110
110
  - images/pdfwriter-icon.jpg
111
111
  - images/pdfwriter-small.jpg
112
+ - images/pdfwriter-tiny.jpg
112
113
  - manual.pwd
113
114
  test_files: []
114
115
  rdoc_options:
@@ -121,7 +122,8 @@ extra_rdoc_files:
121
122
  - README
122
123
  - ChangeLog
123
124
  - LICENCE
124
- executables: []
125
+ executables:
126
+ - techbook
125
127
  extensions: []
126
128
  requirements: []
127
129
  dependencies:
data/bin/loader DELETED
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #--
3
- # PDF::Writer for Ruby.
4
- # http://rubyforge.org/projects/ruby-pdf/
5
- # Copyright 2003 - 2005 Austin Ziegler.
6
- #
7
- # Licensed under a MIT-style licence. See LICENCE in the main distribution
8
- # for full licensing information.
9
- #
10
- # $Id: loader,v 1.1 2005/05/16 04:01:55 austin Exp $
11
- #++
12
-
13
- # 1. Try to load the specified library from ./lib.
14
- # 2. ... ../lib.
15
- # 3. ... relative to the running script (File.dirname($0)/lib).
16
- # 4. ... relative ... (File.dirname($0)/../lib).
17
- # 5. ... according to provided library paths, one at a time.
18
- # 6. ... the unmodified $LOAD_PATH (e.g., site_ruby).
19
- # 7. ... with RubyGems.
20
- # 8. Fail hard.
21
- class ClassLoader
22
- def initialize(library, options = { :libs => [] })
23
- @last = false
24
- @saved = $LOAD_PATH.dup
25
- @library = library
26
- @output = options[:output]
27
- @libs = %W(#{Dir.pwd}/lib #{Dir.pwd}/../lib
28
- #{File.dirname($0)}/lib #{File.dirname($0)}/../lib) +
29
- (options[:libs] || [])
30
-
31
- $LOAD_PATH.unshift @libs.shift
32
-
33
- __require__
34
- end
35
-
36
- def __require__
37
- require @library
38
- rescue LoadError => ex
39
- @output << ex << "\n" << ex.backtrace.join("\n") if @output
40
-
41
- raise ex if @last
42
-
43
- $LOAD_PATH.replace(@saved)
44
-
45
- if @libs.empty?
46
- @last = true
47
- require 'rubygems'
48
- else
49
- $LOAD_PATH.unshift @libs.shift
50
- end
51
-
52
- retry
53
- end
54
- end
data/bin/manual DELETED
@@ -1,22 +0,0 @@
1
- #! /usr/bin/env ruby
2
- #--
3
- # PDF::Writer for Ruby.
4
- # http://rubyforge.org/projects/ruby-pdf/
5
- # Copyright 2003 - 2005 Austin Ziegler.
6
- #
7
- # Licensed under a MIT-style licence. See LICENCE in the main distribution
8
- # for full licensing information.
9
- #
10
- # $Id: manual,v 1.1 2005/05/16 04:01:55 austin Exp $
11
- #++
12
-
13
- begin
14
- load 'loader'
15
- rescue LoadError
16
- load 'bin/loader'
17
- end
18
- ClassLoader.new 'pdf/writer'
19
-
20
- require 'pdf/techbook'
21
-
22
- PDF::TechBook.run(ARGV)