middleman-core 4.1.14 → 4.2.0

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
  SHA1:
3
- metadata.gz: be41baeb5666c509a112558e6e10b3108869e01d
4
- data.tar.gz: 016576ba5698a66833f75ddacdfdfb80c34bcb2f
3
+ metadata.gz: c98aa3f3ea938c35613c890737221cfb932ad93a
4
+ data.tar.gz: 851399237191cee4648d04b50a6ec8fff58a4890
5
5
  SHA512:
6
- metadata.gz: f87245bfd9285edb25c299f2a3c901a297b4701e94c6bd8407055a1ab91935c3a99ef5bad142f9735f1fd312a57f4c41d3fb61ee6924253e7b669d08f6ebd9cd
7
- data.tar.gz: 39096c09155127dfb41f828bc75bfb02a2bd87b7478afbbb26738ca1a4b07a917f47329f54d1c4e094b13194d47fc548858683cf9c4297df1a9c5dbf6dec36c4
6
+ metadata.gz: 58499fb20b57b91998a538bbd6a4e178d8d2ac198ba85f224a11fa0812be3b4f36e0be04d6cd80cda9bb02caee1ca878427f08807ebe8f66311f43570a7a958b
7
+ data.tar.gz: 0b7a32895d0a851872b4fa3aff690621cc1b7ffcafb69208181e091419233687ac27c55263d8d95e83c9ccd9fef7f51175a51062abbafa6c40650163d5d5f742
@@ -73,12 +73,14 @@ module Middleman
73
73
 
74
74
  ::Middleman::Profiling.report('build')
75
75
 
76
- ::Middleman::Util.instrument 'builder.clean' do
77
- clean! if @cleaning
78
- end
76
+ unless @has_error
77
+ ::Middleman::Util.instrument 'builder.clean' do
78
+ clean! if @cleaning
79
+ end
79
80
 
80
- ::Middleman::Util.instrument 'builder.after' do
81
- @app.execute_callbacks(:after_build, [self])
81
+ ::Middleman::Util.instrument 'builder.after' do
82
+ @app.execute_callbacks(:after_build, [self])
83
+ end
82
84
  end
83
85
 
84
86
  !@has_error
@@ -183,7 +185,7 @@ module Middleman
183
185
  file.binmode
184
186
  file.write(contents)
185
187
  file.close
186
- File.chmod(0644, file)
188
+ File.chmod(0o644, file)
187
189
  file
188
190
  end
189
191
 
@@ -28,8 +28,7 @@ else
28
28
  end
29
29
 
30
30
  # rubocop:disable MethodName
31
- def Contract(*)
32
- end
31
+ def Contract(*); end
33
32
 
34
33
  class Callable
35
34
  def self.[](*)
@@ -24,13 +24,15 @@ module Middleman
24
24
 
25
25
  original_block = @block
26
26
 
27
- b = if ctx
28
- ::Proc.new do |*args|
29
- ctx.instance_exec(*args, &original_block)
27
+ if original_block
28
+ b = if ctx
29
+ ::Proc.new do |*args|
30
+ ctx.instance_exec(*args, &original_block)
31
+ end
32
+ else
33
+ original_block
30
34
  end
31
- else
32
- original_block
33
- end if original_block
35
+ end
34
36
 
35
37
  data.send(@name, *@args.deep_dup, &b)
36
38
  end
@@ -29,10 +29,12 @@ class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
29
29
  # don't completely reload middleman, I18n.load_path can get
30
30
  # polluted with paths from other test app directories that don't
31
31
  # exist anymore.
32
- app.after_configuration_eval do
33
- ::I18n.load_path.delete_if { |path| path =~ %r{tmp/aruba} }
34
- ::I18n.reload!
35
- end if ENV['TEST']
32
+ if ENV['TEST']
33
+ app.after_configuration_eval do
34
+ ::I18n.load_path.delete_if { |path| path =~ %r{tmp/aruba} }
35
+ ::I18n.reload!
36
+ end
37
+ end
36
38
  end
37
39
 
38
40
  def after_configuration
@@ -20,11 +20,9 @@ module Middleman
20
20
 
21
21
  # A profiler that does nothing. The default.
22
22
  class NullProfiler
23
- def start
24
- end
23
+ def start; end
25
24
 
26
- def report(_)
27
- end
25
+ def report(_); end
28
26
  end
29
27
 
30
28
  # A profiler that uses ruby-prof
@@ -26,8 +26,7 @@ module Middleman
26
26
  @context = @options[:context] if @options.key?(:context)
27
27
  end
28
28
 
29
- def prepare
30
- end
29
+ def prepare; end
31
30
 
32
31
  def evaluate(scope, locals, &block)
33
32
  options = {}.merge!(@options).merge!(filename: eval_file, line: line, context: @context || scope)
@@ -47,7 +47,7 @@ module Middleman
47
47
  end
48
48
  end
49
49
 
50
- def ignored?(match_path)
50
+ def ignored?(_match_path)
51
51
  raise NotImplementedError
52
52
  end
53
53
  end
@@ -79,7 +79,6 @@ module Middleman
79
79
  block.call(match_path)
80
80
  end
81
81
  end
82
-
83
82
  end
84
83
  end
85
84
  end
@@ -85,7 +85,7 @@ module Middleman
85
85
  file_descriptor && file_descriptor[:full_path].to_s
86
86
  end
87
87
 
88
- Contract Or[Symbol, String, Fixnum]
88
+ Contract Or[Symbol, String, Integer]
89
89
  def page_id
90
90
  metadata[:page][:id] || make_implicit_page_id(destination_path)
91
91
  end
@@ -222,10 +222,10 @@ module Middleman
222
222
  return prok.call(path)
223
223
  end
224
224
 
225
- basename = if ext == ".html"
226
- File.basename(path, ext)
227
- else
228
- File.basename(path)
225
+ basename = if ext == '.html'
226
+ File.basename(path, ext)
227
+ else
228
+ File.basename(path)
229
229
  end
230
230
 
231
231
  # Remove leading dot or slash if present
@@ -167,7 +167,7 @@ module Middleman
167
167
  return if @disable_watcher || @listener || @waiting_for_existence
168
168
 
169
169
  config = {
170
- force_polling: @force_polling,
170
+ force_polling: @force_polling
171
171
  }
172
172
 
173
173
  config[:wait_for_delay] = @wait_for_delay.try(:to_f) || 0.5
@@ -284,11 +284,13 @@ module Middleman
284
284
  logger.debug "== Deletion (#{f[:types].inspect}): #{f[:relative_path]}"
285
285
  end
286
286
 
287
- execute_callbacks(:on_change, [
288
- valid_updates,
289
- valid_removes,
290
- self
291
- ]) unless valid_updates.empty? && valid_removes.empty?
287
+ unless valid_updates.empty? && valid_removes.empty?
288
+ execute_callbacks(:on_change, [
289
+ valid_updates,
290
+ valid_removes,
291
+ self
292
+ ])
293
+ end
292
294
 
293
295
  [valid_updates, valid_removes]
294
296
  end
@@ -138,14 +138,18 @@ module Middleman
138
138
  relative_dir_no_underscore = current_dir + Pathname(non_root_no_underscore)
139
139
  end
140
140
 
141
- lookup_stack.push [relative_dir.to_s,
142
- { preferred_engine: resource.file_descriptor[:relative_path]
143
- .extname[1..-1].to_sym }] if relative_dir
141
+ if relative_dir
142
+ lookup_stack.push [relative_dir.to_s,
143
+ { preferred_engine: resource.file_descriptor[:relative_path]
144
+ .extname[1..-1].to_sym }]
145
+ end
144
146
  lookup_stack.push [non_root]
145
147
  lookup_stack.push [non_root,
146
148
  { try_static: try_static }]
147
- lookup_stack.push [relative_dir_no_underscore.to_s,
148
- { try_static: try_static }] if relative_dir_no_underscore
149
+ if relative_dir_no_underscore
150
+ lookup_stack.push [relative_dir_no_underscore.to_s,
151
+ { try_static: try_static }]
152
+ end
149
153
  lookup_stack.push [non_root_no_underscore,
150
154
  { try_static: try_static }]
151
155
 
@@ -17,7 +17,7 @@ module Middleman
17
17
 
18
18
  # Facade for ActiveSupport/Notification
19
19
  def instrument(name, payload={}, &block)
20
- suffixed_name = (name =~ /\.middleman$/) ? name.dup : "#{name}.middleman"
20
+ suffixed_name = name =~ /\.middleman$/ ? name.dup : "#{name}.middleman"
21
21
  ::ActiveSupport::Notifications.instrument(suffixed_name, payload, &block)
22
22
  end
23
23
  end
@@ -30,7 +30,7 @@ module Middleman
30
30
  elsif ::Tilt.registered?(ext.sub('.', ''))
31
31
  false
32
32
  else
33
- dot_ext = (ext.to_s[0] == '.') ? ext.dup : ".#{ext}"
33
+ dot_ext = ext.to_s[0] == '.' ? ext.dup : ".#{ext}"
34
34
 
35
35
  if mime = ::Rack::Mime.mime_type(dot_ext, nil)
36
36
  !nonbinary_mime?(mime)
@@ -32,9 +32,9 @@ module Middleman
32
32
  # @return [String]
33
33
  Contract String => String
34
34
  def normalize_path(path)
35
- # The tr call works around a bug in Ruby's Unicode handling
35
+ # The tr call works around a bug in Ruby's Unicode handling
36
36
  ::URI.decode(path).sub(%r{^/}, '').tr('', '')
37
- end
37
+ end
38
38
  memoize :normalize_path
39
39
 
40
40
  # This is a separate method from normalize_path in case we
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  # Current Version
3
3
  # @return [String]
4
- VERSION = '4.1.14'.freeze unless const_defined?(:VERSION)
4
+ VERSION = '4.2.0'.freeze unless const_defined?(:VERSION)
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.14
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Reynolds
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-12-03 00:00:00.000000000 Z
13
+ date: 2016-12-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler