nanoc-checking-checks-vnu 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ad4c0d699cfa5e1136fa03973964622358f460cf079d1a6696e191bea5d37ab2
4
+ data.tar.gz: fefd405f6288d68d109e03a4e76e941a01b4bb212c7815523f6c6ecda47a0b91
5
+ SHA512:
6
+ metadata.gz: 032f077d4ab1c2946d98c759a9732ff5909d05245bf0508acdd0a9a703e02c08d96b4460d832da8952e96f176c92a728f043348984e1afd98e2f0bec2886e56b
7
+ data.tar.gz: 857946058026e6a5862479ec14f6ffbb482add9225b68053d69cccf1ed8fc2fe82b51c327382cc74f3367e320f433f0d78ca54a867ba57d974662c22326f0d57
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "rake", "~> 12.0"
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Roger Que
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,54 @@
1
+ # Nanoc::Checking::Checks::Vnu
2
+
3
+ A [nanoc check][nanoc-check] that validates HTML, CSS, and SVG output files
4
+ locally with [the Nu Html Checker][vnu] (v.Nu).
5
+
6
+ [nanoc-check]: https://nanoc.ws/doc/testing/
7
+ [vnu]: https://validator.github.io/validator/
8
+
9
+ ## Installation
10
+
11
+ Install v.Nu and place the `vnu` executable on your `PATH`.
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'nanoc-checking-checks-vnu'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle install
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install nanoc-checking-checks-vnu
26
+
27
+ ## Usage
28
+
29
+ Add this line to a Ruby file inside your site's `lib` directory:
30
+
31
+ ```ruby
32
+ require 'nanoc-checking-checks-vnu'
33
+ ```
34
+
35
+ Then execute:
36
+
37
+ $ nanoc check vnu # prefix with `bundle exec` as appropriate
38
+
39
+ You can automatically this check at deploy time by adding `vnu` to [the
40
+ `checking` section of `nanoc.yaml`][nanoc-check-deploy].
41
+
42
+ [nanoc-check-deploy]: https://nanoc.ws/doc/testing/#running-checks-before-deploying
43
+
44
+ ## Contributing
45
+
46
+ Bug reports and pull requests are welcome on GitHub at
47
+ <https://github.com/query/nanoc-checking-checks-vnu>.
48
+
49
+
50
+ ## License
51
+
52
+ The gem is available as open source under the terms of the [MIT License][mit].
53
+
54
+ [mit]: https://opensource.org/licenses/MIT
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,20 @@
1
+ module Nanoc
2
+ module Checking
3
+ module Checks
4
+ class Vnu < ::Nanoc::Checking::Check
5
+ identifier :vnu
6
+
7
+ def run
8
+ args = ['vnu',
9
+ '--skip-non-html', '--also-check-css', '--also-check-svg',
10
+ '--errors-only', '--format', 'json',
11
+ @config.output_dir]
12
+ output = JSON.load(IO.popen(args, err: [:child, :out], &:read))
13
+ output['messages'].each do |m|
14
+ add_issue(m['message'], subject: m['url'].sub(/^file:/, ''))
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "nanoc-checking-checks-vnu"
3
+ spec.version = "1.0.0"
4
+ spec.authors = ["Roger Que"]
5
+ spec.email = ["git@alerante.net"]
6
+
7
+ spec.summary = "A nanoc check for validating HTML, CSS, and SVG " \
8
+ "files with the v.Nu validator."
9
+ spec.homepage = "https://github.com/query/nanoc-checking-checks-vnu"
10
+ spec.license = "MIT"
11
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
12
+
13
+ spec.metadata["homepage_uri"] = spec.homepage
14
+ spec.metadata["source_code_uri"] = spec.homepage
15
+
16
+ spec.add_dependency "nanoc-checking", "~> 1.0.0"
17
+
18
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ end
21
+ spec.bindir = "exe"
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ spec.require_paths = ["lib"]
24
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nanoc-checking-checks-vnu
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Roger Que
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: nanoc-checking
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.0
27
+ description:
28
+ email:
29
+ - git@alerante.net
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".gitignore"
35
+ - Gemfile
36
+ - LICENSE.txt
37
+ - README.md
38
+ - Rakefile
39
+ - lib/nanoc/checking/checks/vnu.rb
40
+ - nanoc-checking-checks-vnu.gemspec
41
+ homepage: https://github.com/query/nanoc-checking-checks-vnu
42
+ licenses:
43
+ - MIT
44
+ metadata:
45
+ homepage_uri: https://github.com/query/nanoc-checking-checks-vnu
46
+ source_code_uri: https://github.com/query/nanoc-checking-checks-vnu
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 2.3.0
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubygems_version: 3.1.2
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: A nanoc check for validating HTML, CSS, and SVG files with the v.Nu validator.
66
+ test_files: []