nanoc 4.12.19 → 4.12.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18feaf5a34e4f6b1568cc865aa2aeeb21fc5f38047e963f415677a39cbfa92a0
4
- data.tar.gz: 79196f822d81016f5572f41a0688c3095ccdb1aa207a4d3ead4fe1116ad6630a
3
+ metadata.gz: a4f4f1156179e5c1fc63d9d2a7eb8539d41f3f2141fa1109027935cd7191f6e6
4
+ data.tar.gz: e80a883c6c173dd2c767539ecbf060b30f0a41e23dfaaa028cb00037c80819a7
5
5
  SHA512:
6
- metadata.gz: 6bd6fe3d69e578df252e4d72d5640de0c4ea3c6a769830e05438a3f25b695110e43c356dba33d86416ff77611be21e570b09c5931e2eb2c83c8ef1b554d769f6
7
- data.tar.gz: 3544b32362e9b3aaec9dffcb045f3c25812eca46dbb211e596e257ac37249aebc78a3fe06231bb21a98443c02c49fc4e190aa0d2c8910072f37e5daebb31f5bc
6
+ metadata.gz: 54f4bc19b599bb1223fedce0c505896c6554596ee8a110f1f171b9cddc6faa1ca5a72f675e8a404483c250e897da0ca85347280c96f48fe3c13cb1e093bd3ddb
7
+ data.tar.gz: 4605c0f855c3cdb3b1d352089087eb6a1ddbfc333fe3b11e77b7ddb3d6a8313f92cf8c20c93d22ea23887af8afa9b71d743c1bfe8852dd6f394a17b933e80fc9
data/NEWS.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.12.20 (2024-03-15)
4
+
5
+ Enhancements:
6
+
7
+ - Add base64 as a gem dependency (#1681)
8
+ - Specify pry as one of nanoc-cli's runtime dependencies (#1679) [Junichi Sato]
9
+ - Add `org` extension (for Org Mode) to list of text file extensions (#1688) [Antar]
10
+
3
11
  ## 4.12.19 (2023-12-08)
4
12
 
5
13
  Fixes:
@@ -1341,11 +1349,11 @@ Enhancements:
1341
1349
 
1342
1350
  - Added several convenience methods to view classes (#570, #572)
1343
1351
 
1344
- See the [nanoc 4 upgrade guide](https://nanoc.ws/doc/nanoc-4-upgrade-guide/) for details.
1352
+ See the [nanoc 4 upgrade guide](https://nanoc.app/doc/nanoc-4-upgrade-guide/) for details.
1345
1353
 
1346
1354
  ## 4.0.0a1 (2015-05-09)
1347
1355
 
1348
- This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](https://nanoc.ws/doc/nanoc-4-upgrade-guide/).
1356
+ This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](https://nanoc.app/doc/nanoc-4-upgrade-guide/).
1349
1357
 
1350
1358
  This release provides no new features, but streamlines the API and functionality, in order to easen future development, both for features and for optimisations.
1351
1359
 
@@ -2058,7 +2066,7 @@ Removed:
2058
2066
  ## 2.1 (2008-08-17)
2059
2067
 
2060
2068
  This is only a short summary of all changes in 2.1. For details, see the
2061
- [nanoc web site](https://nanoc.ws/). Especially the blog and the
2069
+ [nanoc web site](https://nanoc.app/). Especially the blog and the
2062
2070
  updated manual will be useful.
2063
2071
 
2064
2072
  New:
data/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  # Nanoc
4
4
 
5
- Nanoc is a flexible static-site generator written in Ruby. See the [Nanoc web site](https://nanoc.ws) for more information.
5
+ Nanoc is a flexible static-site generator written in Ruby. See the [Nanoc web site](https://nanoc.app) for more information.
data/lib/nanoc/extra.rb CHANGED
@@ -15,7 +15,6 @@ module Nanoc::Extra
15
15
  Pruner = Nanoc::Core::Pruner
16
16
  end
17
17
 
18
- require_relative 'extra/link_collector'
19
18
  require_relative 'extra/jruby_nokogiri_warner'
20
19
  require_relative 'extra/srcset_parser'
21
20
  require_relative 'extra/core_ext'
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#blogging
4
+ # @see https://nanoc.app/doc/reference/helpers/#blogging
5
5
  module Blogging
6
6
  # @return [Array]
7
7
  def articles
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#breadcrumbs
4
+ # @see https://nanoc.app/doc/reference/helpers/#breadcrumbs
5
5
  module Breadcrumbs
6
6
  class AmbiguousAncestorError < ::Nanoc::Core::Error
7
7
  def initialize(pattern, items)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#capturing
4
+ # @see https://nanoc.app/doc/reference/helpers/#capturing
5
5
  module Capturing
6
6
  # @api private
7
7
  class SetContent
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#childparent
4
+ # @see https://nanoc.app/doc/reference/helpers/#childparent
5
5
  module ChildParent
6
6
  def parent_of(item)
7
7
  if item.identifier.legacy?
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#filtering
4
+ # @see https://nanoc.app/doc/reference/helpers/#filtering
5
5
  module Filtering
6
6
  require 'nanoc/helpers/capturing'
7
7
  include Nanoc::Helpers::Capturing
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#filtering
4
+ # @see https://nanoc.app/doc/reference/helpers/#filtering
5
5
  module HTMLEscape
6
6
  require 'nanoc/helpers/capturing'
7
7
  include Nanoc::Helpers::Capturing
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#linkto
4
+ # @see https://nanoc.app/doc/reference/helpers/#linkto
5
5
  module LinkTo
6
6
  require 'nanoc/helpers/html_escape'
7
7
  include Nanoc::Helpers::HTMLEscape
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#rendering
4
+ # @see https://nanoc.app/doc/reference/helpers/#rendering
5
5
  module Rendering
6
6
  include Nanoc::Helpers::Capturing
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#tagging
4
+ # @see https://nanoc.app/doc/reference/helpers/#tagging
5
5
  module Tagging
6
6
  require 'nanoc/helpers/html_escape'
7
7
  include Nanoc::Helpers::HTMLEscape
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#text
4
+ # @see https://nanoc.app/doc/reference/helpers/#text
5
5
  module Text
6
6
  # @param [String] string
7
7
  # @param [Number] length
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nanoc::Helpers
4
- # @see https://nanoc.ws/doc/reference/helpers/#xmlsitemap
4
+ # @see https://nanoc.app/doc/reference/helpers/#xmlsitemap
5
5
  module XMLSitemap
6
6
  # @option params [Array] :items
7
7
  # @option params [Proc] :rep_select
data/lib/nanoc/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nanoc
4
4
  # The current Nanoc version.
5
- VERSION = '4.12.19'
5
+ VERSION = '4.12.20'
6
6
  end
data/lib/nanoc.rb CHANGED
@@ -11,7 +11,6 @@ module Nanoc
11
11
  end
12
12
 
13
13
  # Load general requirements
14
- require 'base64'
15
14
  require 'cgi'
16
15
  require 'digest'
17
16
  require 'English'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.12.19
4
+ version: 4.12.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-08 00:00:00.000000000 Z
11
+ date: 2024-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -64,28 +64,28 @@ dependencies:
64
64
  requirements:
65
65
  - - '='
66
66
  - !ruby/object:Gem::Version
67
- version: 4.12.19
67
+ version: 4.12.20
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - '='
73
73
  - !ruby/object:Gem::Version
74
- version: 4.12.19
74
+ version: 4.12.20
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: nanoc-core
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: 4.12.19
81
+ version: 4.12.20
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: 4.12.19
88
+ version: 4.12.20
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: nanoc-deploying
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -166,7 +166,6 @@ files:
166
166
  - lib/nanoc/extra/core_ext.rb
167
167
  - lib/nanoc/extra/core_ext/time.rb
168
168
  - lib/nanoc/extra/jruby_nokogiri_warner.rb
169
- - lib/nanoc/extra/link_collector.rb
170
169
  - lib/nanoc/extra/srcset_parser.rb
171
170
  - lib/nanoc/filters.rb
172
171
  - lib/nanoc/filters/asciidoc.rb
@@ -230,12 +229,12 @@ files:
230
229
  - lib/nanoc/rule_dsl/rules_collection.rb
231
230
  - lib/nanoc/rule_dsl/rules_loader.rb
232
231
  - lib/nanoc/version.rb
233
- homepage: https://nanoc.ws/
232
+ homepage: https://nanoc.app/
234
233
  licenses:
235
234
  - MIT
236
235
  metadata:
237
236
  rubygems_mfa_required: 'true'
238
- source_code_uri: https://github.com/nanoc/nanoc/tree/4.12.19/nanoc
237
+ source_code_uri: https://github.com/nanoc/nanoc/tree/4.12.20/nanoc
239
238
  post_install_message:
240
239
  rdoc_options: []
241
240
  require_paths:
@@ -251,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
250
  - !ruby/object:Gem::Version
252
251
  version: '0'
253
252
  requirements: []
254
- rubygems_version: 3.4.22
253
+ rubygems_version: 3.5.3
255
254
  signing_key:
256
255
  specification_version: 4
257
256
  summary: A static-site generator with a focus on flexibility.
@@ -1,131 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ::Nanoc::Extra
4
- # @api private
5
- class LinkCollector
6
- # HTML5 element attributes
7
- URI_ATTRS = {
8
- 'a' => %i[href ping],
9
- 'area' => %i[href ping],
10
- 'audio' => %i[src],
11
- 'base' => %i[href],
12
- 'blockquote' => %i[cite],
13
- 'form' => %i[action],
14
- 'iframe' => %i[src],
15
- 'img' => %i[src srcset],
16
- 'link' => %i[href],
17
- 'object' => %i[data],
18
- 'script' => %i[src],
19
- 'source' => %i[src srcset],
20
- 'video' => %i[poster src],
21
- }.freeze
22
- # HTML+RDFa global URI attributes
23
- GLOBAL_ATTRS = %i[about resource].freeze
24
-
25
- def initialize(filenames, mode = nil)
26
- Nanoc::Extra::JRubyNokogiriWarner.check_and_warn
27
-
28
- @filenames = filenames
29
- @filter =
30
- case mode
31
- when nil
32
- ->(_h) { true }
33
- when :external
34
- ->(h) { external_href?(h) }
35
- when :internal
36
- ->(h) { internal_href?(h) }
37
- else
38
- raise ArgumentError, 'Expected mode argument to be :internal, :external or nil'
39
- end
40
- end
41
-
42
- def filenames_per_href
43
- grouped_filenames { |filename| hrefs_in_file(filename) }
44
- end
45
-
46
- def filenames_per_resource_uri
47
- grouped_filenames { |filename| resource_uris_in_file(filename) }
48
- end
49
-
50
- def external_href?(href)
51
- return false if internal_href?(href)
52
-
53
- href =~ %r{^(//|[a-z-]+:)}
54
- end
55
-
56
- def internal_href?(href)
57
- return false if href.nil?
58
-
59
- href.start_with?('file:/')
60
- end
61
-
62
- # all links
63
- def hrefs_in_file(filename)
64
- uris_in_file filename, nil
65
- end
66
-
67
- # embedded resources, used by the mixed-content checker
68
- def resource_uris_in_file(filename)
69
- uris_in_file filename, %w[audio base form iframe img link object script source video]
70
- end
71
-
72
- private
73
-
74
- def grouped_filenames
75
- require 'nokogiri'
76
- grouped_filenames = {}
77
- @filenames.each do |filename|
78
- yield(filename).each do |resouce_uri|
79
- grouped_filenames[resouce_uri] ||= Set.new
80
- grouped_filenames[resouce_uri] << filename
81
- end
82
- end
83
- grouped_filenames
84
- end
85
-
86
- def uris_in_file(filename, tag_names)
87
- uris = Set.new
88
- base_uri = URI("file://#{filename}")
89
- doc = Nokogiri::HTML(::File.read(filename))
90
- doc.traverse do |tag|
91
- next unless tag_names.nil? || tag_names.include?(tag.name)
92
-
93
- attrs = []
94
- attrs += URI_ATTRS[tag.name] unless URI_ATTRS[tag.name].nil?
95
- attrs += GLOBAL_ATTRS if tag_names.nil?
96
- next if attrs.nil?
97
-
98
- attrs.each do |attr_name|
99
- next if tag[attr_name].nil?
100
-
101
- if attr_name == :srcset
102
- uris = uris.merge(tag[attr_name].split(',').map { |v| v.strip.split[0].strip }.compact)
103
- elsif %i[about ping resource].include?(attr_name)
104
- uris = uris.merge(tag[attr_name].split.map(&:strip).compact)
105
- else
106
- uris << tag[attr_name.to_s]
107
- end
108
- end
109
- end
110
-
111
- # Strip fragment
112
- uris.map! { |uri| uri.gsub(/#.*$/, '') }
113
-
114
- # Resolve paths relative to the filename, return invalid URIs as-is
115
- uris.map! do |uri|
116
- if uri.start_with?('//')
117
- # Don’t modify protocol-relative URLs. They’re absolute!
118
- uri
119
- else
120
- begin
121
- URI.join(base_uri, uri).to_s
122
- rescue
123
- uri
124
- end
125
- end
126
- end
127
-
128
- uris.select(&@filter)
129
- end
130
- end
131
- end