doc2html 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ == 1.0.0 / 2007-11-05
2
+
3
+ * Initial release. It is functional but not feature rich
4
+
@@ -0,0 +1,7 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/doc2html
6
+ lib/doc2html.rb
7
+ test/test_doc2html.rb
@@ -0,0 +1,52 @@
1
+ doc2html
2
+ by Pete Brumm
3
+ doc2html@bentbrass.com
4
+
5
+ == DESCRIPTION:
6
+
7
+ Converts word doc's to html
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * command line utility
12
+ * Not too rich in functionality
13
+ * Uses the filtered html instead of the normal. not sure what the difference is but the smaller the better
14
+
15
+ == SYNOPSIS:
16
+
17
+ doc2html foo.doc
18
+ doc2html foo.doc foo.htm
19
+
20
+ == REQUIREMENTS:
21
+
22
+ * ruby-ole
23
+ * requires ole components so it will only run on windows
24
+ * Microsoft Word installed
25
+
26
+ == INSTALL:
27
+
28
+ * sudo gem install doc2html
29
+
30
+ == LICENSE:
31
+
32
+
33
+ Copyright (c) 2007 Pete Brumm
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining
36
+ a copy of this software and associated documentation files (the
37
+ 'Software'), to deal in the Software without restriction, including
38
+ without limitation the rights to use, copy, modify, merge, publish,
39
+ distribute, sublicense, and/or sell copies of the Software, and to
40
+ permit persons to whom the Software is furnished to do so, subject to
41
+ the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be
44
+ included in all copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
47
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
48
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
49
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
50
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
51
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
52
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+ require './lib/doc2html.rb'
6
+
7
+ Hoe.new('doc2html', Doc2Html::VERSION) do |p|
8
+ p.rubyforge_name = 'doc2html'
9
+ p.author = 'Pete Brumm'
10
+ p.email = 'doc2html@bentbrass.com'
11
+ p.summary = 'uses ole to convert word docs to html'
12
+ p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
13
+ p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
14
+ p.remote_rdoc_dir = '/var/www/gforge-projects/doc2html' # Release to root
15
+ p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
16
+ p.need_tar = false
17
+ end
18
+
19
+ # vim: syntax=Ruby
20
+ desc "Release and publish documentation"
21
+ task :repubdoc => [:release, :publish_docs]
22
+
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/ruby
2
+ require 'win32ole'
3
+ require 'doc2html'
4
+
5
+ if ARGV.length == 1
6
+ converter = Doc2Html.new
7
+ converter.convertDoc(ARGV[0],ARGV[0].sub(/\..*?$/,'.htm'))
8
+ elsif ARGV.length == 2
9
+ converter = Doc2Html.new
10
+ converter.convertDoc(ARGV[0],ARGV[1])
11
+ else
12
+ puts "Usage doc2html foo.doc"
13
+ puts "or doc2html foo.doc foo.htm"
14
+ puts "saves doc in word's filtered html format"
15
+ end
@@ -0,0 +1,26 @@
1
+ require 'rubygems'
2
+ require 'win32ole'
3
+
4
+ class Doc2Html
5
+ VERSION = '1.0.0'
6
+
7
+ def convertDoc(docpath,savepath)
8
+ if File.exists?(docpath)
9
+ docfullpath = File.expand_path(docpath)
10
+ savefullpath = File.expand_path(savepath)
11
+ #p docfullpath
12
+ #p savefullpath
13
+ word = WIN32OLE.new('word.application')
14
+ #word.visible = true
15
+ quitWord = word.documents.count == 0
16
+ word.documents.open(docfullpath)
17
+ word.activedocument.trackrevisions = false
18
+ word.activedocument.revisions.acceptall
19
+
20
+ word.activedocument.saveas savefullpath, 10 #wdFormatFilteredHTML
21
+ word.activedocument.close(false)
22
+ word.quit if quitWord
23
+ end
24
+ end
25
+
26
+ end
File without changes
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.2
3
+ specification_version: 1
4
+ name: doc2html
5
+ version: !ruby/object:Gem::Version
6
+ version: 1.0.0
7
+ date: 2007-11-08 00:00:00 -06:00
8
+ summary: uses ole to convert word docs to html
9
+ require_paths:
10
+ - lib
11
+ email: doc2html@bentbrass.com
12
+ homepage: " by Pete Brumm"
13
+ rubyforge_project: doc2html
14
+ description: "== FEATURES/PROBLEMS: * command line utility * Not too rich in functionality * Uses the filtered html instead of the normal. not sure what the difference is but the smaller the better == SYNOPSIS: doc2html foo.doc doc2html foo.doc foo.htm == REQUIREMENTS:"
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Pete Brumm
31
+ files:
32
+ - History.txt
33
+ - Manifest.txt
34
+ - README.txt
35
+ - Rakefile
36
+ - bin/doc2html
37
+ - lib/doc2html.rb
38
+ - test/test_doc2html.rb
39
+ test_files:
40
+ - test/test_doc2html.rb
41
+ rdoc_options:
42
+ - --main
43
+ - README.txt
44
+ extra_rdoc_files:
45
+ - History.txt
46
+ - Manifest.txt
47
+ - README.txt
48
+ executables:
49
+ - doc2html
50
+ extensions: []
51
+
52
+ requirements: []
53
+
54
+ dependencies:
55
+ - !ruby/object:Gem::Dependency
56
+ name: hoe
57
+ version_requirement:
58
+ version_requirements: !ruby/object:Gem::Version::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 1.3.0
63
+ version: