htmldoc 0.2.1 → 0.2.2
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/History.txt +6 -0
- data/LICENSE.txt +1 -0
- data/Manifest.txt +0 -1
- data/Rakefile +3 -6
- data/lib/htmldoc.rb +1 -1
- data/lib/htmldoc/version.rb +1 -1
- data/test/basic_test.rb +4 -1
- data/test/generation_test.rb +2 -2
- metadata +23 -11
- data/CHANGELOG.txt +0 -34
data/History.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
0.2.2
|
2
|
+
* Move source code to GitHub: http://github.com/craigw/htmldoc
|
3
|
+
* Strings that have linebreaks in are probably not URLs.
|
4
|
+
* If a string has a line starting what matches /https?:\/\/ it's not an
|
5
|
+
URL, it's a string.
|
6
|
+
|
1
7
|
0.2.1
|
2
8
|
* Fixed a bug in set_option where the value false would be seen as nil instead of :no
|
3
9
|
|
data/LICENSE.txt
CHANGED
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
@@ -12,17 +12,14 @@ require 'hoe'
|
|
12
12
|
include FileUtils
|
13
13
|
require File.join(File.dirname(__FILE__), 'lib', 'htmldoc', 'version')
|
14
14
|
|
15
|
-
AUTHOR = "
|
16
|
-
EMAIL = "
|
15
|
+
AUTHOR = "Craig R Webster"
|
16
|
+
EMAIL = "craig@barkingiguana.com"
|
17
17
|
DESCRIPTION = "A wrapper around HTMLDOC, a PDF generation utility"
|
18
18
|
GEM_NAME = "htmldoc"
|
19
19
|
RUBYFORGE_PROJECT = "htmldoc"
|
20
20
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
21
21
|
|
22
22
|
NAME = "HTMLDOC"
|
23
|
-
REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
|
24
|
-
VERS = ENV['VERSION'] || (PDF::HTMLDOC::VERSION::STRING + (REV ? ".#{REV}" : ""))
|
25
|
-
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
26
23
|
RDOC_OPTS = ['--quiet', '--title', "htmldoc documentation",
|
27
24
|
"--opname", "index.html",
|
28
25
|
"--line-numbers",
|
@@ -37,7 +34,7 @@ end
|
|
37
34
|
|
38
35
|
# Generate all the Rake tasks
|
39
36
|
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
40
|
-
hoe = Hoe.new(GEM_NAME,
|
37
|
+
hoe = Hoe.new(GEM_NAME, PDF::HTMLDOC::VERSION::STRING) do |p|
|
41
38
|
|
42
39
|
p.author = AUTHOR
|
43
40
|
p.email = EMAIL
|
data/lib/htmldoc.rb
CHANGED
@@ -127,7 +127,7 @@ module PDF
|
|
127
127
|
# either <tt>http://</tt> or <tt>https://</tt>; a file, which will
|
128
128
|
# be verified for existence; or any text.
|
129
129
|
def add_page(page)
|
130
|
-
if
|
130
|
+
if /\A(http|https)/ =~ page && page !~ /\r|\n/
|
131
131
|
type = :url
|
132
132
|
elsif File.exists?(page)
|
133
133
|
type = :file
|
data/lib/htmldoc/version.rb
CHANGED
data/test/basic_test.rb
CHANGED
@@ -83,7 +83,10 @@ class BasicTest < Test::Unit::TestCase
|
|
83
83
|
# level of functionality.
|
84
84
|
pdf = PDF::HTMLDoc.new
|
85
85
|
tempfile = Tempfile.new("htmldoc.test")
|
86
|
-
pages = ["http://example.org/", tempfile.path
|
86
|
+
pages = ["http://example.org/", tempfile.path]
|
87
|
+
tmpstring = "1234567890"
|
88
|
+
tmpstring += "1234567890" while File.exists?(tmpstring)
|
89
|
+
pages << tmpstring
|
87
90
|
pages.each do |page|
|
88
91
|
pdf << page
|
89
92
|
end
|
data/test/generation_test.rb
CHANGED
@@ -19,6 +19,7 @@ class GenerationTest < Test::Unit::TestCase
|
|
19
19
|
# level of functionality. Output to directories is not tested for
|
20
20
|
# now.
|
21
21
|
basic_test(PDF::HTML)
|
22
|
+
basic_test(PDF::HTML, "http://foo.com/\nhttp://bar.com/")
|
22
23
|
basic_test(PDF::PS)
|
23
24
|
basic_test(PDF::PDF)
|
24
25
|
end
|
@@ -65,13 +66,12 @@ class GenerationTest < Test::Unit::TestCase
|
|
65
66
|
|
66
67
|
private
|
67
68
|
|
68
|
-
def basic_test(format)
|
69
|
+
def basic_test(format, page = %Q(<h1>Page 1</h1><p>Test.</p><h1>Page 2</h1><p>Test.</p>\nhttp://foo.com/))
|
69
70
|
# Temporary files
|
70
71
|
path1, path2 = (1..2).collect { |i| Dir.tmpdir + "/#{i}.#{format}" }
|
71
72
|
# Create a temporary file for the duration of the test
|
72
73
|
Tempfile.open("htmldoc.test") do |tempfile|
|
73
74
|
# Load the temporary file with some test datas
|
74
|
-
page = "<h1>Page 1</h1><p>Test.</p><h1>Page 2</h1><p>Test.</p>"
|
75
75
|
tempfile.binmode
|
76
76
|
tempfile.write(page)
|
77
77
|
tempfile.flush
|
metadata
CHANGED
@@ -1,32 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmldoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Craig R Webster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-10-19 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.3.3
|
24
|
+
version:
|
25
|
+
description: |-
|
26
|
+
PDF::HTMLDoc is a wrapper around HTMLDOC, an open-source application
|
27
|
+
that converts HTML input files into formatted HTML, PDF or PostScript
|
28
|
+
output.
|
29
|
+
email: craig@barkingiguana.com
|
18
30
|
executables: []
|
19
31
|
|
20
32
|
extensions: []
|
21
33
|
|
22
34
|
extra_rdoc_files:
|
23
|
-
- CHANGELOG.txt
|
24
35
|
- History.txt
|
25
36
|
- LICENSE.txt
|
26
37
|
- Manifest.txt
|
27
38
|
- README.txt
|
28
39
|
files:
|
29
|
-
- CHANGELOG.txt
|
30
40
|
- History.txt
|
31
41
|
- LICENSE.txt
|
32
42
|
- Manifest.txt
|
@@ -41,6 +51,8 @@ files:
|
|
41
51
|
- test/test_helper.rb
|
42
52
|
has_rdoc: true
|
43
53
|
homepage: http://htmldoc.rubyforge.org
|
54
|
+
licenses: []
|
55
|
+
|
44
56
|
post_install_message:
|
45
57
|
rdoc_options:
|
46
58
|
- --main
|
@@ -62,9 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
74
|
requirements: []
|
63
75
|
|
64
76
|
rubyforge_project: htmldoc
|
65
|
-
rubygems_version: 1.
|
77
|
+
rubygems_version: 1.3.5
|
66
78
|
signing_key:
|
67
|
-
specification_version:
|
79
|
+
specification_version: 3
|
68
80
|
summary: A wrapper around HTMLDOC, a PDF generation utility
|
69
81
|
test_files:
|
70
82
|
- test/basic_test.rb
|
data/CHANGELOG.txt
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
2008-09-02 paploo <jeff@paploo.net>
|
2
|
-
|
3
|
-
* Fixed a bug in :set_option where it would see the value false as nil
|
4
|
-
instead of :no
|
5
|
-
|
6
|
-
* Updated the website URL in README.txt
|
7
|
-
|
8
|
-
2007-03-07 ronaldo <ronaldo@reflectivesurface.com>
|
9
|
-
|
10
|
-
* Changed the instance variable result to a hash of information
|
11
|
-
about the generation, including bytes and pages generated, and the
|
12
|
-
raw result of the program's execution
|
13
|
-
|
14
|
-
* Added an errors instance variable to register all the errors
|
15
|
-
generated in the course of the program's execution
|
16
|
-
|
17
|
-
* Refactored generate
|
18
|
-
|
19
|
-
* Changed generate so it now raises an exception if the program
|
20
|
-
path cannot be found
|
21
|
-
|
22
|
-
* Improved the tests
|
23
|
-
|
24
|
-
* Improved the documentation
|
25
|
-
|
26
|
-
2007-03-06 ronaldo <ronaldo@reflectivesurface.com>
|
27
|
-
|
28
|
-
* Fixed spelling and grammatical error in README.txt
|
29
|
-
|
30
|
-
* Fixed a couple of naming issues in Rakefile
|
31
|
-
|
32
|
-
2007-03-05 ronaldo <ronaldo@reflectivesurface.com>
|
33
|
-
|
34
|
-
* Initial release
|