html-proofer 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/htmlproof +29 -27
  3. data/html-proofer.gemspec +3 -3
  4. metadata +6 -6
  5. data/what.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c8c2059f145655213fdcb6aab0c6591984de648
4
- data.tar.gz: b681c12b176df979560d243f995184451111fdb0
3
+ metadata.gz: 60d6ccc86ff946fdba14c32459fbdc1280c8a282
4
+ data.tar.gz: d966ae4a3e0ac7c1b85c90e14e4943f9e99c18c4
5
5
  SHA512:
6
- metadata.gz: 8b447c12a33e3edb865a8feed07c68026318ffb6feccb5c0b35c2c2e84470623b1385987237451214c3d0617c24475959365e06bb9bc9faf6b8c04793edbc7d7
7
- data.tar.gz: e0811f6c0635b73f571c080408fe4fee9a75cb71f68c9153979d55e1b40a3e4747b100cb0606786dbf6512ea674b70eaf8d66292921c269a1b5c85035f1eca75
6
+ metadata.gz: 158b9f28cab7fd1b50998b03ea50b03943ff188b7eeae61cd6838af462344e51e79bd7f9e9a01a873fd9ccc43b608a2af528441af4fab254aa2a7d5c0696daa0
7
+ data.tar.gz: 58777f1b4188d2541de5a6e9db478b992e54efc222647a38154ad61f063b93a9abd32dd9976ec241c55993ecec4529a7441e3f6986ec116dd97d0fb44510ca7a
data/bin/htmlproof CHANGED
@@ -1,38 +1,40 @@
1
1
  #!/usr/bin/env ruby
2
2
  STDOUT.sync = true
3
3
 
4
- require './lib/html/proofer'
4
+ $:.unshift File.join(File.dirname(__FILE__), *%w{ .. lib })
5
+
6
+ require 'html/proofer'
5
7
  require 'mercenary'
8
+ require "rubygems"
6
9
 
7
10
  Mercenary.program(:htmlproof) do |p|
8
- # p.version HTML::Proofer::VERSION
11
+ p.version Gem::Specification::load("html-proofer.gemspec").version
9
12
  p.description "Test your rendered HTML files to make sure they're accurate."
10
- p.syntax 'htmlproof run PATH [options]'
11
-
12
- p.command(:run) do |c|
13
- c.syntax "htmlproof run PATH"
14
- c.description "Runs the HTML-Proofer suite on the files in PATH"
15
-
16
- c.option 'ext', '--ext EXT', String, 'The extension of your HTML files (default: `.html`)'
17
- c.option 'swap', '--swap regex:string,[regex:string,...]', Array, 'Array containing key-value pairs of `RegExp:String`. It transforms links that match `RegExp` into `String`'
18
- c.option 'ignore', '--ignore link1,[link2,...]', Array, 'Array of Strings containing `href`s that are safe to ignore (default: `mailto`)'
19
-
20
- c.action do |args, opts|
21
- raise "`run` requires a PATH indicating a directory of files to check" if args.empty?
22
- options = {}
23
- options[:ext] = opts["ext"] unless opts["ext"].nil?
24
- unless opts["swap"].nil?
25
- options[:href_swap] = {}
26
- opts["swap"].each do |s|
27
- pair = s.split(":")
28
- options[:href_swap][%r{#{pair[0]}}] = pair[1]
29
- end
30
- end
31
- options[:href_ignore] = opts["ignore"] unless opts["ignore"].nil?
13
+ p.syntax 'htmlproof PATH [options]'
14
+
15
+ p.description "Runs the HTML-Proofer suite on the files in PATH"
16
+
17
+ p.option 'ext', '--ext EXT', 'The extension of your HTML files (default: `.html`)'
18
+ p.option 'swap', '--swap regex:string,[regex:string,...]', 'Array containing key-value pairs of `RegExp:String`. It transforms links that match `RegExp` into `String`'
19
+ p.option 'ignore', '--ignore link1,[link2,...]', 'Array of Strings containing `href`s that are safe to ignore (default: `mailto`)'
20
+ p.option 'disable_external', '--disable_external', 'Disables the external link checker (default: `false`)'
32
21
 
33
- HTML::Proofer.new(args[0], options).run
22
+ p.action do |args, opts|
23
+ args = ["."] if args.empty?
24
+ path = File.expand_path(args.join(" "), Dir.pwd)
25
+
26
+ options = {}
27
+ options[:ext] = opts["ext"] unless opts["ext"].nil?
28
+ unless opts["swap"].nil?
29
+ options[:href_swap] = {}
30
+ opts["swap"].each do |s|
31
+ pair = s.split(":")
32
+ options[:href_swap][%r{#{pair[0]}}] = pair[1]
33
+ end
34
34
  end
35
- end
35
+ options[:href_ignore] = opts["ignore"] unless opts["ignore"].nil?
36
+ options[:disable_external] = opts["disable_external"] unless opts["disable_external"].nil?
36
37
 
37
- p.default_command(:run)
38
+ HTML::Proofer.new(path, options).run
39
+ end
38
40
  end
data/html-proofer.gemspec CHANGED
@@ -3,19 +3,19 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "html-proofer"
6
- gem.version = "0.6.4"
6
+ gem.version = "0.6.5"
7
7
  gem.authors = ["Garen Torikian"]
8
8
  gem.email = ["gjtorikian@gmail.com"]
9
9
  gem.description = %q{Test your rendered HTML files to make sure they're accurate.}
10
10
  gem.summary = %q{A set of tests to validate your HTML output. These tests check if your image references are legitimate, if they have alt tags, if your internal links are working, and so on. It's intended to be an all-in-one checker for your documentation output.}
11
11
  gem.homepage = "https://github.com/gjtorikian/html-proofer"
12
12
  gem.license = "MIT"
13
- gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) }
13
+ gem.executables = ["htmlproof"]
14
14
  gem.files = `git ls-files`.split($/)
15
15
  gem.test_files = gem.files.grep(%r{^(spec)/})
16
16
  gem.require_paths = ["lib"]
17
17
 
18
- gem.add_dependency "mercenary", "~> 0.2.0"
18
+ gem.add_dependency "mercenary", "~> 0.3.2"
19
19
  gem.add_dependency "nokogiri", "~> 1.6.0"
20
20
  gem.add_dependency "colored", "~> 1.2"
21
21
  gem.add_dependency "typhoeus", "~> 0.6.7"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-06 00:00:00.000000000 Z
11
+ date: 2014-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: 0.3.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0
26
+ version: 0.3.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -111,7 +111,8 @@ dependencies:
111
111
  description: Test your rendered HTML files to make sure they're accurate.
112
112
  email:
113
113
  - gjtorikian@gmail.com
114
- executables: []
114
+ executables:
115
+ - htmlproof
115
116
  extensions: []
116
117
  extra_rdoc_files: []
117
118
  files:
@@ -171,7 +172,6 @@ files:
171
172
  - spec/html/proofer/images_spec.rb
172
173
  - spec/html/proofer/links_spec.rb
173
174
  - spec/spec_helper.rb
174
- - what.rb
175
175
  homepage: https://github.com/gjtorikian/html-proofer
176
176
  licenses:
177
177
  - MIT
data/what.rb DELETED
File without changes