poppler 3.4.0 → 3.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/test/poppler-test-utils.rb +18 -4
- data/test/run-test.rb +14 -42
- data/test/test-annotation.rb +18 -0
- data/test/test-document.rb +36 -18
- data/test/test-index-iter.rb +3 -1
- data/test/test-page.rb +3 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2a613f53faf2a4e5a8a39daaa8c9123c1893e350c5589272855fa39319a7c49
|
4
|
+
data.tar.gz: 10fc46692e40e5fd4c02f94e29ebfca0342368fde4fc87e5e4892c15261281e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd9e6ecf3063aa99cbb2bfe78c6bd7425f863ce9704b931dcdd3be38aa000a157ea56918b02832ab9f605272f5c60f79922e24070e44c3226d4372339a10fb99
|
7
|
+
data.tar.gz: 3b9ab837edd7a524cf19a32c9fc33341b7929cfe9aec3a370f7a79b7d2b0dc68aba48a2b8b6157b2def4dabddfbb97f1e4e50c0891b318136cfea4277711b0ba
|
data/test/poppler-test-utils.rb
CHANGED
@@ -1,6 +1,24 @@
|
|
1
|
+
# Copyright (C) 2008-2021 Ruby-GNOME Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
1
17
|
require "open-uri"
|
2
18
|
require "fileutils"
|
3
19
|
|
20
|
+
require "poppler"
|
21
|
+
|
4
22
|
module PopplerTestUtils
|
5
23
|
def ensure_dir(dir)
|
6
24
|
FileUtils.mkdir_p(dir)
|
@@ -19,10 +37,6 @@ module PopplerTestUtils
|
|
19
37
|
File.join(fixtures_dir, *components)
|
20
38
|
end
|
21
39
|
|
22
|
-
def tmp_dir
|
23
|
-
ensure_dir(File.join(test_dir, "tmp"))
|
24
|
-
end
|
25
|
-
|
26
40
|
def form_pdf
|
27
41
|
fixture_path("form.pdf")
|
28
42
|
end
|
data/test/run-test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Copyright (C) 2017 Ruby-
|
3
|
+
# Copyright (C) 2017-2021 Ruby-GNOME Project Team
|
4
4
|
#
|
5
5
|
# This library is free software; you can redistribute it and/or
|
6
6
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -16,45 +16,17 @@
|
|
16
16
|
# License along with this library; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
$LOAD_PATH.unshift(File.join(glib_dir, "test"))
|
33
|
-
require 'glib-test-init'
|
34
|
-
|
35
|
-
[
|
36
|
-
[glib_dir, "glib2"],
|
37
|
-
[gio_dir, "gio2"],
|
38
|
-
[cairo_gobject_dir, "cairo-gobject"],
|
39
|
-
[gdk_pixbuf_dir, "gdk_pixbuf2"],
|
40
|
-
[pango_dir, "pango"],
|
41
|
-
[gobject_introspection_dir, "gobject-introspection"],
|
42
|
-
[base_dir, "poppler"],
|
43
|
-
].each do |dir, module_name|
|
44
|
-
if File.exist?(File.join(dir, "Makefile"))
|
45
|
-
if have_make
|
46
|
-
system("cd #{dir.dump} && make > /dev/null") or exit(false)
|
47
|
-
end
|
48
|
-
$LOAD_PATH.unshift(File.join(dir, "ext", module_name))
|
49
|
-
end
|
50
|
-
$LOAD_PATH.unshift(File.join(dir, "lib"))
|
51
|
-
end
|
52
|
-
require "poppler"
|
53
|
-
|
54
|
-
$LOAD_PATH.unshift(File.join(base_dir, "test"))
|
55
|
-
require 'poppler-test-utils'
|
56
|
-
class Test::Unit::TestCase
|
57
|
-
include PopplerTestUtils
|
19
|
+
require_relative "../../glib2/test/run-test"
|
20
|
+
|
21
|
+
run_test(__dir__,
|
22
|
+
[
|
23
|
+
"glib2",
|
24
|
+
"gobject-introspection",
|
25
|
+
"cairo-gobject",
|
26
|
+
"gio2",
|
27
|
+
"gdk_pixbuf2",
|
28
|
+
"pango",
|
29
|
+
"poppler",
|
30
|
+
]) do
|
31
|
+
require_relative "poppler-test-utils"
|
58
32
|
end
|
59
|
-
|
60
|
-
exit Test::Unit::AutoRunner.run(true, File.join(base_dir, "test"))
|
data/test/test-annotation.rb
CHANGED
@@ -1,4 +1,22 @@
|
|
1
|
+
# Copyright (C) 2008-2021 Ruby-GNOME Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
1
17
|
class TestAnnotation < Test::Unit::TestCase
|
18
|
+
include PopplerTestUtils
|
19
|
+
|
2
20
|
def test_type
|
3
21
|
assert_kind_of(Poppler::AnnotType, annotation.type)
|
4
22
|
end
|
data/test/test-document.rb
CHANGED
@@ -1,4 +1,22 @@
|
|
1
|
+
# Copyright (C) 2008-2021 Ruby-GNOME Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
1
17
|
class TestDocument < Test::Unit::TestCase
|
18
|
+
include PopplerTestUtils
|
19
|
+
|
2
20
|
sub_test_case("#initialize") do
|
3
21
|
sub_test_case(":data") do
|
4
22
|
def with_default_internal(encoding)
|
@@ -42,27 +60,27 @@ class TestDocument < Test::Unit::TestCase
|
|
42
60
|
end
|
43
61
|
|
44
62
|
def test_save
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
63
|
+
Dir.mktmpdir do |tmp_dir|
|
64
|
+
saved_pdf = File.join(tmp_dir, "saved.pdf")
|
65
|
+
document = Poppler::Document.new(text_field_pdf)
|
66
|
+
find_first_text_field(document).text = "XXX"
|
67
|
+
document.save(saved_pdf)
|
68
|
+
reread_document = Poppler::Document.new(saved_pdf)
|
69
|
+
assert_equal("XXX", find_first_text_field(reread_document).text)
|
70
|
+
end
|
53
71
|
end
|
54
72
|
|
55
73
|
def test_save_a_copy
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
74
|
+
Dir.mktmpdir do |tmp_dir|
|
75
|
+
copied_pdf = File.join(tmp_dir, "copied.pdf")
|
76
|
+
document = Poppler::Document.new(text_field_pdf)
|
77
|
+
first_text_field = find_first_text_field(document)
|
78
|
+
default_text = first_text_field.text
|
79
|
+
first_text_field.text = "XXX"
|
80
|
+
document.save_a_copy(copied_pdf)
|
81
|
+
reread_document = Poppler::Document.new(copied_pdf)
|
82
|
+
assert_equal(default_text, find_first_text_field(reread_document).text)
|
83
|
+
end
|
66
84
|
end
|
67
85
|
|
68
86
|
def test_each
|
data/test/test-index-iter.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2017 Ruby-
|
1
|
+
# Copyright (C) 2017-2021 Ruby-GNOME 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
|
@@ -15,6 +15,8 @@
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
17
|
class TestIndexIter < Test::Unit::TestCase
|
18
|
+
include PopplerTestUtils
|
19
|
+
|
18
20
|
def test_title
|
19
21
|
document = Poppler::Document.new(outline_pdf)
|
20
22
|
assert_equal([
|
data/test/test-page.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2008-
|
1
|
+
# Copyright (C) 2008-2021 Ruby-GNOME 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
|
@@ -15,6 +15,8 @@
|
|
15
15
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
16
|
|
17
17
|
class TestPage < Test::Unit::TestCase
|
18
|
+
include PopplerTestUtils
|
19
|
+
|
18
20
|
def test_get_image
|
19
21
|
document = Poppler::Document.new(image_pdf)
|
20
22
|
page, mapping = find_first_image_mapping(document)
|
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.4.
|
4
|
+
version: 3.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-07 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.4.
|
19
|
+
version: 3.4.5
|
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.4.
|
26
|
+
version: 3.4.5
|
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.4.
|
33
|
+
version: 3.4.5
|
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.4.
|
40
|
+
version: 3.4.5
|
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: []
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.3.0.dev
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Ruby/Poppler is a Ruby binding of poppler-glib.
|