nanoc 4.12.19 → 4.12.21

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: 28408245b8e292560660f368cba6239710507eeb50cf7875882f678bd63716dc
4
+ data.tar.gz: c8dccabf7933ff565b75bfb1021393bb1c4ba2432ce28c9fdb45b77d5bb8fe81
5
5
  SHA512:
6
- metadata.gz: 6bd6fe3d69e578df252e4d72d5640de0c4ea3c6a769830e05438a3f25b695110e43c356dba33d86416ff77611be21e570b09c5931e2eb2c83c8ef1b554d769f6
7
- data.tar.gz: 3544b32362e9b3aaec9dffcb045f3c25812eca46dbb211e596e257ac37249aebc78a3fe06231bb21a98443c02c49fc4e190aa0d2c8910072f37e5daebb31f5bc
6
+ metadata.gz: 4e5b6933046445063948e9675791aae5f13a84678a0c5a3e22de9a167611e8b2d1cc3c08559d28b460348114b48026027408a10d6320284811bc4c9a72f37730
7
+ data.tar.gz: e5c0dc7d42a8354b9bcad95390ee870bf5d05c6adac69c75f8e153e5e75dfefd518b0f93ad200fb68007f03aa996ce172565f751962f490616d3116112bbe9c8
data/NEWS.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.12.21 (2024-04-27)
4
+
5
+ Fixes:
6
+
7
+ - Fixed a rare “private method printf” error (#1694)
8
+
9
+ Enhancements:
10
+
11
+ - Sped up checksummer and made it more reliable and correct (#1693)
12
+ - Removed Nokogiri warning message on JRuby (#1700)
13
+
14
+ ## 4.12.20 (2024-03-15)
15
+
16
+ Enhancements:
17
+
18
+ - Add base64 as a gem dependency (#1681)
19
+ - Specify pry as one of nanoc-cli's runtime dependencies (#1679) [Junichi Sato]
20
+ - Add `org` extension (for Org Mode) to list of text file extensions (#1688) [Antar]
21
+
3
22
  ## 4.12.19 (2023-12-08)
4
23
 
5
24
  Fixes:
@@ -1341,11 +1360,11 @@ Enhancements:
1341
1360
 
1342
1361
  - Added several convenience methods to view classes (#570, #572)
1343
1362
 
1344
- See the [nanoc 4 upgrade guide](https://nanoc.ws/doc/nanoc-4-upgrade-guide/) for details.
1363
+ See the [nanoc 4 upgrade guide](https://nanoc.app/doc/nanoc-4-upgrade-guide/) for details.
1345
1364
 
1346
1365
  ## 4.0.0a1 (2015-05-09)
1347
1366
 
1348
- This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](https://nanoc.ws/doc/nanoc-4-upgrade-guide/).
1367
+ This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](https://nanoc.app/doc/nanoc-4-upgrade-guide/).
1349
1368
 
1350
1369
  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
1370
 
@@ -2058,7 +2077,7 @@ Removed:
2058
2077
  ## 2.1 (2008-08-17)
2059
2078
 
2060
2079
  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
2080
+ [nanoc web site](https://nanoc.app/). Especially the blog and the
2062
2081
  updated manual will be useful.
2063
2082
 
2064
2083
  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,5 @@ module Nanoc::Extra
15
15
  Pruner = Nanoc::Core::Pruner
16
16
  end
17
17
 
18
- require_relative 'extra/link_collector'
19
- require_relative 'extra/jruby_nokogiri_warner'
20
18
  require_relative 'extra/srcset_parser'
21
19
  require_relative 'extra/core_ext'
@@ -12,8 +12,6 @@ module Nanoc::Filters
12
12
  ExtractedLanguage = Struct.new(:language, :from_class)
13
13
 
14
14
  def run(content, params = {})
15
- Nanoc::Extra::JRubyNokogiriWarner.check_and_warn
16
-
17
15
  @colorizers = colorizers_from_params(params)
18
16
 
19
17
  syntax = params.fetch(:syntax, :html)
@@ -45,8 +45,6 @@ module Nanoc::Filters
45
45
  #
46
46
  # @return [String] The filtered content
47
47
  def run(content, params = {})
48
- Nanoc::Extra::JRubyNokogiriWarner.check_and_warn
49
-
50
48
  # Set assigns so helper function can be used
51
49
  @item_rep = assigns[:item_rep] if @item_rep.nil?
52
50
 
@@ -36,8 +36,6 @@ module Nanoc::Filters
36
36
  #
37
37
  # @return [String] The transformed content
38
38
  def run(_content, params = {})
39
- Nanoc::Extra::JRubyNokogiriWarner.check_and_warn
40
-
41
39
  if assigns[:layout].nil?
42
40
  raise 'The XSL filter can only be run as a layout'
43
41
  end
@@ -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.21'
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.21
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-04-27 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.21
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.21
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.21
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.21
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: nanoc-deploying
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -165,8 +165,6 @@ files:
165
165
  - lib/nanoc/extra.rb
166
166
  - lib/nanoc/extra/core_ext.rb
167
167
  - lib/nanoc/extra/core_ext/time.rb
168
- - lib/nanoc/extra/jruby_nokogiri_warner.rb
169
- - lib/nanoc/extra/link_collector.rb
170
168
  - lib/nanoc/extra/srcset_parser.rb
171
169
  - lib/nanoc/filters.rb
172
170
  - lib/nanoc/filters/asciidoc.rb
@@ -230,12 +228,12 @@ files:
230
228
  - lib/nanoc/rule_dsl/rules_collection.rb
231
229
  - lib/nanoc/rule_dsl/rules_loader.rb
232
230
  - lib/nanoc/version.rb
233
- homepage: https://nanoc.ws/
231
+ homepage: https://nanoc.app/
234
232
  licenses:
235
233
  - MIT
236
234
  metadata:
237
235
  rubygems_mfa_required: 'true'
238
- source_code_uri: https://github.com/nanoc/nanoc/tree/4.12.19/nanoc
236
+ source_code_uri: https://github.com/nanoc/nanoc/tree/4.12.21/nanoc
239
237
  post_install_message:
240
238
  rdoc_options: []
241
239
  require_paths:
@@ -251,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
249
  - !ruby/object:Gem::Version
252
250
  version: '0'
253
251
  requirements: []
254
- rubygems_version: 3.4.22
252
+ rubygems_version: 3.5.9
255
253
  signing_key:
256
254
  specification_version: 4
257
255
  summary: A static-site generator with a focus on flexibility.
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Nanoc::Extra
4
- # @api private
5
- class JRubyNokogiriWarner
6
- include Singleton
7
-
8
- TEXT = <<~EOS
9
- --------------------------------------------------------------------------------
10
- Note:
11
-
12
- The behavior of Pure Java Nokogiri differs from the Nokogiri used on the
13
- standard Ruby interpreter (MRI) due to differences in underlying libraries.
14
-
15
- These sometimes problematic behavioral differences can cause Nanoc filters not
16
- to function properly, if at all. If you need reliable (X)HTML and XML handling
17
- functionality, consider not using Nokogiri on JRuby for the time being.
18
-
19
- These issues are being worked on both from the Nokogiri and the Nanoc side. Keep
20
- your Nokogiri and Nanoc versions up to date!
21
-
22
- For details, see https://github.com/nanoc/nanoc/pull/422.
23
- --------------------------------------------------------------------------------
24
- EOS
25
-
26
- def self.check_and_warn
27
- instance.check_and_warn
28
- end
29
-
30
- def initialize
31
- @warned = false
32
- end
33
-
34
- def check_and_warn
35
- return unless defined?(RUBY_ENGINE)
36
- return if RUBY_ENGINE != 'jruby'
37
- return if @warned
38
-
39
- $stderr.puts TEXT
40
- @warned = true
41
- end
42
- end
43
- end
@@ -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