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.
@@ -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
@@ -1,2 +1,3 @@
1
1
  pkg
2
2
  Gemfile.lock
3
+ *.gem
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ script: "bundle exec rake spec"
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0
6
+ - 2.1
7
+ - 2.2
8
+ - rbx-2
9
+ - jruby-19mode
10
+ - ruby-head
@@ -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
@@ -1,2 +1,7 @@
1
1
  source "http://rubygems.org"
2
- gemspec
2
+
3
+ gemspec
4
+
5
+ gem 'rake'
6
+ gem 'rspec', '~> 2.4'
7
+ gem 'test_xml'
@@ -1,12 +1,10 @@
1
1
  require 'rexml/document'
2
2
  require 'rexml/xpath'
3
- require 'zip/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::ZipFile::open( @input_filename )
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
@@ -143,7 +143,7 @@ module ODT2HTML
143
143
  end
144
144
 
145
145
  def get_xml( member_name )
146
- zipfile = Zip::ZipFile::open( @input_filename )
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
@@ -24,7 +24,7 @@ module ODT2HTML
24
24
 
25
25
  def to_s
26
26
  result = "{\n"
27
- each { |item|
27
+ sort{|a,b| a.property <=> b.property }.each { |item|
28
28
  result << "\t#{item.property}: #{item.value};\n"
29
29
  }
30
30
  result << "}\n"
@@ -0,0 +1,3 @@
1
+ module ODT2HTML
2
+ VERSION = "0.2.0"
3
+ end
@@ -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
@@ -6,15 +6,15 @@
6
6
  [TITLE_HERE]
7
7
  </title>
8
8
  <style type='text/css'>
9
- .P1{ font-size: 18pt; color: #000000; font-family: Times New Roman;
10
- text-align: center; font-weight: bold; } .P2{ font-size: 12pt; color:
11
- #000000; font-family: Luxi Sans; margin-bottom: 0.0835in; margin-top: 0in;
12
- text-align: center; } .P3{ font-size: 12pt; color: #000000; font-family:
13
- Luxi Sans; margin-bottom: 0.0835in; margin-top: 0in; text-align: left; }
14
- .Quotations{ font-size: 12pt; color: #000000; font-family: Luxi Sans;
15
- margin-bottom: 0.1965in; text-indent: 0in; margin-top: 0in; margin-left:
16
- 0.3937in; margin-right: 0.3937in; } .T1{ font-weight: bold; }
17
- .Text_20_body{ font-size: 12pt; color: #000000; font-family: Luxi Sans;
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.should eql(html_content)
13
+ expect(parser.convert).to equal_xml(html_content)
14
14
  end
15
- end
15
+ end
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
2
  require 'rspec'
3
+ require 'test_xml/spec'
3
4
 
4
5
  require 'odt2html'
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
- hash: 25
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
- date: 2011-03-04 00:00:00 +01:00
19
- default_executable:
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
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
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
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 31
44
- segments:
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
- files:
61
- - .gitignore
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
- none: false
91
- requirements:
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
92
66
  - - ">="
93
- - !ruby/object:Gem::Version
94
- hash: 3
95
- segments:
96
- - 0
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
- hash: 3
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: 1.4.2
76
+ rubygems_version: 2.4.5
111
77
  signing_key:
112
- specification_version: 3
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