poppler 3.3.2 → 3.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95138f5951e151036301abbdd828ff01b6c92bbc2c8c1ef8bda0ccfdd259a99e
4
- data.tar.gz: 32463d94a299fcc81ad41a9848261b3bf264157557142c4d15c71927c532c369
3
+ metadata.gz: b2480ac17782c4bf82a0147711e6ec95953218ec58936c36c09a12ad5c5b2bbf
4
+ data.tar.gz: 6179294b81290156d47075d34a9e6f011fcffd377a669e1becdde1c7f4a46088
5
5
  SHA512:
6
- metadata.gz: 630cd0e290cd4a6a51721c61d8fbd7878fe3c3cf2f269cbef5114c41ca563d8957232af2217492f919384675fdae4fdc5fb97415731a65cc001a44e9f522fadf
7
- data.tar.gz: 1a22050e4759adc1139f39b1be901d4fda220d72a83bdb22ff385b43a81f0bed2e80a5b73227b0ba024b96441a0b2db88d0b23f4fbe94b611333d8fe8e4ae988
6
+ metadata.gz: dec213783ea375fd5859c6966b412753a557367ab3e7492fb3f9602927fa58ade6638cc642420de32557bc90e6fd62c3301ec1173a1064e431d3f362b4fc9f92
7
+ data.tar.gz: eb68eea6875b4303bef009a1b1be302a08b21acf6daf0916f04f2f795b56693ca85f1cb633604fe7969f0a6a176f4ef394a2011383d993862ba0a2aed5ae8992
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017-2018 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017-2019 Ruby-GNOME2 Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -56,6 +56,7 @@ module Poppler
56
56
  # initialize_new_from_data(data, password)
57
57
 
58
58
  @file = Tempfile.new(["poppler", ".pdf"])
59
+ @file.binmode
59
60
  @file.write(data)
60
61
  @file.close
61
62
  initialize_new_from_file(ensure_uri(@file.path), password)
@@ -71,7 +72,8 @@ module Poppler
71
72
  end
72
73
  initialize_new_from_stream(stream, length, password)
73
74
  elsif file
74
- if file.is_a?(String)
75
+ case file
76
+ when String, Pathname
75
77
  initialize(path: file, password: password)
76
78
  else
77
79
  initialize_new_from_gfile(file, password)
@@ -118,6 +120,7 @@ module Poppler
118
120
  end
119
121
 
120
122
  def ensure_uri(uri)
123
+ uri = uri.to_path if uri.respond_to?(:to_path)
121
124
  if GLib.path_is_absolute?(uri)
122
125
  GLib.filename_to_uri(uri)
123
126
  elsif /\A[a-zA-Z][a-zA-Z\d\-+.]*:/.match(uri)
@@ -1,14 +1,43 @@
1
1
  class TestDocument < Test::Unit::TestCase
2
2
  sub_test_case("#initialize") do
3
- def test_data
4
- pdf = StringIO.new
5
- surface = Cairo::PDFSurface.new(pdf, 100, 100)
6
- context = Cairo::Context.new(surface)
7
- context.show_text("Hello")
8
- surface.finish
3
+ sub_test_case(":data") do
4
+ def with_default_internal(encoding)
5
+ original_verbose = $VERBOSE
6
+ original_encoding = Encoding.default_internal
7
+ begin
8
+ $VERBOSE = false
9
+ Encoding.default_internal = encoding
10
+ yield
11
+ ensure
12
+ Encoding.default_internal = original_encoding
13
+ $VERBOSE = original_verbose
14
+ end
15
+ end
16
+
17
+ def test_default_internal
18
+ pdf = StringIO.new("".b)
19
+ surface = Cairo::PDFSurface.new(pdf, 100, 100)
20
+ context = Cairo::Context.new(surface)
21
+ context.show_text("Hello")
22
+ surface.finish
23
+
24
+ document = with_default_internal(Encoding::UTF_8) do
25
+ Poppler::Document.new(:data => pdf.string)
26
+ end
27
+ assert_equal("Hello", document[0].text)
28
+ end
29
+ end
30
+
31
+ sub_test_case(":path") do
32
+ def test_string
33
+ document = Poppler::Document.new(path: multiple_pages_pdf)
34
+ assert_equal("The first page", document[0].text)
35
+ end
9
36
 
10
- document = Poppler::Document.new(:data => pdf.string)
11
- assert_equal("Hello", document[0].text)
37
+ def test_pathname
38
+ document = Poppler::Document.new(path: Pathname(multiple_pages_pdf))
39
+ assert_equal("The first page", document[0].text)
40
+ end
12
41
  end
13
42
  end
14
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poppler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-02 00:00:00.000000000 Z
11
+ date: 2019-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cairo-gobject
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.2
19
+ version: 3.3.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.3.2
26
+ version: 3.3.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gio2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.3.2
33
+ version: 3.3.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 3.3.2
40
+ version: 3.3.3
41
41
  description: Ruby/Poppler is a Ruby binding of poppler-glib.
42
42
  email: ruby-gnome2-devel-en@lists.sourceforge.net
43
43
  executables: []