word2html 0.0.1
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.
- data/README +19 -0
- data/Rakefile +12 -0
- data/lib/word2html.rb +9 -0
- data/spec/lib/word2html_spec.rb +19 -0
- data/spec/spec_helper.rb +1 -0
- data/word2html.gemspec +20 -0
- metadata +60 -0
data/README
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Word2HTML
|
2
|
+
=========
|
3
|
+
|
4
|
+
I get sent copy in a Word document. If I just copy and paste I tend to
|
5
|
+
end up with smart-quotes and such things all over the place. I'm not
|
6
|
+
hugely for that. I want the HTML entities for these characters instead.
|
7
|
+
|
8
|
+
|
9
|
+
Usage
|
10
|
+
-----
|
11
|
+
|
12
|
+
require 'word2html'
|
13
|
+
Word2HTML.convert(text_from_word_document)
|
14
|
+
|
15
|
+
|
16
|
+
Authors
|
17
|
+
-------
|
18
|
+
|
19
|
+
Craig R Webster <http://barkingiguana.com/>
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'spec/rake/spectask'
|
3
|
+
|
4
|
+
desc "Run the tests"
|
5
|
+
Spec::Rake::SpecTask.new('spec') do |t|
|
6
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
7
|
+
t.ruby_opts = [ '-rubygems' ]
|
8
|
+
t.spec_opts = [ '--format specdoc' ]
|
9
|
+
t.libs << 'lib'
|
10
|
+
t.libs << 'spec'
|
11
|
+
end
|
12
|
+
task :default => :spec
|
data/lib/word2html.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'word2html'
|
3
|
+
|
4
|
+
describe "Word2HTML" do
|
5
|
+
it "should be versioned" do
|
6
|
+
lambda {
|
7
|
+
Word2HTML.const_get(:VERSION)
|
8
|
+
}.should_not raise_error
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should be version 0.0.1" do
|
12
|
+
Word2HTML::VERSION.should eql("0.0.1")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should convert smart-apostrapes to '" do
|
16
|
+
data = "Don’t miss this opportunity"
|
17
|
+
Word2HTML.convert(data).should == "Don't miss this opportunity"
|
18
|
+
end
|
19
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec'
|
data/word2html.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "word2html"
|
3
|
+
s.version = "0.0.1"
|
4
|
+
s.summary = "Convert fancy characters from Word documents to HTML entities"
|
5
|
+
s.email = "craig@barkingiguana.com"
|
6
|
+
s.homepage = 'http://github.com/craigw/word2html'
|
7
|
+
s.description = "Convert fancy characters from Word documents to HTML entities"
|
8
|
+
s.authors = [ "Craig R Webster" ]
|
9
|
+
s.files = %W(
|
10
|
+
README
|
11
|
+
Rakefile
|
12
|
+
lib/word2html.rb
|
13
|
+
spec/spec_helper.rb
|
14
|
+
spec/lib/word2html_spec.rb
|
15
|
+
word2html.gemspec
|
16
|
+
)
|
17
|
+
s.test_files = %W(
|
18
|
+
spec/lib/word2html_spec.rb
|
19
|
+
)
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: word2html
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Craig R Webster
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-11-04 00:00:00 +00:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Convert fancy characters from Word documents to HTML entities
|
17
|
+
email: craig@barkingiguana.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- README
|
26
|
+
- Rakefile
|
27
|
+
- lib/word2html.rb
|
28
|
+
- spec/spec_helper.rb
|
29
|
+
- spec/lib/word2html_spec.rb
|
30
|
+
- word2html.gemspec
|
31
|
+
has_rdoc: true
|
32
|
+
homepage: http://github.com/craigw/word2html
|
33
|
+
licenses: []
|
34
|
+
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "0"
|
45
|
+
version:
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: "0"
|
51
|
+
version:
|
52
|
+
requirements: []
|
53
|
+
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 1.3.5
|
56
|
+
signing_key:
|
57
|
+
specification_version: 3
|
58
|
+
summary: Convert fancy characters from Word documents to HTML entities
|
59
|
+
test_files:
|
60
|
+
- spec/lib/word2html_spec.rb
|