nanoc 4.12.13 → 4.12.15

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: c54cc9af24e7f4350afe25d5f8b758d1730185996281473ed0191773237370bf
4
- data.tar.gz: 58c7f45196d412cd2f33ee6b08b7a81f654c01d62b9f6c97281f9b2e14666b4e
3
+ metadata.gz: 4262a2b944e9cb6d080f4dba2a5b81cb260e8d81b5d59bacb4c92fc4fa1bb93f
4
+ data.tar.gz: 07f7c9c67377c86d446f677eca34d1d18ccedf334f701f01d987dd12eddabae7
5
5
  SHA512:
6
- metadata.gz: 57071824176e0733290e8966ffd0b6d64f91d0f68d23f4781ccdcb05c27f1a27fe067f56ea29630a928c443b2aaa6e4eabcf84060a4df7afd8748212926d11c4
7
- data.tar.gz: 07c696a63925bddcbed3461ea201fd82351b9481b697eba2f17f2a92fd42494d13f32ce309857bf3c295816a04990657fb98502adbfe5792b343bb6c3419563e
6
+ metadata.gz: f9e5f15259bbc612cc83d0060c1fab161bac69b86c4c4f14bcf4e0458f1d638091c5aff9baa3d02566aff46c7991c67043bf8c8bed35d67871220a135d439ad5
7
+ data.tar.gz: b0b3bc7f3b5c72006a1f5cd8d7cf3b55ff34061b2900572c7388f20a1f3019144dd1870eb1f3ec5ceff2979f46be30c2c8ec3a4b3451f1cafa9cb9a497cc9c64
data/NEWS.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.12.15 (2023-02-06)
4
+
5
+ Fixes:
6
+
7
+ - Fixed an issue which made items always be considered outdated in sites with data sources with a custom `items_root` defined (#1640, #1644)
8
+
9
+ ## 4.12.14 (2022-12-03)
10
+
11
+ Fixes:
12
+
13
+ - Fixed an issue which would cause `Invalid argument @ io_write` on larger sites (#1636)
14
+
15
+ Enhancements:
16
+
17
+ - Made Nanoc store temporary data (in `tmp/nanoc/`) in compressed form (#1637)
18
+
3
19
  ## 4.12.13 (2022-11-30)
4
20
 
5
21
  Fixes:
@@ -67,7 +67,7 @@ class Nanoc::DataSources::Filesystem < Nanoc::DataSource
67
67
  fn
68
68
  else
69
69
  all_files_in(absolute_target, extra_files, recursion_limit - 1).map do |sfn|
70
- fn + sfn[absolute_target.size..-1]
70
+ fn + sfn[absolute_target.size..]
71
71
  end
72
72
  end
73
73
  end
@@ -151,7 +151,7 @@ module Nanoc::DataSources
151
151
  end
152
152
 
153
153
  def read_proto_document(content_filename, meta_filename, klass)
154
- is_binary = content_filename && !@site_config[:text_extensions].include?(File.extname(content_filename)[1..-1])
154
+ is_binary = content_filename && !@site_config[:text_extensions].include?(File.extname(content_filename)[1..])
155
155
 
156
156
  if is_binary && klass == Nanoc::Core::Item
157
157
  meta = (meta_filename && YAML.safe_load_file(meta_filename, permitted_classes: PERMITTED_YAML_CLASSES)) || {}
@@ -252,7 +252,7 @@ module Nanoc::DataSources
252
252
  filename: content_filename,
253
253
  content_filename: content_filename,
254
254
  meta_filename: meta_filename,
255
- extension: content_filename ? ext_of(content_filename)[1..-1] : nil,
255
+ extension: content_filename ? ext_of(content_filename)[1..] : nil,
256
256
  mtime: mtime_of(content_filename, meta_filename),
257
257
  }
258
258
  end
@@ -263,9 +263,9 @@ module Nanoc::DataSources
263
263
 
264
264
  def identifier_for(content_filename, meta_filename, dir_name)
265
265
  if content_filename
266
- identifier_for_filename(content_filename[dir_name.length..-1])
266
+ identifier_for_filename(content_filename[dir_name.length..])
267
267
  elsif meta_filename
268
- identifier_for_filename(meta_filename[dir_name.length..-1])
268
+ identifier_for_filename(meta_filename[dir_name.length..])
269
269
  else
270
270
  raise 'meta_filename and content_filename are both nil'
271
271
  end
@@ -284,15 +284,11 @@ module Nanoc::DataSources
284
284
  def mtime_of(content_filename, meta_filename)
285
285
  meta_mtime = meta_filename ? File.stat(meta_filename).mtime : nil
286
286
  content_mtime = content_filename ? File.stat(content_filename).mtime : nil
287
- if meta_mtime && content_mtime
288
- meta_mtime > content_mtime ? meta_mtime : content_mtime
289
- elsif meta_mtime
290
- meta_mtime
291
- elsif content_mtime
292
- content_mtime
293
- else
294
- raise 'meta_mtime and content_mtime are both nil'
295
- end
287
+
288
+ mtime = [meta_mtime, content_mtime].compact.max
289
+ raise 'meta_mtime and content_mtime are both nil' unless mtime
290
+
291
+ mtime
296
292
  end
297
293
 
298
294
  # e.g.
@@ -330,7 +326,7 @@ module Nanoc::DataSources
330
326
  all[basename][0] =
331
327
  meta_filenames[0] ? 'yaml' : nil
332
328
  all[basename][1] =
333
- content_filenames.any? ? content_filenames.map { |fn| ext_of(fn)[1..-1] || '' } : [nil]
329
+ content_filenames.any? ? content_filenames.map { |fn| ext_of(fn)[1..] || '' } : [nil]
334
330
  end
335
331
 
336
332
  all
@@ -50,7 +50,7 @@ module ::Nanoc::Extra
50
50
  def external_href?(href)
51
51
  return false if internal_href?(href)
52
52
 
53
- href =~ %r{^(//|[a-z\-]+:)}
53
+ href =~ %r{^(//|[a-z-]+:)}
54
54
  end
55
55
 
56
56
  def internal_href?(href)
@@ -75,7 +75,7 @@ module Nanoc::Helpers
75
75
 
76
76
  compiled_content_store = @config._context.compiled_content_store
77
77
  content = compiled_content_store.get(rep, "__capture_#{@name}".to_sym)
78
- content ? content.string : nil
78
+ content&.string
79
79
  end
80
80
  end
81
81
 
@@ -155,7 +155,7 @@ module Nanoc::Helpers
155
155
  yield
156
156
 
157
157
  # Get new piece of erbout
158
- erbout_addition = erbout[erbout_length..-1]
158
+ erbout_addition = erbout[erbout_length..]
159
159
 
160
160
  # Remove addition
161
161
  erbout[erbout_length..-1] = +''
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.13'
5
+ VERSION = '4.12.15'
6
6
  end
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.13
4
+ version: 4.12.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-30 00:00:00.000000000 Z
11
+ date: 2023-02-06 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.13
67
+ version: 4.12.15
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.13
74
+ version: 4.12.15
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.13
81
+ version: 4.12.15
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.13
88
+ version: 4.12.15
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: nanoc-deploying
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  requirements: []
253
- rubygems_version: 3.4.0.dev
253
+ rubygems_version: 3.4.1
254
254
  signing_key:
255
255
  specification_version: 4
256
256
  summary: A static-site generator with a focus on flexibility.