nanoc-core 4.13.3 → 4.13.5

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: 7e6c97176b06fc6e36cbe73c77589ec6c745b053b40616da81f36b639869d0f6
4
- data.tar.gz: 407d91dcc36e7435debe7bfd52356cb88b09f5cf23c8d4b539b5497432cbba83
3
+ metadata.gz: 9a6e74deb4968f4bad8e83ccbd91797be60fac35b5ad4b08687b24751bd880fb
4
+ data.tar.gz: fd3feca15b92a45617b0dc989f56965822081d83af94cb1d168912c29fd84135
5
5
  SHA512:
6
- metadata.gz: 86b66a9cd073606a2a001f1e0ae2ef6f8ba1ece1756791eebf1a609d723714552e759319b84bd34570b63bf6575c9116cf4adc932a8ba230e44a9c4732a3bdb8
7
- data.tar.gz: 14c58ee6fa75b9e1a1101bcad88f261334f6e1eda10bddf423a8d9769b4f27795e683c3a5a614f19a30db37bc6b9d89b69940079371682777ad0d59b3d28d167
6
+ metadata.gz: c97de8904374f0620b01848e71e3de9fd753d507aa1ccf1804e94e9eafdcbe2459f318a6646e41a3b18ca6146c78b84271785de65534ca8e729fead59294afcf
7
+ data.tar.gz: d43e488b4139003a08cfe726e4a8c3ef2a588d63b031be816a924623a68f3b37b083ad5e28f5bffeb2bc23bd713d6f4194fe74d72fd534268ccf57b541dc723e
@@ -41,7 +41,7 @@ module Nanoc
41
41
  end
42
42
 
43
43
  def outdated?(rep)
44
- if @outdatedness_store.include?(rep)
44
+ if @outdatedness_store.include?(rep) # rubocop:disable Style/RedundantCondition
45
45
  # We determined previously that this rep is outdated.
46
46
  true
47
47
  else
@@ -106,6 +106,9 @@
106
106
  "type": "object",
107
107
  "additionalProperties": false,
108
108
  "properties": {
109
+ "user_agent" : {
110
+ "type": "string"
111
+ },
109
112
  "exclude": {
110
113
  "type": "array",
111
114
  "items": {
@@ -44,28 +44,10 @@ module Nanoc
44
44
 
45
45
  contract C_ARGS => C::Any
46
46
  def initialize(raw_content: false, attributes: false, compiled_content: false, path: false)
47
+ @raw_content = raw_content
48
+ @attributes = attributes
47
49
  @compiled_content = compiled_content
48
50
  @path = path
49
-
50
- @attributes =
51
- case attributes
52
- when Set
53
- attributes
54
- when Array
55
- Set.new(attributes)
56
- else
57
- attributes
58
- end
59
-
60
- @raw_content =
61
- case raw_content
62
- when Set
63
- raw_content
64
- when Array
65
- Set.new(raw_content)
66
- else
67
- raw_content
68
- end
69
51
  end
70
52
 
71
53
  contract C::None => String
@@ -77,7 +59,7 @@ module Nanoc
77
59
  s << (compiled_content? ? 'c' : '_')
78
60
  s << (path? ? 'p' : '_')
79
61
 
80
- if @raw_content.is_a?(Set)
62
+ if @raw_content.is_a?(Set) || @raw_content.is_a?(Array)
81
63
  @raw_content.each do |elem|
82
64
  s << '; raw_content('
83
65
  s << elem.inspect
@@ -85,7 +67,7 @@ module Nanoc
85
67
  end
86
68
  end
87
69
 
88
- if @attributes.is_a?(Set)
70
+ if @attributes.is_a?(Set) || @attributes.is_a?(Array)
89
71
  @attributes.each do |elem|
90
72
  s << '; attr('
91
73
  s << elem.inspect
@@ -110,7 +92,7 @@ module Nanoc
110
92
  contract C::None => C::Bool
111
93
  def raw_content?
112
94
  case @raw_content
113
- when Set
95
+ when Array, Set
114
96
  !@raw_content.empty?
115
97
  else
116
98
  @raw_content
@@ -120,7 +102,7 @@ module Nanoc
120
102
  contract C::None => C::Bool
121
103
  def attributes?
122
104
  case @attributes
123
- when Set
105
+ when Array, Set
124
106
  !@attributes.empty?
125
107
  else
126
108
  @attributes
@@ -168,7 +150,7 @@ module Nanoc
168
150
  when false
169
151
  own
170
152
  else
171
- own + other
153
+ Set.new(own + other)
172
154
  end
173
155
  end
174
156
  end
@@ -146,10 +146,10 @@ module Nanoc
146
146
  # Returns the required libraries for this filter.
147
147
  # @return [Enumerable<String>] This filter’s list of library names that are required
148
148
  def requires(*requires)
149
- if requires.any?
150
- @requires = requires
151
- else
149
+ if requires.empty?
152
150
  @requires || []
151
+ else
152
+ @requires = requires
153
153
  end
154
154
  end
155
155
 
@@ -45,7 +45,7 @@ module Nanoc
45
45
  contract C_OBJ => C::IterOf[Reasons::Generic]
46
46
  def outdatedness_reasons_for(obj)
47
47
  basic_reasons = basic_outdatedness_statuses.fetch(obj).reasons
48
- if basic_reasons.any?
48
+ if !basic_reasons.empty?
49
49
  basic_reasons
50
50
  elsif outdated_due_to_dependencies?(obj)
51
51
  [Reasons::DependenciesOutdated]
@@ -134,7 +134,7 @@ module Nanoc
134
134
 
135
135
  def attributes_unaffected?(status, dependency)
136
136
  reason = status.reasons.find { |r| r.is_a?(Nanoc::Core::OutdatednessReasons::AttributesModified) }
137
- reason && dependency.props.attribute_keys.any? && (dependency.props.attribute_keys & reason.attributes).empty?
137
+ reason && !dependency.props.attribute_keys.empty? && (dependency.props.attribute_keys & reason.attributes).empty?
138
138
  end
139
139
 
140
140
  def raw_content_prop_causes_outdatedness?(objects, raw_content_prop)
@@ -175,7 +175,7 @@ module Nanoc
175
175
  def attributes_prop_causes_outdatedness?(objects, attributes_prop)
176
176
  return false unless attributes_prop
177
177
 
178
- unless attributes_prop.is_a?(Set)
178
+ unless attributes_prop.is_a?(Set) || attributes_prop.is_a?(Array)
179
179
  raise(
180
180
  Nanoc::Core::Errors::InternalInconsistency,
181
181
  'expected attributes_prop to be a Set',
@@ -184,7 +184,7 @@ module Nanoc
184
184
 
185
185
  pairs = attributes_prop.select { |a| a.is_a?(Array) }.to_h
186
186
 
187
- unless pairs.any?
187
+ if pairs.empty?
188
188
  raise(
189
189
  Nanoc::Core::Errors::InternalInconsistency,
190
190
  'expected attributes_prop not to be empty',
@@ -28,7 +28,7 @@ module Nanoc
28
28
  attributes = Set.new(old_checksums.keys) + Set.new(new_checksums.keys)
29
29
  changed_attributes = attributes.reject { |a| old_checksums[a] == new_checksums[a] }
30
30
 
31
- if changed_attributes.any?
31
+ unless changed_attributes.empty?
32
32
  Nanoc::Core::OutdatednessReasons::AttributesModified.new(changed_attributes)
33
33
  end
34
34
  else
@@ -29,6 +29,11 @@ module Nanoc
29
29
  raise NotImplementedError
30
30
  end
31
31
 
32
+ contract C::Any => C::Bool
33
+ def ===(other)
34
+ match?(other)
35
+ end
36
+
32
37
  def captures(_identifier)
33
38
  raise NotImplementedError
34
39
  end
@@ -70,7 +70,7 @@ module Nanoc
70
70
 
71
71
  def code_snippets_from_config(config)
72
72
  config[:lib_dirs].flat_map do |lib|
73
- Dir["#{lib}/**/*.rb"].sort.map do |filename|
73
+ Dir["#{File.expand_path(lib)}/**/*.rb"].sort.map do |filename|
74
74
  Nanoc::Core::CodeSnippet.new(
75
75
  read_code_snippet_contents(filename),
76
76
  filename,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Core
5
- VERSION = '4.13.3'
5
+ VERSION = '4.13.5'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.13.3
4
+ version: 4.13.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: base64
@@ -303,8 +302,7 @@ licenses:
303
302
  - MIT
304
303
  metadata:
305
304
  rubygems_mfa_required: 'true'
306
- source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.13.3/nanoc-core
307
- post_install_message:
305
+ source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.13.5/nanoc-core
308
306
  rdoc_options: []
309
307
  require_paths:
310
308
  - lib
@@ -319,8 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
317
  - !ruby/object:Gem::Version
320
318
  version: '0'
321
319
  requirements: []
322
- rubygems_version: 3.5.22
323
- signing_key:
320
+ rubygems_version: 3.6.7
324
321
  specification_version: 4
325
322
  summary: Core of Nanoc
326
323
  test_files: []