nanoc-tidy.rb 0.2.0 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82bb7fbdab23c96d587126887440424d6952c7e083fafb48385d1daad72459ab
4
- data.tar.gz: 72960c21694c0a722fac6c6a3c09b2b78250fc3033dac85b6c11ed838f001726
3
+ metadata.gz: 3dcf61d9f8cd7befb47dcf0f0f15d3e31b5b6dfa849f19d255c10e0ce0083fbc
4
+ data.tar.gz: eca622d7fe8ac8dd883de3393225420efb9ca9f0ab0c5d39c1b8a3cab41ede3c
5
5
  SHA512:
6
- metadata.gz: 48d64352f129d1593b0e6f787a53a15cf3dc72b1700d7dc82d8c60aaf6b8895345f54f612305d67f1868a95adfd3cdecd544343b91844adc1bab47dbdd4c0d59
7
- data.tar.gz: feb6516507e522d664dfb9194efb2897f0bdea0bf9515276e3be84ee27ab493f4281d16c723048c88e9033d203f532af449bae803912bdc14b6f31c6e716b2ea
6
+ metadata.gz: 43cd2a510955f332b8aef7d06c884eeb8e958cfa9789a5f96880b9fe5ab744297d1c289b3b8fdcc027c5d8fc60df0a6ea9f03648d66fab47f068e037ec1bbe4d
7
+ data.tar.gz: 3c03bef0d16ff6762522b00f9fb84763fe7cba1ea5bdc1496e3335d874aa2f0bc92a6ff31823f00649877855c567cf7af834db55c707196da3651b5d85458507
data/README.md CHANGED
@@ -21,6 +21,7 @@ being used:
21
21
  # Rules
22
22
  require "nanoc-tidy"
23
23
  compile "/index.html.erb" do
24
+ layout("/default.*")
24
25
  filter(:erb)
25
26
  filter(:tidy)
26
27
  write("/index.html")
@@ -36,6 +37,7 @@ The following example forwards command-line options to
36
37
  # Rules
37
38
  require "nanoc-tidy"
38
39
  compile "/index.html.erb" do
40
+ layout("/default.*")
39
41
  filter(:erb)
40
42
  filter(:tidy, "-upper" => true)
41
43
  write("/index.html")
@@ -55,12 +57,6 @@ and
55
57
  [GitLab](https://gitlab.com/0x1eef/nanoc-tidy.rb)
56
58
  are available as sources.
57
59
 
58
- **Gemfile**
59
-
60
- ```ruby
61
- gem "nanoc-tidy.rb", github: "0x1eef/nanoc-tidy.rb"
62
- ```
63
-
64
60
  ## License
65
61
 
66
62
  [BSD Zero Clause](https://choosealicense.com/licenses/0bsd/).
@@ -24,7 +24,7 @@ class Nanoc::Tidy::Filter < Nanoc::Filter
24
24
  private
25
25
 
26
26
  def tidy(file, options)
27
- system "tidy", "-modify", "-quiet", *tidy_args(options), file.path
27
+ system tidy_exe, "-modify", "-quiet", *tidy_args(options), file.path
28
28
  if $?.success?
29
29
  File.read(file.path).tap { file.tap(&:unlink).close }
30
30
  else
@@ -42,6 +42,14 @@ class Nanoc::Tidy::Filter < Nanoc::Filter
42
42
  end
43
43
  end
44
44
 
45
+ def tidy_exe
46
+ case
47
+ when system("which tidy > /dev/null 2>&1") then "tidy"
48
+ when system("which tidy5 > /dev/null 2>&1") then "tidy5"
49
+ else raise Error, "unable to find a tidy executable on $PATH"
50
+ end
51
+ end
52
+
45
53
  def temporary_file_for(content)
46
54
  dir = File.join(Dir.getwd, "tmp", "nanoc-tidy.rb")
47
55
  mkdir_p(dir) unless Dir.exist?(dir)
@@ -1,5 +1,5 @@
1
1
  module Nanoc
2
2
  module Tidy
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.homepage = "https://github.com/0x1eef/nanoc-tidy.rb#readme"
9
9
  gem.version = Nanoc::Tidy::VERSION
10
10
  gem.licenses = ["0BSD"]
11
- gem.files = `git ls-files`.split($/)
11
+ gem.files = `git ls-files`.split($/).reject { _1.start_with?(".") }
12
12
  gem.require_paths = ["lib"]
13
13
  gem.summary = "nanoc-tidy.rb integrates tidy-html5 into nanoc."
14
14
  gem.description = gem.summary
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-tidy.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - '0x1eef'
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-13 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yard
@@ -115,10 +115,6 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".bundle/config"
119
- - ".github/workflows/tests.yml"
120
- - ".gitignore"
121
- - ".projectile"
122
118
  - Gemfile
123
119
  - LICENSE
124
120
  - README.md
@@ -152,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
148
  - !ruby/object:Gem::Version
153
149
  version: '0'
154
150
  requirements: []
155
- rubygems_version: 3.4.10
151
+ rubygems_version: 3.5.3
156
152
  signing_key:
157
153
  specification_version: 4
158
154
  summary: nanoc-tidy.rb integrates tidy-html5 into nanoc.
data/.bundle/config DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- BUNDLE_PATH: ".gems"
@@ -1,24 +0,0 @@
1
- name: nanoc-tidy.rb
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- pull_request:
7
- branches: [ main ]
8
-
9
- jobs:
10
- specs:
11
- strategy:
12
- fail-fast: false
13
- matrix:
14
- os: [ubuntu-latest]
15
- ruby: [3.1, 3.2]
16
- runs-on: ${{ matrix.os }}
17
- steps:
18
- - uses: actions/checkout@v2
19
- - uses: ruby/setup-ruby@v1
20
- with:
21
- ruby-version: ${{ matrix.ruby }}
22
- - run: sudo apt-get install tidy
23
- - run: bundle install
24
- - run: rake
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- .gems/
2
- *.lock
data/.projectile DELETED
@@ -1,6 +0,0 @@
1
- -.gems/
2
- +.github/
3
- +lib/
4
- +test/
5
- +.bundle/
6
- +.