nanoc-checking-checks-vnu 1.0.0 → 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad4c0d699cfa5e1136fa03973964622358f460cf079d1a6696e191bea5d37ab2
4
- data.tar.gz: fefd405f6288d68d109e03a4e76e941a01b4bb212c7815523f6c6ecda47a0b91
3
+ metadata.gz: 5945aafcec71b3eae3b4c7a3bd0be035aeabba2ad17d0397309cd1314731aa8e
4
+ data.tar.gz: 8448cdb649c767482e4ed4c885c51dd892f641463b9f7baa58aa6792414fc7b8
5
5
  SHA512:
6
- metadata.gz: 032f077d4ab1c2946d98c759a9732ff5909d05245bf0508acdd0a9a703e02c08d96b4460d832da8952e96f176c92a728f043348984e1afd98e2f0bec2886e56b
7
- data.tar.gz: 857946058026e6a5862479ec14f6ffbb482add9225b68053d69cccf1ed8fc2fe82b51c327382cc74f3367e320f433f0d78ca54a867ba57d974662c22326f0d57
6
+ metadata.gz: d0897f849e3d59edd64ae978eb179bb385a399acdcbf4710a6090843f1cc3ec0d2f995d2d0d0f521a83af7984ed5b375a94faa9b8e3d02465bc834ca48b9d560
7
+ data.tar.gz: b0298b0f361aa36189ac5d0dd844a9597c72479af60e57c1529ce73e7d3f0789c272dccb07c9585f26faa822e9b38eaa4eed6d36b885e20071c594b68453a3a1
data/README.md CHANGED
@@ -29,15 +29,24 @@ Or install it yourself as:
29
29
  Add this line to a Ruby file inside your site's `lib` directory:
30
30
 
31
31
  ```ruby
32
- require 'nanoc-checking-checks-vnu'
32
+ require 'nanoc/checking/checks/vnu'
33
33
  ```
34
34
 
35
35
  Then execute:
36
36
 
37
37
  $ nanoc check vnu # prefix with `bundle exec` as appropriate
38
38
 
39
- You can automatically this check at deploy time by adding `vnu` to [the
40
- `checking` section of `nanoc.yaml`][nanoc-check-deploy].
39
+ You can automatically run this check at deploy time by adding `vnu` to
40
+ [the `checking` section of `nanoc.yaml`][nanoc-check-deploy].
41
+ By default, CSS and SVG files are validated in addition to HTML files.
42
+ This can be changed by configuring the check in `nanoc.yaml`:
43
+
44
+ ```yaml
45
+ checks:
46
+ vnu:
47
+ also_check_css: no
48
+ also_check_svg: no
49
+ ```
41
50
 
42
51
  [nanoc-check-deploy]: https://nanoc.ws/doc/testing/#running-checks-before-deploying
43
52
 
@@ -5,10 +5,16 @@ module Nanoc
5
5
  identifier :vnu
6
6
 
7
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]
8
+ args = ['vnu', '--skip-non-html', '--errors-only', '--format', 'json']
9
+ vnu_config = @config.fetch(:checks, {}).fetch(:vnu, {})
10
+ if vnu_config.fetch(:also_check_css, true)
11
+ args << '--also-check-css'
12
+ end
13
+ if vnu_config.fetch(:also_check_svg, true)
14
+ args << '--also-check-svg'
15
+ end
16
+ args << @config.output_dir
17
+
12
18
  output = JSON.load(IO.popen(args, err: [:child, :out], &:read))
13
19
  output['messages'].each do |m|
14
20
  add_issue(m['message'], subject: m['url'].sub(/^file:/, ''))
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "nanoc-checking-checks-vnu"
3
- spec.version = "1.0.0"
3
+ spec.version = "1.1.0"
4
4
  spec.authors = ["Roger Que"]
5
5
  spec.email = ["git@alerante.net"]
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-checking-checks-vnu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Que
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nanoc-checking
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  requirements: []
62
- rubygems_version: 3.1.2
62
+ rubygems_version: 3.4.6
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: A nanoc check for validating HTML, CSS, and SVG files with the v.Nu validator.