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 +4 -4
- data/lib/middleman-core/builder.rb +8 -6
- data/lib/middleman-core/contracts.rb +1 -2
- data/lib/middleman-core/core_extensions/collections/lazy_step.rb +8 -6
- data/lib/middleman-core/core_extensions/i18n.rb +6 -4
- data/lib/middleman-core/profiling.rb +2 -4
- data/lib/middleman-core/renderers/haml.rb +1 -2
- data/lib/middleman-core/sitemap/extensions/ignores.rb +1 -2
- data/lib/middleman-core/sitemap/resource.rb +5 -5
- data/lib/middleman-core/sources/source_watcher.rb +8 -6
- data/lib/middleman-core/template_context.rb +9 -5
- data/lib/middleman-core/util.rb +1 -1
- data/lib/middleman-core/util/binary.rb +1 -1
- data/lib/middleman-core/util/paths.rb +2 -2
- data/lib/middleman-core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c98aa3f3ea938c35613c890737221cfb932ad93a
|
4
|
+
data.tar.gz: 851399237191cee4648d04b50a6ec8fff58a4890
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
77
|
-
clean
|
78
|
-
|
76
|
+
unless @has_error
|
77
|
+
::Middleman::Util.instrument 'builder.clean' do
|
78
|
+
clean! if @cleaning
|
79
|
+
end
|
79
80
|
|
80
|
-
|
81
|
-
|
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(
|
188
|
+
File.chmod(0o644, file)
|
187
189
|
file
|
188
190
|
end
|
189
191
|
|
@@ -24,13 +24,15 @@ module Middleman
|
|
24
24
|
|
25
25
|
original_block = @block
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
@@ -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)
|
@@ -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,
|
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 ==
|
226
|
-
|
227
|
-
|
228
|
-
|
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
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
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
|
-
|
142
|
-
|
143
|
-
.
|
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
|
-
|
148
|
-
|
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
|
|
data/lib/middleman-core/util.rb
CHANGED
@@ -17,7 +17,7 @@ module Middleman
|
|
17
17
|
|
18
18
|
# Facade for ActiveSupport/Notification
|
19
19
|
def instrument(name, payload={}, &block)
|
20
|
-
suffixed_name =
|
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 =
|
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
|
-
|
35
|
+
# The tr call works around a bug in Ruby's Unicode handling
|
36
36
|
::URI.decode(path).sub(%r{^/}, '').tr('', '')
|
37
|
-
|
37
|
+
end
|
38
38
|
memoize :normalize_path
|
39
39
|
|
40
40
|
# This is a separate method from normalize_path in case we
|
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.
|
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-
|
13
|
+
date: 2016-12-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|