ulink-checker 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ulink-checker +14 -11
- data/readme.md +16 -5
- data/ulink-checker.gemspec +9 -4
- metadata +71 -39
data/bin/ulink-checker
CHANGED
@@ -27,7 +27,7 @@ def processCommandLine
|
|
27
27
|
options = {}
|
28
28
|
|
29
29
|
optparse = OptionParser.new do |opts|
|
30
|
-
opts.banner = "ulink-checker v0.0.
|
30
|
+
opts.banner = "ulink-checker v0.0.3"
|
31
31
|
|
32
32
|
#options[:followXIInclude] = false
|
33
33
|
#opts.on( '-x', '--xiinclude', 'Follow' ) do
|
@@ -35,7 +35,7 @@ def processCommandLine
|
|
35
35
|
#end
|
36
36
|
|
37
37
|
options[:url] = ""
|
38
|
-
opts.on( '-u URL', '--url URL', 'check XML at URL
|
38
|
+
opts.on( '-u URL', '--url URL', 'check XML at URL' ) do | url |
|
39
39
|
options[:url] = url
|
40
40
|
end
|
41
41
|
|
@@ -66,16 +66,8 @@ def processCommandLine
|
|
66
66
|
exit
|
67
67
|
end
|
68
68
|
|
69
|
-
# if they specify URL then too bad!
|
70
|
-
if (options[:url] != "") then
|
71
|
-
puts "SORRY: URLs are not supported yet"
|
72
|
-
puts
|
73
|
-
puts optparse
|
74
|
-
exit
|
75
|
-
end
|
76
|
-
|
77
69
|
#can't specify both url and file, only one
|
78
|
-
if (options[:url] != "" and
|
70
|
+
if (options[:url] != "" and options[:file] != "") then
|
79
71
|
puts "ERROR: can only specify one of file or URL."
|
80
72
|
puts
|
81
73
|
puts optparse
|
@@ -93,12 +85,23 @@ if (options[:file] != "") then
|
|
93
85
|
puts "Checking URLs in #{options[:file]} ...\n\n"
|
94
86
|
|
95
87
|
File.open(options[:file]) do |fp|
|
88
|
+
#TODO: deal with xiinclude fails here
|
96
89
|
doc = Nokogiri::XML(fp) do |conf|
|
97
90
|
conf.strict.dtdload.noent.nocdata.xinclude
|
98
91
|
end
|
99
92
|
end
|
100
93
|
end
|
101
94
|
|
95
|
+
if (options[:url] != "") then
|
96
|
+
puts "Checking URLs from #{options[:url]} ...\n\n"
|
97
|
+
#TODO: deal with SSL
|
98
|
+
#TODO: deal with xiinclude fails here
|
99
|
+
doc = Nokogiri::XML(open(options[:url])) do | conf |
|
100
|
+
conf.strict.dtdload.noent.nocdata.xinclude
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
|
102
105
|
# xpath the urls out
|
103
106
|
urls = doc.xpath("//ulink")
|
104
107
|
|
data/readme.md
CHANGED
@@ -8,15 +8,26 @@ Reports:
|
|
8
8
|
* REDIRECT: when the URL gets redirected
|
9
9
|
* OK: if the URL works fine
|
10
10
|
|
11
|
-
##
|
11
|
+
## install
|
12
12
|
|
13
|
-
|
13
|
+
Requires Ruby and RubyGems.
|
14
|
+
|
15
|
+
* on Fedora: `$ sudo yum install ruby-devel rubygems`
|
16
|
+
|
17
|
+
1. `$ sudo gem install ulink-checker`
|
14
18
|
|
15
19
|
## run
|
16
20
|
|
17
|
-
1.
|
21
|
+
1. `ulink-checker -f somedocbook.xml` or `ulink-checker -u http://server.com/project/en-US/somedocbook.xml`
|
18
22
|
2. See the amazing technicolour output
|
19
23
|
|
20
|
-
|
24
|
+
![](ulink-0.0.2-ss.png)
|
25
|
+
|
26
|
+
## problems
|
21
27
|
|
22
|
-
|
28
|
+
1. -f doesn't check for file's existence (crash)
|
29
|
+
2. -u doesn't handling URL or network errors (crash)
|
30
|
+
1. non-XML content crashes it
|
31
|
+
2. failed `<xi:include>`s will crash it without a helpful message
|
32
|
+
3. can't disable `<xi:include>` support
|
33
|
+
4. -u doesn't work with https
|
data/ulink-checker.gemspec
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'ulink-checker'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.3'
|
4
4
|
s.date = '2013-03-12'
|
5
|
+
s.homepage = 'https://github.com/dmison/ulink-checker'
|
5
6
|
s.summary = "checks urls in docbook ulink tags"
|
6
7
|
s.description = "checks urls in docbook ulink tags"
|
7
8
|
s.authors = ["darrin Mison"]
|
@@ -14,6 +15,10 @@ Gem::Specification.new do |s|
|
|
14
15
|
"bin/ulink-checker",
|
15
16
|
"lib/duration.rb",
|
16
17
|
"lib/link_checker_override.rb"]
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
|
19
|
+
s.add_runtime_dependency("nokogiri", [">= 1.5.6"])
|
20
|
+
s.add_runtime_dependency("rainbow", [">= 1.1.4"])
|
21
|
+
s.add_runtime_dependency("link-checker", [">= 0.7.2"])
|
22
|
+
|
23
|
+
end
|
24
|
+
|
metadata
CHANGED
@@ -1,67 +1,99 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ulink-checker
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
version: 0.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- darrin Mison
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.5.6
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.5.6
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rainbow
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.1.4
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.1.4
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: link-checker
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.7.2
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.7.2
|
21
62
|
description: checks urls in docbook ulink tags
|
22
63
|
email: dmison@me.com
|
23
|
-
executables:
|
64
|
+
executables:
|
24
65
|
- ulink-checker
|
25
66
|
extensions: []
|
26
|
-
|
27
67
|
extra_rdoc_files: []
|
28
|
-
|
29
|
-
files:
|
68
|
+
files:
|
30
69
|
- Gemfile
|
31
70
|
- readme.md
|
32
71
|
- ulink-checker.gemspec
|
33
72
|
- bin/ulink-checker
|
34
73
|
- lib/duration.rb
|
35
74
|
- lib/link_checker_override.rb
|
36
|
-
has_rdoc: true
|
37
75
|
homepage: https://github.com/dmison/ulink-checker
|
38
76
|
licenses: []
|
39
|
-
|
40
77
|
post_install_message:
|
41
78
|
rdoc_options: []
|
42
|
-
|
43
|
-
require_paths:
|
79
|
+
require_paths:
|
44
80
|
- lib
|
45
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
- 0
|
58
|
-
version: "0"
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ! '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
59
93
|
requirements: []
|
60
|
-
|
61
94
|
rubyforge_project:
|
62
|
-
rubygems_version: 1.
|
95
|
+
rubygems_version: 1.8.24
|
63
96
|
signing_key:
|
64
97
|
specification_version: 3
|
65
98
|
summary: checks urls in docbook ulink tags
|
66
99
|
test_files: []
|
67
|
-
|