pdf-wrapper 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG +3 -0
  2. data/Rakefile +1 -1
  3. data/lib/pdf/wrapper/loading.rb +18 -6
  4. metadata +4 -4
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v0.3.3 (7th September 2010)
2
+ - fix loading of poppler lib to work when no xsession is available
3
+
1
4
  v0.3.2 (6th September 2010)
2
5
  - fix importing of PDF files as images
3
6
  - always imports the first page, currently no support for importing the
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require 'spec/rake/spectask'
8
8
  require 'roodi'
9
9
  require 'roodi_task'
10
10
 
11
- PKG_VERSION = "0.3.2"
11
+ PKG_VERSION = "0.3.3"
12
12
  PKG_NAME = "pdf-wrapper"
13
13
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
14
 
@@ -5,8 +5,10 @@ module PDF
5
5
  # its own classes and constants. A small amount of documentation is available at
6
6
  # http://ruby-gnome2.sourceforge.jp/fr/hiki.cgi?Cairo%3A%3AContext#Pango+related+APIs
7
7
  def load_libpango
8
+ return if @context.respond_to? :create_pango_layout
9
+
8
10
  begin
9
- require 'pango' unless @context.respond_to? :create_pango_layout
11
+ require 'pango'
10
12
  rescue LoadError
11
13
  raise LoadError, 'Ruby/Pango library not found. Visit http://ruby-gnome2.sourceforge.jp/'
12
14
  end
@@ -16,8 +18,10 @@ module PDF
16
18
  # This will add some methods to the cairo Context class in addition to providing
17
19
  # its own classes and constants.
18
20
  def load_libpixbuf
21
+ return if @context.respond_to? :set_source_pixbuf
22
+
19
23
  begin
20
- require 'gdk_pixbuf2' unless @context.respond_to? :set_source_pixbuf
24
+ require 'gdk_pixbuf2'
21
25
  rescue LoadError
22
26
  raise LoadError, 'Ruby/GdkPixbuf library not found. Visit http://ruby-gnome2.sourceforge.jp/'
23
27
  end
@@ -27,8 +31,16 @@ module PDF
27
31
  # This will add some methods to the cairo Context class in addition to providing
28
32
  # its own classes and constants.
29
33
  def load_libpoppler
34
+ return if @context.respond_to? :render_poppler_page
35
+
36
+ begin
37
+ require 'gtk2'
38
+ rescue Gtk::InitError
39
+ # ignore this error, it's thrown when gtk2 is loaded with no xsession available.
40
+ # as advised at http://www.ruby-forum.com/topic/182949
41
+ end
30
42
  begin
31
- require 'poppler' unless @context.respond_to? :render_poppler_page
43
+ require 'poppler'
32
44
  rescue LoadError
33
45
  raise LoadError, 'Ruby/Poppler library not found. Visit http://ruby-gnome2.sourceforge.jp/'
34
46
  end
@@ -40,13 +52,13 @@ module PDF
40
52
  # There's a *little* bit of documentation at:
41
53
  # http://ruby-gnome2.sourceforge.jp/fr/hiki.cgi?Cairo%3A%3AContext#render_rsvg_handle
42
54
  def load_librsvg
55
+ return if @context.respond_to? :render_svg_handle
56
+
43
57
  begin
44
- require 'rsvg2' unless @context.respond_to? :render_svg_handle
58
+ require 'rsvg2'
45
59
  rescue LoadError
46
60
  raise LoadError, 'Ruby/RSVG library not found. Visit http://ruby-gnome2.sourceforge.jp/'
47
61
  end
48
62
  end
49
-
50
-
51
63
  end
52
64
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Healy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-06 00:00:00 +10:00
18
+ date: 2010-09-07 00:00:00 +10:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency