chupa-text-decomposer-abiword 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/test-zabw.rb ADDED
@@ -0,0 +1,71 @@
1
+ # Copyright (C) 2019 Sutou Kouhei <kou@clear-code.com>
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
+
17
+ class TestZabw < Test::Unit::TestCase
18
+ include FixtureHelper
19
+
20
+ def setup
21
+ @decomposer = ChupaText::Decomposers::AbiWord.new({})
22
+ end
23
+
24
+ def fixture_path(*components)
25
+ super("zabw", *components)
26
+ end
27
+
28
+ sub_test_case("target?") do
29
+ sub_test_case("extension") do
30
+ def create_data(uri)
31
+ data = ChupaText::Data.new
32
+ data.body = ""
33
+ data.uri = uri
34
+ data
35
+ end
36
+
37
+ def test_doc
38
+ assert_true(@decomposer.target?(create_data("document.zabw")))
39
+ end
40
+ end
41
+ end
42
+
43
+ sub_test_case("decompose") do
44
+ include DecomposeHelper
45
+
46
+ sub_test_case("one page") do
47
+ def test_body
48
+ assert_equal(["Page1\n"], decompose.collect(&:body))
49
+ end
50
+
51
+ private
52
+ def decompose
53
+ super(fixture_path("one-page.zabw"))
54
+ end
55
+ end
56
+
57
+ sub_test_case("multi pages") do
58
+ def test_body
59
+ assert_equal([<<-BODY], decompose.collect(&:body))
60
+ Page1
61
+ Page2
62
+ BODY
63
+ end
64
+
65
+ private
66
+ def decompose
67
+ super(fixture_path("multi-pages.zabw"))
68
+ end
69
+ end
70
+ end
71
+ end
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chupa-text-decomposer-abiword
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Sutou Kouhei
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-06-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: chupa-text
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: chupa-text-decomposer-pdf
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: test-unit
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: packnga
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: kramdown
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: |
112
+ This is a ChupaText decomposer plugin for to extract text and
113
+ meta-data from office documents such as Microsoft Word files and
114
+ LibreOffice Writer files.
115
+
116
+ You can use `abiword` decomposer.
117
+ email:
118
+ - kou@clear-code.com
119
+ executables: []
120
+ extensions: []
121
+ extra_rdoc_files: []
122
+ files:
123
+ - ".yardopts"
124
+ - Gemfile
125
+ - LICENSE.txt
126
+ - README.md
127
+ - Rakefile
128
+ - chupa-text-decomposer-abiword.gemspec
129
+ - doc/text/news.md
130
+ - lib/chupa-text/decomposers/abiword.rb
131
+ - test/fixture/abw/multi-pages.abw
132
+ - test/fixture/abw/one-page.abw
133
+ - test/fixture/doc/multi-pages.doc
134
+ - test/fixture/doc/one-page.doc
135
+ - test/fixture/docx/multi-pages.docx
136
+ - test/fixture/docx/one-page.docx
137
+ - test/fixture/odt/multi-pages.odt
138
+ - test/fixture/odt/one-page.odt
139
+ - test/fixture/rtf/multi-pages.rtf
140
+ - test/fixture/rtf/one-page.rtf
141
+ - test/fixture/zabw/multi-pages.zabw
142
+ - test/fixture/zabw/one-page.zabw
143
+ - test/helper.rb
144
+ - test/run-test.rb
145
+ - test/test-abw.rb
146
+ - test/test-doc.rb
147
+ - test/test-docx.rb
148
+ - test/test-odt.rb
149
+ - test/test-rtf.rb
150
+ - test/test-zabw.rb
151
+ homepage: https://github.com/ranguba/chupa-text-decomposer-abiword
152
+ licenses:
153
+ - LGPL-2.1+
154
+ metadata: {}
155
+ post_install_message:
156
+ rdoc_options: []
157
+ require_paths:
158
+ - lib
159
+ required_ruby_version: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - ">="
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
+ required_rubygems_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ requirements: []
170
+ rubyforge_project:
171
+ rubygems_version: 2.7.6.2
172
+ signing_key:
173
+ specification_version: 4
174
+ summary: This is a ChupaText decomposer plugin for to extract text and meta-data from
175
+ office documents such as Microsoft Word files and LibreOffice Writer files.
176
+ test_files: []