word2html 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
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/>
@@ -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
@@ -0,0 +1,9 @@
1
+ module Word2HTML
2
+ VERSION = "0.0.1"
3
+
4
+ def Word2HTML.convert(data)
5
+ string = data.dup
6
+ string.gsub!(/’/, '&apos;')
7
+ string
8
+ end
9
+ end
@@ -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 &apos;" do
16
+ data = "Don’t miss this opportunity"
17
+ Word2HTML.convert(data).should == "Don&apos;t miss this opportunity"
18
+ end
19
+ end
@@ -0,0 +1 @@
1
+ require 'spec'
@@ -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