odt2html 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +6 -1
- data/lib/odt2html.rb +1 -3
- data/lib/odt2html/analyze_graphics.rb +1 -1
- data/lib/odt2html/base.rb +1 -1
- data/lib/odt2html/declaration_block.rb +1 -1
- data/lib/odt2html/version.rb +3 -0
- data/odt2html.gemspec +5 -5
- data/spec/fixtures/example.html +9 -9
- data/spec/integration/files_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -0
- metadata +39 -73
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8e82ee9810c70aae83fe86f8f319633319f136be
|
4
|
+
data.tar.gz: 71241fc98e41b7aaf4b794f51298ed828ed71c37
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 692694bbe6319da000abd7d3694553010d7abafcc1263996c0786614da2f6fb6616903b6a3867aa58f25bb685aa085a66b609237bb66e86ceafb7b15076036fe
|
7
|
+
data.tar.gz: 3a919c5609bd0786a010b5c96a33ed429aa21fbe512a98ae8ac0643ef3adeef14868bfcf953656247bb8ccb1a6a4637e264b8264cc44886d24c07f0f14eae744
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.2.0 / 2015-01-29
|
4
|
+
|
5
|
+
- Extracted version to external file - this was causing some problems with bundler
|
6
|
+
- Sort styles before output - slower, but more consistent across platforms
|
7
|
+
- Consistency fix for metatag in Ruby 1.9.2
|
8
|
+
- Support Rubyzip new interface
|
9
|
+
|
3
10
|
## 0.1.1 / 2011-03-03
|
4
11
|
- Allow to put output into variable instead of forcing it to write to stdout
|
5
12
|
|
data/Gemfile
CHANGED
data/lib/odt2html.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
require 'rexml/document'
|
2
2
|
require 'rexml/xpath'
|
3
|
-
require 'zip
|
3
|
+
require 'zip'
|
4
4
|
require 'stringio'
|
5
5
|
require 'getoptlong'
|
6
6
|
|
7
7
|
module ODT2HTML
|
8
|
-
|
9
|
-
VERSION = "0.1.1"
|
10
8
|
ROOT_PATH = File.expand_path(File.dirname(__FILE__))
|
11
9
|
|
12
10
|
autoload :Base, "#{ROOT_PATH}/odt2html/base"
|
@@ -48,7 +48,7 @@ module ODT2HTML
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def copy_image_file( pic_name, directory, filename )
|
51
|
-
zipfile = Zip::
|
51
|
+
zipfile = Zip::File::open( @input_filename )
|
52
52
|
inStream = zipfile.get_entry( pic_name )
|
53
53
|
if (inStream != nil) then
|
54
54
|
inStream = inStream.get_input_stream
|
data/lib/odt2html/base.rb
CHANGED
@@ -143,7 +143,7 @@ module ODT2HTML
|
|
143
143
|
end
|
144
144
|
|
145
145
|
def get_xml( member_name )
|
146
|
-
zipfile = Zip::
|
146
|
+
zipfile = Zip::File::open( @input_filename )
|
147
147
|
stream = zipfile.get_entry( member_name ).get_input_stream
|
148
148
|
doc = REXML::Document.new stream.read
|
149
149
|
zipfile.close
|
data/odt2html.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "odt2html"
|
3
|
+
require "odt2html/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "odt2html"
|
@@ -10,13 +10,13 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = ["bernard.potocki@imanel.org"]
|
11
11
|
s.homepage = "http://github.com/imanel/odt2html"
|
12
12
|
s.summary = %q{OpenDocument text to HTML converter}
|
13
|
-
s.description = %q{OpenDocument text to HTML converter}
|
13
|
+
s.description = %q{OpenDocument text (.odt) to HTML converter}
|
14
|
+
s.license = "LGPLv2.1"
|
14
15
|
|
15
|
-
s.add_dependency 'rubyzip'
|
16
|
-
s.add_development_dependency 'rspec', '~> 2.4.0'
|
16
|
+
s.add_dependency 'rubyzip', '~> 1.1'
|
17
17
|
|
18
18
|
s.files = `git ls-files`.split("\n")
|
19
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
|
-
end
|
22
|
+
end
|
data/spec/fixtures/example.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
[TITLE_HERE]
|
7
7
|
</title>
|
8
8
|
<style type='text/css'>
|
9
|
-
.P1{
|
10
|
-
|
11
|
-
|
12
|
-
text-align: center; } .P3{
|
13
|
-
|
14
|
-
.Quotations{
|
15
|
-
margin-bottom: 0.1965in;
|
16
|
-
0.3937in; margin-
|
17
|
-
.Text_20_body{
|
9
|
+
.P1{ color: #000000; font-family: Times New Roman; font-size: 18pt;
|
10
|
+
font-weight: bold; text-align: center; } .P2{ color: #000000; font-family:
|
11
|
+
Luxi Sans; font-size: 12pt; margin-bottom: 0.0835in; margin-top: 0in;
|
12
|
+
text-align: center; } .P3{ color: #000000; font-family: Luxi Sans;
|
13
|
+
font-size: 12pt; margin-bottom: 0.0835in; margin-top: 0in; text-align:
|
14
|
+
left; } .Quotations{ color: #000000; font-family: Luxi Sans; font-size:
|
15
|
+
12pt; margin-bottom: 0.1965in; margin-left: 0.3937in; margin-right:
|
16
|
+
0.3937in; margin-top: 0in; text-indent: 0in; } .T1{ font-weight: bold; }
|
17
|
+
.Text_20_body{ color: #000000; font-family: Luxi Sans; font-size: 12pt;
|
18
18
|
margin-bottom: 0.0835in; margin-top: 0in; }
|
19
19
|
</style>
|
20
20
|
</head>
|
@@ -10,6 +10,6 @@ describe "files" do
|
|
10
10
|
parser.instance_variable_set('@input_filename', odt_path)
|
11
11
|
|
12
12
|
html_content = html_file.read.gsub("[TITLE_HERE]", odt_path)
|
13
|
-
parser.convert.
|
13
|
+
expect(parser.convert).to equal_xml(html_content)
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,64 +1,39 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: odt2html
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 1
|
10
|
-
version: 0.1.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Bernard Potocki
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: rubyzip
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.1'
|
33
20
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rspec
|
37
21
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
- 2
|
46
|
-
- 4
|
47
|
-
- 0
|
48
|
-
version: 2.4.0
|
49
|
-
type: :development
|
50
|
-
version_requirements: *id002
|
51
|
-
description: OpenDocument text to HTML converter
|
52
|
-
email:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.1'
|
27
|
+
description: OpenDocument text (.odt) to HTML converter
|
28
|
+
email:
|
53
29
|
- bernard.potocki@imanel.org
|
54
|
-
executables:
|
30
|
+
executables:
|
55
31
|
- odt2html
|
56
32
|
extensions: []
|
57
|
-
|
58
33
|
extra_rdoc_files: []
|
59
|
-
|
60
|
-
|
61
|
-
- .
|
34
|
+
files:
|
35
|
+
- ".gitignore"
|
36
|
+
- ".travis.yml"
|
62
37
|
- CHANGELOG.md
|
63
38
|
- Gemfile
|
64
39
|
- LICENSE.txt
|
@@ -72,46 +47,37 @@ files:
|
|
72
47
|
- lib/odt2html/base.rb
|
73
48
|
- lib/odt2html/declaration.rb
|
74
49
|
- lib/odt2html/declaration_block.rb
|
50
|
+
- lib/odt2html/version.rb
|
75
51
|
- odt2html.gemspec
|
76
52
|
- spec/fixtures/example.html
|
77
53
|
- spec/fixtures/example.odt
|
78
54
|
- spec/integration/files_spec.rb
|
79
55
|
- spec/spec_helper.rb
|
80
|
-
has_rdoc: true
|
81
56
|
homepage: http://github.com/imanel/odt2html
|
82
|
-
licenses:
|
83
|
-
|
57
|
+
licenses:
|
58
|
+
- LGPLv2.1
|
59
|
+
metadata: {}
|
84
60
|
post_install_message:
|
85
61
|
rdoc_options: []
|
86
|
-
|
87
|
-
require_paths:
|
62
|
+
require_paths:
|
88
63
|
- lib
|
89
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
-
|
91
|
-
requirements:
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
92
66
|
- - ">="
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
version: "0"
|
98
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
-
none: false
|
100
|
-
requirements:
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
101
71
|
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
segments:
|
105
|
-
- 0
|
106
|
-
version: "0"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
107
74
|
requirements: []
|
108
|
-
|
109
75
|
rubyforge_project:
|
110
|
-
rubygems_version:
|
76
|
+
rubygems_version: 2.4.5
|
111
77
|
signing_key:
|
112
|
-
specification_version:
|
78
|
+
specification_version: 4
|
113
79
|
summary: OpenDocument text to HTML converter
|
114
|
-
test_files:
|
80
|
+
test_files:
|
115
81
|
- spec/fixtures/example.html
|
116
82
|
- spec/fixtures/example.odt
|
117
83
|
- spec/integration/files_spec.rb
|