nanoc 4.10.3 → 4.10.4

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: 29fff0fd45abb2f33fe2ecd8b80531a166163bfea453b2f4633bd7796847624d
4
- data.tar.gz: 8795f5b0c4d192c4d02cc3febc198a5af78410d073ba6df41c8ffbe32ad94f54
3
+ metadata.gz: 49248486c259abaff30695129879e162907c8c2d4dd7d732b4fdcc2da85d2b3f
4
+ data.tar.gz: f3ffb726ca647c372279f04063e44001a834e7a2fae0640a72bf216f7fcc950c
5
5
  SHA512:
6
- metadata.gz: d208e075e74aa527b9384aa902a98b52d35ee0fc7432fc2ed93c142ebf66dd02ade7ecf169fce4a1ded36c680428afcf36b675d5de158553beb5d3e256850fcc
7
- data.tar.gz: 5a8b4e5c7f3c367620fcf568491665d509dc6ccfab035994bb896962bf83403309b6b116d221836babf82afba750b8b944f38c9ef462d7c45a964fa82afd1877
6
+ metadata.gz: 6be653b479fc1ac3d883ce735c956315331569e4851e5bef853094df8549a479c41a42cc266defbf9fbd881cc7e0ea8847a04ce726c5489d7e0531bcb938ee26
7
+ data.tar.gz: 417abf05a59af571b5402d8e0869308012ed04abd4e070c1c633170c5b66904d0931f80b1a6f670f5743f0fdf6f71fde425481806aaf0a3e144015cc464b7756
data/NEWS.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.10.4 (2018-12-01)
4
+
5
+ Fixes:
6
+
7
+ * Fixed an error when importing a Sass/SCSS file outside of Nanoc’s content directory (#1378, #1379)
8
+
3
9
  ## 4.10.3 (2018-10-28)
4
10
 
5
11
  Fixes:
@@ -988,11 +994,11 @@ Enhancements:
988
994
 
989
995
  * Added several convenience methods to view classes (#570, #572)
990
996
 
991
- See the [nanoc 4 upgrade guide](http://nanoc.ws/docs/nanoc-4-upgrade-guide/) for details.
997
+ See the [nanoc 4 upgrade guide](http://nanoc.ws/doc/nanoc-4-upgrade-guide/) for details.
992
998
 
993
999
  ## 4.0.0a1 (2015-05-09)
994
1000
 
995
- This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](http://nanoc.ws/docs/nanoc-4-upgrade-guide/).
1001
+ This is a major upgrade. For details on upgrading, see the [nanoc 4 upgrade guide](http://nanoc.ws/doc/nanoc-4-upgrade-guide/).
996
1002
 
997
1003
  This release provides no new features, but streamlines the API and functionality, in order to easen future development, both for features and for optimisations.
998
1004
 
@@ -77,7 +77,7 @@ module Nanoc::Int
77
77
  end
78
78
  end
79
79
 
80
- ENCODING_REGEX = /\A#\s+(-\*-\s+)?(en)?coding: (?<encoding>[^\s]+)(\s+-\*-\s*)?\n{0,2}/
80
+ ENCODING_REGEX = /\A#\s+(-\*-\s+)?(en)?coding: (?<encoding>[^\s]+)(\s+-\*-\s*)?\n{0,2}/.freeze
81
81
 
82
82
  def encoding_from_magic_comment(raw)
83
83
  match = ENCODING_REGEX.match(raw)
@@ -8,7 +8,7 @@ module Nanoc::Checking::Checks
8
8
  class MixedContent < ::Nanoc::Checking::Check
9
9
  identifier :mixed_content
10
10
 
11
- PROTOCOL_PATTERN = /^(\w+):\/\//
11
+ PROTOCOL_PATTERN = /^(\w+):\/\//.freeze
12
12
 
13
13
  def run
14
14
  filenames = output_html_filenames
@@ -75,8 +75,8 @@ module Nanoc::CLI::Commands
75
75
  ].freeze
76
76
 
77
77
  PLUGIN_CLASSES = {
78
- Nanoc::Filter => 'Filters',
79
- Nanoc::DataSource => 'Data Sources',
78
+ Nanoc::Filter => 'Filters',
79
+ Nanoc::DataSource => 'Data Sources',
80
80
  Nanoc::Deploying::Deployer => 'Deployers',
81
81
  }.freeze
82
82
 
@@ -180,45 +180,45 @@ module Nanoc::CLI
180
180
  # A hash that contains the name of the gem for a given required file. If a
181
181
  # `#require` fails, the gem name is looked up in this hash.
182
182
  GEM_NAMES = {
183
- 'adsf' => 'adsf',
184
- 'asciidoctor' => 'asciidoctor',
185
- 'bluecloth' => 'bluecloth',
186
- 'builder' => 'builder',
187
- 'coderay' => 'coderay',
188
- 'coffee-script' => 'coffee-script',
189
- 'cri' => 'cri',
190
- 'erubi' => 'erubi',
191
- 'erubis' => 'erubis',
192
- 'escape' => 'escape',
193
- 'fog' => 'fog',
194
- 'haml' => 'haml',
195
- 'handlebars' => 'hbs',
196
- 'json' => 'json',
197
- 'kramdown' => 'kramdown',
198
- 'less' => 'less',
199
- 'listen' => 'listen',
200
- 'markaby' => 'markaby',
201
- 'maruku' => 'maruku',
202
- 'mime/types' => 'mime-types',
203
- 'mustache' => 'mustache',
204
- 'nanoc/live' => 'nanoc-live',
205
- 'nokogiri' => 'nokogiri',
206
- 'nokogumbo' => 'nokogumbo',
207
- 'pandoc-ruby' => 'pandoc-ruby',
208
- 'pry' => 'pry',
209
- 'rack' => 'rack',
210
- 'rack/cache' => 'rack-cache',
211
- 'rainpress' => 'rainpress',
212
- 'rdiscount' => 'rdiscount',
213
- 'redcarpet' => 'redcarpet',
214
- 'redcloth' => 'RedCloth',
215
- 'rubypants' => 'rubypants',
216
- 'sass' => 'sass',
217
- 'slim' => 'slim',
218
- 'typogruby' => 'typogruby',
219
- 'uglifier' => 'uglifier',
183
+ 'adsf' => 'adsf',
184
+ 'asciidoctor' => 'asciidoctor',
185
+ 'bluecloth' => 'bluecloth',
186
+ 'builder' => 'builder',
187
+ 'coderay' => 'coderay',
188
+ 'coffee-script' => 'coffee-script',
189
+ 'cri' => 'cri',
190
+ 'erubi' => 'erubi',
191
+ 'erubis' => 'erubis',
192
+ 'escape' => 'escape',
193
+ 'fog' => 'fog',
194
+ 'haml' => 'haml',
195
+ 'handlebars' => 'hbs',
196
+ 'json' => 'json',
197
+ 'kramdown' => 'kramdown',
198
+ 'less' => 'less',
199
+ 'listen' => 'listen',
200
+ 'markaby' => 'markaby',
201
+ 'maruku' => 'maruku',
202
+ 'mime/types' => 'mime-types',
203
+ 'mustache' => 'mustache',
204
+ 'nanoc/live' => 'nanoc-live',
205
+ 'nokogiri' => 'nokogiri',
206
+ 'nokogumbo' => 'nokogumbo',
207
+ 'pandoc-ruby' => 'pandoc-ruby',
208
+ 'pry' => 'pry',
209
+ 'rack' => 'rack',
210
+ 'rack/cache' => 'rack-cache',
211
+ 'rainpress' => 'rainpress',
212
+ 'rdiscount' => 'rdiscount',
213
+ 'redcarpet' => 'redcarpet',
214
+ 'redcloth' => 'RedCloth',
215
+ 'rubypants' => 'rubypants',
216
+ 'sass' => 'sass',
217
+ 'slim' => 'slim',
218
+ 'typogruby' => 'typogruby',
219
+ 'uglifier' => 'uglifier',
220
220
  'w3c_validators' => 'w3c_validators',
221
- 'yuicompressor' => 'yuicompressor',
221
+ 'yuicompressor' => 'yuicompressor',
222
222
  }.freeze
223
223
 
224
224
  # Attempts to find a resolution for the given error, or nil if no
@@ -4,7 +4,7 @@ module Nanoc::CLI
4
4
  # @api private
5
5
  module Transform
6
6
  module Port
7
- RANGE = 0x0001..0xffff
7
+ RANGE = (0x0001..0xffff).freeze
8
8
 
9
9
  def self.call(data)
10
10
  Integer(data).tap do |int|
@@ -20,15 +20,16 @@ module Nanoc::Filters::SassCommon
20
20
  return unless raw_filename
21
21
 
22
22
  item = raw_filename_to_item(raw_filename)
23
- # it doesn't make sense to import a file, from Nanoc's content if the corresponding item has been deleted
24
- raise "unable to map #{raw_filename} to any item" if item.nil?
25
23
 
26
- filter.depend_on([item])
24
+ content = item ? item.raw_content : File.read(raw_filename)
25
+ filename = item ? item.identifier.to_s : raw_filename
26
+
27
+ filter.depend_on([item]) if item
27
28
 
28
29
  options[:syntax] = syntax
29
- options[:filename] = item.identifier.to_s
30
+ options[:filename] = filename
30
31
  options[:importer] = self
31
- ::Sass::Engine.new(item.raw_content, options)
32
+ ::Sass::Engine.new(content, options)
32
33
  end
33
34
 
34
35
  def find(identifier, options)
@@ -167,19 +167,19 @@ module Nanoc
167
167
  def view_context
168
168
  compilation_context =
169
169
  Nanoc::Int::CompilationContext.new(
170
- action_provider: @action_provider,
171
- reps: @reps,
172
- site: @site,
170
+ action_provider: @action_provider,
171
+ reps: @reps,
172
+ site: @site,
173
173
  compiled_content_cache: :__compiled_content_cache,
174
- snapshot_repo: @snapshot_repo,
174
+ snapshot_repo: @snapshot_repo,
175
175
  )
176
176
 
177
177
  Nanoc::ViewContextForCompilation.new(
178
- reps: @reps,
179
- items: @items,
180
- dependency_tracker: @dependency_tracker,
178
+ reps: @reps,
179
+ items: @items,
180
+ dependency_tracker: @dependency_tracker,
181
181
  compilation_context: compilation_context,
182
- snapshot_repo: @snapshot_repo,
182
+ snapshot_repo: @snapshot_repo,
183
183
  )
184
184
  end
185
185
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Nanoc
4
4
  # The current Nanoc version.
5
- VERSION = '4.10.3'
5
+ VERSION = '4.10.4'
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.10.3
4
+ version: 4.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-28 00:00:00.000000000 Z
11
+ date: 2018-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -455,7 +455,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
455
455
  version: '0'
456
456
  requirements: []
457
457
  rubyforge_project:
458
- rubygems_version: 2.7.7
458
+ rubygems_version: 2.7.8
459
459
  signing_key:
460
460
  specification_version: 4
461
461
  summary: A static-site generator with a focus on flexibility.