nanoc 4.1.4 → 4.1.5

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: ec5f1b744e1d1a155a6b2d1dc1d603874d2deb57
4
- data.tar.gz: eb4aa79555b133ab4ce28878aefb88b1644d3d04
3
+ metadata.gz: f9c0263d7b1a82695a400be99ff361742a79f205
4
+ data.tar.gz: 9e037c0b7f6dd9e0dde26ee2e17c5b0b512c108b
5
5
  SHA512:
6
- metadata.gz: e144b54d2dd138af0e36e90274d2c4d20350aae065496aaeaf5a0e39f3a8506c7235adc1c0325dfc94d0e835657359d9bd883536665de12dabc6b36626b90654
7
- data.tar.gz: f1192638a1b3c2182c6c21911f54de5a9f0fa8c17e2ee99adbb683e55e7f7847aab1e34dec1f425a73d3a016035507eb3206b90aca1513203bb3cc13e94a78f6
6
+ metadata.gz: d878758c199d21225f6ab0a893f248b2f51cd47d4e740fe2fad232f92ccdcfebc05921252271cd3f4123e6bb9d6eb5f033aa859387d6e196242ea2aea81286d5
7
+ data.tar.gz: ec1f03f5120a5c3cbab4c49bb785edafc0c8eaa7b100fc37a66dda63f313281242adf1fe1b701b2ecebd2c69e81519975b40f3e99703e91a23a4a7f5c0651b31
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nanoc (4.1.4)
4
+ nanoc (4.1.5)
5
5
  cri (~> 2.3)
6
6
 
7
7
  GEM
@@ -10,13 +10,13 @@ GEM
10
10
  CFPropertyList (2.3.2)
11
11
  RedCloth (4.2.9)
12
12
  addressable (2.4.0)
13
- adsf (1.2.0)
13
+ adsf (1.2.1)
14
14
  rack (>= 1.0.0)
15
15
  ast (2.2.0)
16
16
  bluecloth (2.2.0)
17
17
  builder (3.2.2)
18
18
  chunky_png (1.3.5)
19
- coderay (1.1.0)
19
+ coderay (1.1.1)
20
20
  coffee-script (2.4.1)
21
21
  coffee-script-source
22
22
  execjs
@@ -35,9 +35,8 @@ GEM
35
35
  sass (>= 3.3.0, < 3.5)
36
36
  compass-import-once (1.0.5)
37
37
  sass (>= 3.2, < 3.5)
38
- coveralls (0.8.10)
38
+ coveralls (0.8.13)
39
39
  json (~> 1.8)
40
- rest-client (>= 1.6.8, < 2)
41
40
  simplecov (~> 0.11.0)
42
41
  term-ansicolor (~> 1.3)
43
42
  thor (~> 0.19.1)
@@ -48,10 +47,8 @@ GEM
48
47
  colored (~> 1.2)
49
48
  diff-lcs (1.2.5)
50
49
  docile (1.1.5)
51
- domain_name (0.5.20160128)
52
- unf (>= 0.0.5, < 1.0.0)
53
50
  erubis (2.7.0)
54
- excon (0.45.4)
51
+ excon (0.48.0)
55
52
  execjs (2.6.0)
56
53
  ffi (1.9.10)
57
54
  fission (0.5.0)
@@ -90,7 +87,7 @@ GEM
90
87
  fog-atmos (0.1.0)
91
88
  fog-core
92
89
  fog-xml
93
- fog-aws (0.8.1)
90
+ fog-aws (0.9.2)
94
91
  fog-core (~> 1.27)
95
92
  fog-json (~> 1.0)
96
93
  fog-xml (~> 0.1)
@@ -99,11 +96,11 @@ GEM
99
96
  fog-core (~> 1.22)
100
97
  fog-json
101
98
  inflecto (~> 0.0.2)
102
- fog-core (1.35.0)
99
+ fog-core (1.36.0)
103
100
  builder
104
101
  excon (~> 0.45)
105
102
  formatador (~> 0.2)
106
- fog-dynect (0.0.2)
103
+ fog-dynect (0.0.3)
107
104
  fog-core
108
105
  fog-json
109
106
  fog-xml
@@ -117,7 +114,7 @@ GEM
117
114
  fog-json (1.0.2)
118
115
  fog-core (~> 1.0)
119
116
  multi_json (~> 1.10)
120
- fog-local (0.2.1)
117
+ fog-local (0.3.0)
121
118
  fog-core (~> 1.27)
122
119
  fog-powerdns (0.1.1)
123
120
  fog-core (~> 1.27)
@@ -141,7 +138,7 @@ GEM
141
138
  fog-serverlove (0.1.2)
142
139
  fog-core
143
140
  fog-json
144
- fog-softlayer (1.0.3)
141
+ fog-softlayer (1.1.0)
145
142
  fog-core
146
143
  fog-json
147
144
  fog-storm_on_demand (0.1.1)
@@ -156,7 +153,7 @@ GEM
156
153
  fog-voxel (0.1.0)
157
154
  fog-core
158
155
  fog-xml
159
- fog-vsphere (0.6.0)
156
+ fog-vsphere (0.6.3)
160
157
  fog-core
161
158
  rbvmomi (~> 1.8)
162
159
  fog-xenserver (0.2.3)
@@ -185,12 +182,10 @@ GEM
185
182
  therubyracer (~> 0.12.1)
186
183
  handlebars-source (3.0.3)
187
184
  hashdiff (0.3.0)
188
- http-cookie (1.0.2)
189
- domain_name (~> 0.5)
190
185
  inflecto (0.0.2)
191
- ipaddress (0.8.2)
186
+ ipaddress (0.8.3)
192
187
  json (1.8.3)
193
- kramdown (1.9.0)
188
+ kramdown (1.10.0)
194
189
  less (2.6.0)
195
190
  commonjs (~> 0.2.7)
196
191
  libv8 (3.16.14.13)
@@ -203,22 +198,23 @@ GEM
203
198
  maruku (0.7.2)
204
199
  metaclass (0.0.4)
205
200
  method_source (0.8.2)
206
- mime-types (2.99)
201
+ mime-types (3.0)
202
+ mime-types-data (~> 3.2015)
203
+ mime-types-data (3.2016.0221)
207
204
  mini_portile2 (2.0.0)
208
205
  minitest (5.8.4)
209
206
  mocha (1.1.0)
210
207
  metaclass (~> 0.0.1)
211
208
  multi_json (1.11.2)
212
- mustache (1.0.2)
209
+ mustache (1.0.3)
213
210
  nenv (0.3.0)
214
- netrc (0.11.0)
215
211
  nokogiri (1.6.7.2)
216
212
  mini_portile2 (~> 2.0.0.rc2)
217
213
  notiffany (0.0.8)
218
214
  nenv (~> 0.1)
219
215
  shellany (~> 0.0)
220
216
  pandoc-ruby (1.0.0)
221
- parser (2.3.0.5)
217
+ parser (2.3.0.6)
222
218
  ast (~> 2.2)
223
219
  posix-spawn (0.3.11)
224
220
  powerpack (0.1.1)
@@ -232,7 +228,7 @@ GEM
232
228
  rack (1.6.4)
233
229
  rainbow (2.1.0)
234
230
  rainpress (1.0)
235
- rake (10.5.0)
231
+ rake (11.1.1)
236
232
  rb-fsevent (0.9.7)
237
233
  rb-inotify (0.9.7)
238
234
  ffi (>= 0.5.0)
@@ -245,16 +241,12 @@ GEM
245
241
  json (~> 1.4)
246
242
  redcarpet (3.3.4)
247
243
  ref (2.0.0)
248
- rest-client (1.8.0)
249
- http-cookie (>= 1.0.2, < 2.0)
250
- mime-types (>= 1.16, < 3.0)
251
- netrc (~> 0.7)
252
244
  rouge (1.10.1)
253
245
  rspec (3.4.0)
254
246
  rspec-core (~> 3.4.0)
255
247
  rspec-expectations (~> 3.4.0)
256
248
  rspec-mocks (~> 3.4.0)
257
- rspec-core (3.4.2)
249
+ rspec-core (3.4.4)
258
250
  rspec-support (~> 3.4.0)
259
251
  rspec-expectations (3.4.0)
260
252
  diff-lcs (>= 1.2.0, < 2.0)
@@ -263,12 +255,12 @@ GEM
263
255
  diff-lcs (>= 1.2.0, < 2.0)
264
256
  rspec-support (~> 3.4.0)
265
257
  rspec-support (3.4.1)
266
- rubocop (0.37.2)
267
- parser (>= 2.3.0.4, < 3.0)
258
+ rubocop (0.38.0)
259
+ parser (>= 2.3.0.6, < 3.0)
268
260
  powerpack (~> 0.1)
269
261
  rainbow (>= 1.99.1, < 3.0)
270
262
  ruby-progressbar (~> 1.7)
271
- unicode-display_width (~> 0.3)
263
+ unicode-display_width (~> 1.0, >= 1.0.1)
272
264
  ruby-progressbar (1.7.5)
273
265
  rubypants (0.2.0)
274
266
  safe_yaml (1.0.4)
@@ -295,18 +287,14 @@ GEM
295
287
  trollop (2.1.2)
296
288
  typogruby (1.0.18)
297
289
  rubypants
298
- uglifier (2.7.2)
299
- execjs (>= 0.3.0)
300
- json (>= 1.8.0)
301
- unf (0.1.4)
302
- unf_ext
303
- unf_ext (0.0.7.2)
304
- unicode-display_width (0.3.1)
290
+ uglifier (3.0.0)
291
+ execjs (>= 0.3.0, < 3)
292
+ unicode-display_width (1.0.2)
305
293
  vcr (3.0.1)
306
294
  w3c_validators (1.2)
307
295
  json
308
296
  nokogiri
309
- webmock (1.22.6)
297
+ webmock (1.24.2)
310
298
  addressable (>= 2.3.6)
311
299
  crack (>= 0.3.2)
312
300
  hashdiff
data/NEWS.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Nanoc news
2
2
 
3
+ ## 4.1.5 (2016-03-24)
4
+
5
+ Fixes:
6
+
7
+ * Fixed crash in `show-data` command (#833, #835)
8
+ * Fixed preprocessor not being invoked before running checks (#841, #842)
9
+
3
10
  ## 4.1.4 (2016-02-13)
4
11
 
5
12
  Fixes:
@@ -13,6 +13,7 @@ module Nanoc::CLI::Commands
13
13
  def run
14
14
  validate_options_and_arguments
15
15
  load_site
16
+ site.compiler.action_provider.preprocess(site)
16
17
 
17
18
  runner = Nanoc::Extra::Checking::Runner.new(site)
18
19
 
@@ -13,78 +13,107 @@ option :n, :'dry-run', 'show what would be deployed'
13
13
  module Nanoc::CLI::Commands
14
14
  class Deploy < ::Nanoc::CLI::CommandRunner
15
15
  def run
16
+ prepare
17
+
18
+ case
19
+ when options[:'list-deployers']
20
+ list_deployers
21
+ when options[:list]
22
+ list_deploy_configs
23
+ else
24
+ deploy
25
+ end
26
+ end
27
+
28
+ private
29
+
30
+ def prepare
16
31
  load_site
17
32
  # FIXME: ugly to preprocess here
18
33
  site.compiler.action_provider.preprocess(site)
34
+ end
19
35
 
20
- # List deployers
21
- if options[:'list-deployers']
22
- deployers = Nanoc::Int::PluginRegistry.instance.find_all(Nanoc::Extra::Deployer)
23
- deployer_names = deployers.keys.sort_by(&:to_s)
24
- puts 'Available deployers:'
25
- deployer_names.each do |name|
36
+ def list_deployers
37
+ deployers = Nanoc::Int::PluginRegistry.instance.find_all(Nanoc::Extra::Deployer)
38
+ deployer_names = deployers.keys.sort_by(&:to_s)
39
+ puts 'Available deployers:'
40
+ deployer_names.each do |name|
41
+ puts " #{name}"
42
+ end
43
+ end
44
+
45
+ def list_deploy_configs
46
+ if deploy_configs.empty?
47
+ puts 'No deployment configurations.'
48
+ else
49
+ puts 'Available deployment configurations:'
50
+ deploy_configs.keys.each do |name|
26
51
  puts " #{name}"
27
52
  end
28
- return
29
53
  end
54
+ end
30
55
 
31
- # Get & list configs
32
- deploy_configs = site.config.fetch(:deploy, {})
56
+ def deploy
57
+ deployer = deployer_for(deploy_config)
33
58
 
34
- if options[:list]
35
- if deploy_configs.empty?
36
- puts 'No deployment configurations.'
37
- else
38
- puts 'Available deployment configurations:'
39
- deploy_configs.keys.each do |name|
40
- puts " #{name}"
41
- end
42
- end
43
- return
44
- end
59
+ checks_successful = options[:'no-check'] ? true : check
60
+ return unless checks_successful
61
+
62
+ deployer.run
63
+ end
45
64
 
46
- # Can't proceed further without a deploy config
65
+ def deploy_config
47
66
  if deploy_configs.empty?
48
67
  raise Nanoc::Int::Errors::GenericTrivial, 'The site has no deployment configurations.'
49
68
  end
50
69
 
51
- # Get target
52
70
  target = options.fetch(:target, :default).to_sym
53
- config = deploy_configs.fetch(target) do
71
+ deploy_configs.fetch(target) do
72
+ # FIXME: target name is unobvious
54
73
  raise Nanoc::Int::Errors::GenericTrivial, "The site has no deployment configuration for #{target}."
55
74
  end
75
+ end
56
76
 
57
- # Get deployer
77
+ def deployer_for(config)
78
+ deployer_class_for_config(config).new(
79
+ site.config[:output_dir],
80
+ config,
81
+ dry_run: options[:'dry-run'],
82
+ )
83
+ end
84
+
85
+ def check
86
+ runner = Nanoc::Extra::Checking::Runner.new(site)
87
+ if runner.dsl_present?
88
+ puts 'Running issue checks…'
89
+ is_success = runner.run_for_deploy
90
+ if is_success
91
+ puts 'No issues found. Deploying!'
92
+ else
93
+ puts 'Issues found, deploy aborted.'
94
+ end
95
+ is_success
96
+ else
97
+ true
98
+ end
99
+ end
100
+
101
+ def deploy_configs
102
+ site.config.fetch(:deploy, {})
103
+ end
104
+
105
+ def deployer_class_for_config(config)
58
106
  names = Nanoc::Extra::Deployer.all.keys
59
107
  name = config.fetch(:kind) do
60
108
  $stderr.puts 'Warning: The specified deploy target does not have a kind attribute. Assuming rsync.'
61
109
  'rsync'
62
110
  end
111
+
63
112
  deployer_class = Nanoc::Extra::Deployer.named(name)
64
113
  if deployer_class.nil?
65
114
  raise Nanoc::Int::Errors::GenericTrivial, "The specified deploy target has an unrecognised kind “#{name}” (expected one of #{names.join(', ')})."
66
115
  end
67
-
68
- # Check
69
- unless options[:'no-check']
70
- runner = Nanoc::Extra::Checking::Runner.new(site)
71
- if runner.dsl_present?
72
- puts 'Running issue checks…'
73
- ok = runner.run_for_deploy
74
- unless ok
75
- puts 'Issues found, deploy aborted.'
76
- return
77
- end
78
- puts 'No issues found. Deploying!'
79
- end
80
- end
81
-
82
- # Run
83
- deployer = deployer_class.new(
84
- site.config[:output_dir],
85
- config,
86
- dry_run: options[:'dry-run'])
87
- deployer.run
116
+ deployer_class
88
117
  end
89
118
  end
90
119
  end
@@ -40,7 +40,7 @@ module Nanoc::CLI::Commands
40
40
  def sorted_reps_with_prev(items)
41
41
  prev = nil
42
42
  items.sort_by(&:identifier).each do |item|
43
- item.reps.sort_by { |r| r.name.to_s }.each do |rep|
43
+ site.compiler.reps[item].sort_by { |r| r.name.to_s }.each do |rep|
44
44
  yield(rep, prev)
45
45
  prev = rep
46
46
  end
data/lib/nanoc/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Nanoc
2
2
  # The current Nanoc version.
3
- VERSION = '4.1.4'.freeze
3
+ VERSION = '4.1.5'.freeze
4
4
  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.1.4
4
+ version: 4.1.5
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-02-13 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cri
@@ -282,7 +282,6 @@ files:
282
282
  - test/cli/commands/test_check.rb
283
283
  - test/cli/commands/test_compile.rb
284
284
  - test/cli/commands/test_create_site.rb
285
- - test/cli/commands/test_deploy.rb
286
285
  - test/cli/commands/test_help.rb
287
286
  - test/cli/commands/test_info.rb
288
287
  - test/cli/commands/test_prune.rb
@@ -1,191 +0,0 @@
1
- class Nanoc::CLI::Commands::DeployTest < Nanoc::TestCase
2
- def test_deploy
3
- skip_unless_have_command 'rsync'
4
- with_site do |_site|
5
- File.open('nanoc.yaml', 'w') do |io|
6
- io.write "deploy:\n"
7
- io.write " public:\n"
8
- io.write " kind: rsync\n"
9
- io.write ' dst: mydestination'
10
- end
11
-
12
- FileUtils.mkdir_p('output')
13
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
14
-
15
- Nanoc::CLI.run %w( deploy -t public )
16
-
17
- assert File.directory?('mydestination')
18
- assert File.file?('mydestination/blah.html')
19
- end
20
- end
21
-
22
- def test_deploy_with_dry_run
23
- with_site do |_site|
24
- File.open('nanoc.yaml', 'w') do |io|
25
- io.write "deploy:\n"
26
- io.write " public:\n"
27
- io.write " kind: rsync\n"
28
- io.write ' dst: mydestination'
29
- end
30
-
31
- FileUtils.mkdir_p('output')
32
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
33
-
34
- Nanoc::CLI.run %w( deploy -t public -n )
35
-
36
- refute File.directory?('mydestination')
37
- refute File.file?('mydestination/blah.html')
38
- end
39
- end
40
-
41
- def test_deploy_with_list_without_config
42
- with_site do |_site|
43
- FileUtils.mkdir_p('output')
44
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
45
-
46
- ios = capturing_stdio do
47
- Nanoc::CLI.run %w( deploy -L )
48
- end
49
-
50
- assert ios[:stdout].include?('No deployment configurations.')
51
-
52
- refute File.directory?('mydestination')
53
- refute File.file?('mydestination/blah.html')
54
- end
55
- end
56
-
57
- def test_deploy_with_list
58
- with_site do |_site|
59
- File.open('nanoc.yaml', 'w') do |io|
60
- io.write "deploy:\n"
61
- io.write " public:\n"
62
- io.write " kind: rsync\n"
63
- io.write ' dst: mydestination'
64
- end
65
-
66
- FileUtils.mkdir_p('output')
67
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
68
-
69
- ios = capturing_stdio do
70
- Nanoc::CLI.run %w( deploy -L )
71
- end
72
-
73
- assert ios[:stdout].include?('Available deployment configurations:')
74
-
75
- refute File.directory?('mydestination')
76
- refute File.file?('mydestination/blah.html')
77
- end
78
- end
79
-
80
- def test_deploy_with_list_deployers
81
- with_site do |_site|
82
- File.open('nanoc.yaml', 'w') do |io|
83
- io.write "deploy:\n"
84
- io.write " public:\n"
85
- io.write " kind: rsync\n"
86
- io.write ' dst: mydestination'
87
- end
88
-
89
- FileUtils.mkdir_p('output')
90
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
91
-
92
- ios = capturing_stdio do
93
- Nanoc::CLI.run %w( deploy -D )
94
- end
95
-
96
- assert ios[:stdout].include?('Available deployers:')
97
-
98
- refute File.directory?('mydestination')
99
- refute File.file?('mydestination/blah.html')
100
- end
101
- end
102
-
103
- def test_deploy_without_kind
104
- skip_unless_have_command 'rsync'
105
- with_site do |_site|
106
- File.open('nanoc.yaml', 'w') do |io|
107
- io.write "deploy:\n"
108
- io.write " public:\n"
109
- io.write ' dst: mydestination'
110
- end
111
-
112
- FileUtils.mkdir_p('output')
113
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
114
-
115
- ios = capturing_stdio do
116
- Nanoc::CLI.run %w( deploy -t public )
117
- end
118
-
119
- assert ios[:stderr].include?('Warning: The specified deploy target does not have a kind attribute. Assuming rsync.')
120
-
121
- assert File.directory?('mydestination')
122
- assert File.file?('mydestination/blah.html')
123
- end
124
- end
125
-
126
- def test_deploy_without_target_without_default
127
- with_site do |_site|
128
- File.open('nanoc.yaml', 'w') do |io|
129
- io.write "deploy:\n"
130
- io.write " public:\n"
131
- io.write ' dst: mydestination'
132
- end
133
-
134
- FileUtils.mkdir_p('output')
135
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
136
-
137
- capturing_stdio do
138
- err = assert_raises Nanoc::Int::Errors::GenericTrivial do
139
- Nanoc::CLI.run %w( deploy )
140
- end
141
- assert_equal 'The site has no deployment configuration for default.', err.message
142
- end
143
- end
144
- end
145
-
146
- def test_deploy_without_target_with_default
147
- skip_unless_have_command 'rsync'
148
- with_site do |_site|
149
- File.open('nanoc.yaml', 'w') do |io|
150
- io.write "deploy:\n"
151
- io.write " default:\n"
152
- io.write ' dst: mydestination'
153
- end
154
-
155
- FileUtils.mkdir_p('output')
156
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
157
-
158
- capturing_stdio do
159
- Nanoc::CLI.run %w( deploy )
160
- end
161
-
162
- assert File.directory?('mydestination')
163
- assert File.file?('mydestination/blah.html')
164
- end
165
- end
166
-
167
- def test_deploy_with_preprocessor
168
- skip_unless_have_command 'rsync'
169
- with_site do |_site|
170
- File.open('nanoc.yaml', 'w') do |io|
171
- io.write "deploy:\n"
172
- io.write " default:\n"
173
- io.write ' dst: mydestination'
174
- end
175
-
176
- FileUtils.mkdir_p('output')
177
- File.open('output/blah.html', 'w') { |io| io.write 'moo' }
178
-
179
- File.write('Rules', "preprocess do ; @config[:deploy][:default][:dst] = 'otherdestination' ; end\n\n" + File.read('Rules'))
180
-
181
- capturing_stdio do
182
- Nanoc::CLI.run %w( deploy )
183
- end
184
-
185
- refute File.directory?('mydestination')
186
- refute File.file?('mydestination/blah.html')
187
- assert File.directory?('otherdestination')
188
- assert File.file?('otherdestination/blah.html')
189
- end
190
- end
191
- end