nanoc 4.3.2 → 4.3.3

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
  SHA1:
3
- metadata.gz: 0bb28957e1fb5b1563b0171cc7796ea2fc05a3d4
4
- data.tar.gz: 82ea5fc8aaa8ccb02ba80e78c1f94b0be0ddb278
3
+ metadata.gz: 67e0bd2577c8efa7e807709b09a5b4df6e95024b
4
+ data.tar.gz: 4adc8f82bbc6d85e2a77b06a3792aac2b0f05d71
5
5
  SHA512:
6
- metadata.gz: fea9dcd73c69e4e5dc0b413c77a5b9f32fa633c477f3c525e700d8dda04a6d1b6099a2054780dc12df5db8daaba8e06412c93201e1485432c1489a53a37a4e78
7
- data.tar.gz: 3c4182f1b3c1107c2aca9c91fe6a6b69037ff08c6de4690011e24a6b99cfecaadca4d9c22bcf556aace7a0287712c5145f5aa23e5b4844af28e9d2633949df39
6
+ metadata.gz: 17f1e158368ac1f9f6b0b1970f0d0cc5cdf616160277fffba13d2e0f9069ffd9db60a80a64cdf144912043c52e71086c57da71540650b9005286fab59f8844f4
7
+ data.tar.gz: d26cec92f468874b2d14133b5d5b7e360d591443a559590b0b5bd85bb81f3154d981d80dea5c3f7f76d4071dcf8b8798cd1fbb496a7aba0128bf960903682b6d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nanoc (4.3.2)
4
+ nanoc (4.3.3)
5
5
  cri (~> 2.3)
6
6
  hamster (~> 3.0)
7
7
  ref (~> 2.0)
@@ -9,7 +9,7 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- CFPropertyList (2.3.2)
12
+ CFPropertyList (2.3.3)
13
13
  RedCloth (4.3.2)
14
14
  addressable (2.4.0)
15
15
  adsf (1.2.1)
@@ -17,7 +17,7 @@ GEM
17
17
  ast (2.3.0)
18
18
  bluecloth (2.2.0)
19
19
  builder (3.2.2)
20
- chunky_png (1.3.6)
20
+ chunky_png (1.3.7)
21
21
  coderay (1.1.1)
22
22
  coffee-script (2.4.1)
23
23
  coffee-script-source
@@ -94,7 +94,7 @@ GEM
94
94
  fog-atmos (0.1.0)
95
95
  fog-core
96
96
  fog-xml
97
- fog-aws (0.11.0)
97
+ fog-aws (0.12.0)
98
98
  fog-core (~> 1.38)
99
99
  fog-json (~> 1.0)
100
100
  fog-xml (~> 0.1)
@@ -128,7 +128,7 @@ GEM
128
128
  multi_json (~> 1.10)
129
129
  fog-local (0.3.0)
130
130
  fog-core (~> 1.27)
131
- fog-openstack (0.1.11)
131
+ fog-openstack (0.1.12)
132
132
  fog-core (>= 1.40)
133
133
  fog-json (>= 1.0)
134
134
  ipaddress (>= 0.8)
@@ -136,10 +136,9 @@ GEM
136
136
  fog-core (~> 1.27)
137
137
  fog-json (~> 1.0)
138
138
  fog-xml (~> 0.1)
139
- fog-profitbricks (0.0.5)
140
- fog-core
141
- fog-xml
142
- nokogiri
139
+ fog-profitbricks (2.0.1)
140
+ fog-core (~> 1.42)
141
+ fog-json (~> 1.0)
143
142
  fog-rackspace (0.1.1)
144
143
  fog-core (>= 1.35)
145
144
  fog-json (>= 1.0)
@@ -159,7 +158,7 @@ GEM
159
158
  fog-serverlove (0.1.2)
160
159
  fog-core
161
160
  fog-json
162
- fog-softlayer (1.1.3)
161
+ fog-softlayer (1.1.4)
163
162
  fog-core
164
163
  fog-json
165
164
  fog-storm_on_demand (0.1.1)
@@ -174,9 +173,9 @@ GEM
174
173
  fog-voxel (0.1.0)
175
174
  fog-core
176
175
  fog-xml
177
- fog-vsphere (1.0.0)
176
+ fog-vsphere (1.2.0)
178
177
  fog-core
179
- rbvmomi (~> 1.8)
178
+ rbvmomi (~> 1.8.0)
180
179
  fog-xenserver (0.2.3)
181
180
  fog-core
182
181
  fog-xml
@@ -229,7 +228,7 @@ GEM
229
228
  mime-types-data (~> 3.2015)
230
229
  mime-types-data (3.2016.0521)
231
230
  mini_portile2 (2.1.0)
232
- minitest (5.9.0)
231
+ minitest (5.9.1)
233
232
  mocha (1.1.0)
234
233
  metaclass (~> 0.0.1)
235
234
  multi_json (1.12.1)
@@ -242,7 +241,7 @@ GEM
242
241
  nenv (~> 0.1)
243
242
  shellany (~> 0.0)
244
243
  pandoc-ruby (2.0.1)
245
- parser (2.3.1.2)
244
+ parser (2.3.1.4)
246
245
  ast (~> 2.2)
247
246
  pkg-config (1.1.7)
248
247
  posix-spawn (0.3.11)
@@ -257,25 +256,24 @@ GEM
257
256
  rack (2.0.1)
258
257
  rainbow (2.1.0)
259
258
  rainpress (1.0)
260
- rake (11.2.2)
259
+ rake (11.3.0)
261
260
  rb-fsevent (0.9.7)
262
261
  rb-inotify (0.9.7)
263
262
  ffi (>= 0.5.0)
264
- rbvmomi (1.9.1)
265
- builder (~> 3.2)
266
- json (>= 1.8)
267
- nokogiri (~> 1.5)
268
- trollop (~> 2.1)
263
+ rbvmomi (1.8.2)
264
+ builder
265
+ nokogiri (>= 1.4.1)
266
+ trollop
269
267
  rdiscount (2.2.0.1)
270
268
  rdoc (4.2.1)
271
269
  redcarpet (3.3.4)
272
270
  ref (2.0.0)
273
- rouge (2.0.5)
271
+ rouge (2.0.6)
274
272
  rspec (3.5.0)
275
273
  rspec-core (~> 3.5.0)
276
274
  rspec-expectations (~> 3.5.0)
277
275
  rspec-mocks (~> 3.5.0)
278
- rspec-core (3.5.2)
276
+ rspec-core (3.5.3)
279
277
  rspec-support (~> 3.5.0)
280
278
  rspec-expectations (3.5.0)
281
279
  diff-lcs (>= 1.2.0, < 2.0)
@@ -284,7 +282,7 @@ GEM
284
282
  diff-lcs (>= 1.2.0, < 2.0)
285
283
  rspec-support (~> 3.5.0)
286
284
  rspec-support (3.5.0)
287
- rubocop (0.42.0)
285
+ rubocop (0.43.0)
288
286
  parser (>= 2.3.1.1, < 3.0)
289
287
  powerpack (~> 0.1)
290
288
  rainbow (>= 1.99.1, < 3.0)
@@ -319,7 +317,7 @@ GEM
319
317
  rubypants
320
318
  uglifier (3.0.2)
321
319
  execjs (>= 0.3.0, < 3)
322
- unicode-display_width (1.1.0)
320
+ unicode-display_width (1.1.1)
323
321
  vcr (3.0.3)
324
322
  w3c_validators (1.2)
325
323
  json
@@ -391,4 +389,4 @@ DEPENDENCIES
391
389
  yuicompressor
392
390
 
393
391
  BUNDLED WITH
394
- 1.12.5
392
+ 1.13.1
data/NEWS.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.3.3 (2016-09-26)
4
+
5
+ Fixes:
6
+
7
+ * Fixed issue causing `Bundler::GemfileNotFound` to be thrown (#936) [Lorin Werthen]
8
+ * Fixed issue when replacing a directory with a file or vice versa (#942, #946)
9
+
10
+ Enhancements:
11
+
12
+ * Modified the `compile` command to allow specifying the deploy target as argument (#945)
13
+
3
14
  ## 4.3.2 (2016-08-23)
4
15
 
5
16
  Identical to 4.3.1, but with corrected release notes.
@@ -25,7 +36,7 @@ Fixes:
25
36
 
26
37
  * Fixed `UnmetDependency` errors in postprocessor (#913, #917)
27
38
 
28
- Enhancement:
39
+ Enhancements:
29
40
 
30
41
  * Sped up Nanoc by not releasing cache memory as quickly (#902)
31
42
  * Let `internal_links` check also verify resource paths, such as scripts and images (#912) [Lorin Werthen]
@@ -74,6 +74,7 @@ module Nanoc::Int
74
74
  def run_all
75
75
  @action_provider.preprocess(@site)
76
76
  build_reps
77
+ prune
77
78
  run
78
79
  @action_provider.postprocess(@site, @reps)
79
80
  end
@@ -180,6 +181,20 @@ module Nanoc::Int
180
181
 
181
182
  private
182
183
 
184
+ def prune
185
+ if site.config[:prune][:auto_prune]
186
+ Nanoc::Extra::Pruner.new(site, exclude: prune_config_exclude).run
187
+ end
188
+ end
189
+
190
+ def prune_config
191
+ site.config[:prune] || {}
192
+ end
193
+
194
+ def prune_config_exclude
195
+ prune_config[:exclude] || {}
196
+ end
197
+
183
198
  def compile_reps
184
199
  # Listen to processing start/stop
185
200
  Nanoc::Int::NotificationCenter.on(:processing_started, self) { |obj| @stack.push(obj) }
@@ -1,11 +1,19 @@
1
1
  module Nanoc
2
2
  # @api private
3
3
  module Feature
4
- TRUES = %w(y yes 1 t true).freeze
4
+ PROFILER = 'profiler'.freeze
5
5
 
6
- def self.enabled?(name)
7
- env_name = "NANOC_FEATURE_#{name.upcase}"
8
- TRUES.include?(ENV.fetch(env_name, 'f').downcase)
6
+ def self.enabled_features
7
+ @enabled_features ||= Set.new(ENV.fetch('NANOC_FEATURES', '').split(','))
8
+ end
9
+
10
+ def self.enabled?(feature_name)
11
+ enabled_features.include?(feature_name) ||
12
+ enabled_features.include?('all')
13
+ end
14
+
15
+ def self.reset_caches
16
+ @enabled_features = nil
9
17
  end
10
18
  end
11
19
  end
@@ -67,6 +67,13 @@ module Nanoc::Int
67
67
  @notifications[name].reject! { |i| i[:id] == id }
68
68
  end
69
69
 
70
+ # @api private
71
+ #
72
+ # @return [void]
73
+ def reset
74
+ @notifications = nil
75
+ end
76
+
70
77
  private
71
78
 
72
79
  def initialize_if_necessary(name)
data/lib/nanoc/cli.rb CHANGED
@@ -106,7 +106,13 @@ module Nanoc::CLI
106
106
 
107
107
  if defined?(Bundler)
108
108
  # Discover external commands through Bundler
109
- Bundler.require(:nanoc)
109
+ begin
110
+ Bundler.require(:nanoc)
111
+ rescue Bundler::GemfileNotFound
112
+ # When running nanoc with Bundler being defined but
113
+ # no gemfile being present (rubygems automatically loads
114
+ # Bundler when executing from command line), don't crash.
115
+ end
110
116
  end
111
117
  end
112
118
 
@@ -14,7 +14,7 @@ IDENTICAL - The item was deemed outdated and has been recompiled, but the compil
14
14
  SKIP - The item was deemed not outdated and was therefore not recompiled
15
15
 
16
16
  EOS
17
- flag nil, :profile, 'profile compilation' if Nanoc::Feature.enabled?('PROFILER')
17
+ flag nil, :profile, 'profile compilation' if Nanoc::Feature.enabled?(Nanoc::Feature::PROFILER)
18
18
 
19
19
  module Nanoc::CLI::Commands
20
20
  class Compile < ::Nanoc::CLI::CommandRunner
@@ -404,7 +404,6 @@ module Nanoc::CLI::Commands
404
404
  puts 'Compiling site…'
405
405
  run_listeners_while do
406
406
  site.compile
407
- prune
408
407
  end
409
408
 
410
409
  time_after = Time.now
@@ -414,12 +413,6 @@ module Nanoc::CLI::Commands
414
413
 
415
414
  protected
416
415
 
417
- def prune
418
- if site.config[:prune][:auto_prune]
419
- Nanoc::Extra::Pruner.new(site, exclude: prune_config_exclude).run
420
- end
421
- end
422
-
423
416
  def default_listener_classes
424
417
  [
425
418
  Nanoc::CLI::Commands::Compile::DiffGenerator,
@@ -458,14 +451,6 @@ module Nanoc::CLI::Commands
458
451
  def reps
459
452
  site.compiler.reps
460
453
  end
461
-
462
- def prune_config
463
- site.config[:prune] || {}
464
- end
465
-
466
- def prune_config_exclude
467
- prune_config[:exclude] || {}
468
- end
469
454
  end
470
455
  end
471
456
 
@@ -2,7 +2,7 @@ usage 'create-site [options] path'
2
2
  aliases :create_site, :cs
3
3
  summary 'create a site'
4
4
  description 'Create a new site at the given path. The site will use the `filesystem` data source.'
5
- flag nil, :force, 'Force creation of new site. Disregards previous existence of site in destination'
5
+ flag nil, :force, 'force creation of new site'
6
6
 
7
7
  module Nanoc::CLI::Commands
8
8
  class CreateSite < ::Nanoc::CLI::CommandRunner
@@ -1,4 +1,4 @@
1
- usage 'deploy [options]'
1
+ usage 'deploy [target] [options]'
2
2
  summary 'deploy the compiled site'
3
3
  description "
4
4
  Deploys the compiled site. The compiled site contents in the output directory will be uploaded to the destination, which is specified using the `--target` option.
@@ -60,8 +60,18 @@ module Nanoc::CLI::Commands
60
60
  raise Nanoc::Int::Errors::GenericTrivial, 'The site has no deployment configurations.'
61
61
  end
62
62
 
63
- target = options.fetch(:target, :default).to_sym
64
- deploy_configs.fetch(target) do
63
+ if arguments.length > 1
64
+ raise Nanoc::Int::Errors::GenericTrivial, "usage: #{command.usage}"
65
+ end
66
+
67
+ target_from_arguments = arguments[0]
68
+ target_from_options = options.fetch(:target, nil)
69
+ if target_from_arguments && target_from_options
70
+ raise Nanoc::Int::Errors::GenericTrivial, 'Only one deployment target can be specified on the command line.'
71
+ end
72
+
73
+ target = target_from_arguments || target_from_options || :default
74
+ deploy_configs.fetch(target.to_sym) do
65
75
  raise Nanoc::Int::Errors::GenericTrivial, "The site has no deployment configuration named `#{target}`."
66
76
  end
67
77
  end
data/lib/nanoc/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Nanoc
2
2
  # The current Nanoc version.
3
- VERSION = '4.3.2'.freeze
3
+ VERSION = '4.3.3'.freeze
4
4
  end
@@ -106,13 +106,13 @@ class Nanoc::Filters::RelativizePathsTest < Nanoc::TestCase
106
106
  </body>
107
107
  </html>
108
108
  EOS
109
- expected_match_0 = %r{<a href="\.\./\.\.">foo</a>}
110
- expected_match_1 = %r{\A\s*<!DOCTYPE html\s*>\s*<html>\s*<head>(.|\s)*<title>Hello</title>\s*</head>\s*<body>\s*<a href="../..">foo</a>\s*</body>\s*</html>\s*\Z}m
109
+ expected0 = %r{<a href="\.\./\.\.">foo</a>}
110
+ expected1 = %r{\A\s*<!DOCTYPE html\s*>\s*<html>\s*<head>(.|\s)*<title>Hello</title>\s*</head>\s*<body>\s*<a href="../..">foo</a>\s*</body>\s*</html>\s*\Z}m
111
111
 
112
112
  # Test
113
113
  actual_content = filter.setup_and_run(raw_content, type: :html)
114
- assert_match(expected_match_0, actual_content)
115
- assert_match(expected_match_1, actual_content)
114
+ assert_match(expected0, actual_content)
115
+ assert_match(expected1, actual_content)
116
116
  end
117
117
 
118
118
  def test_filter_html_multiple
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.3.2
4
+ version: 4.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri