middleman-core 3.0.0.rc.3 → 3.0.0.rc.4
Sign up to get free protection for your applications and to get access to all the features.
- data/features/implied_extensions.feature +18 -1
- data/fixtures/external-helpers/helpers/{three_helper.rb → derp.rb} +1 -1
- data/fixtures/external-helpers/helpers/{four_helper.rb → four_helpers.rb} +1 -1
- data/fixtures/external-helpers/helpers/yet_another_thingy.rb +3 -0
- data/lib/middleman-core/application.rb +8 -0
- data/lib/middleman-core/core_extensions/external_helpers.rb +1 -1
- data/lib/middleman-core/core_extensions/rendering.rb +7 -3
- data/lib/middleman-core/renderers/less.rb +0 -1
- data/lib/middleman-core/version.rb +1 -1
- metadata +9 -9
- data/fixtures/external-helpers/helpers/two_helper.rb +0 -3
@@ -2,6 +2,8 @@ Feature: Use default extensions when user doesn't supply them
|
|
2
2
|
|
3
3
|
Scenario: Default extensions preview
|
4
4
|
Given the Server is running at "implied-extensions-app"
|
5
|
+
When I go to "/"
|
6
|
+
Then I should see "hello: world"
|
5
7
|
When I go to "/index.html"
|
6
8
|
Then I should see "hello: world"
|
7
9
|
When I go to "/index.erb"
|
@@ -9,13 +11,15 @@ Feature: Use default extensions when user doesn't supply them
|
|
9
11
|
When I go to "/index"
|
10
12
|
Then I should see "File Not Found"
|
11
13
|
|
12
|
-
Scenario:
|
14
|
+
Scenario: Override erb extension
|
13
15
|
Given a fixture app "implied-extensions-app"
|
14
16
|
And a file named "config.rb" with:
|
15
17
|
"""
|
16
18
|
template_extensions :erb => :htm
|
17
19
|
"""
|
18
20
|
And the Server is running
|
21
|
+
When I go to "/"
|
22
|
+
Then I should see "File Not Found"
|
19
23
|
When I go to "/index.htm"
|
20
24
|
Then I should see "hello: world"
|
21
25
|
When I go to "/index.erb"
|
@@ -24,6 +28,19 @@ Feature: Use default extensions when user doesn't supply them
|
|
24
28
|
Then I should see "File Not Found"
|
25
29
|
When I go to "/index.html"
|
26
30
|
Then I should see "File Not Found"
|
31
|
+
|
32
|
+
Scenario: Override erb extension
|
33
|
+
Given a fixture app "implied-extensions-app"
|
34
|
+
And a file named "config.rb" with:
|
35
|
+
"""
|
36
|
+
set :index_file, "index.htm"
|
37
|
+
template_extensions :erb => :htm
|
38
|
+
"""
|
39
|
+
And the Server is running
|
40
|
+
When I go to "/"
|
41
|
+
Then I should see "hello: world"
|
42
|
+
When I go to "/index.htm"
|
43
|
+
Then I should see "hello: world"
|
27
44
|
|
28
45
|
Scenario: Default extensions build
|
29
46
|
Given a fixture app "implied-extensions-app"
|
@@ -217,6 +217,14 @@ module Middleman
|
|
217
217
|
logging
|
218
218
|
end
|
219
219
|
|
220
|
+
# Work around this bug: http://bugs.ruby-lang.org/issues/4521
|
221
|
+
# where Ruby will call to_s/inspect while printing exception
|
222
|
+
# messages, which can take a long time (minutes at full CPU)
|
223
|
+
# if the object is huge or has cyclic references, like this.
|
224
|
+
def to_s
|
225
|
+
"the Middleman application context"
|
226
|
+
end
|
227
|
+
|
220
228
|
# Expand a path to include the index file if it's a directory
|
221
229
|
#
|
222
230
|
# @private
|
@@ -10,7 +10,7 @@ module Middleman
|
|
10
10
|
def registered(app)
|
11
11
|
# Setup a default helpers paths
|
12
12
|
app.set :helpers_dir, "helpers"
|
13
|
-
app.set :helpers_filename_glob, "
|
13
|
+
app.set :helpers_filename_glob, "**/*.rb"
|
14
14
|
app.set :helpers_filename_to_module_name_proc, Proc.new { |filename|
|
15
15
|
basename = File.basename(filename, File.extname(filename))
|
16
16
|
basename.camelcase
|
@@ -115,9 +115,13 @@ module Middleman
|
|
115
115
|
# handles cases like `style.css.sass.erb`
|
116
116
|
content = nil
|
117
117
|
while ::Tilt[path]
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
begin
|
119
|
+
opts[:template_body] = content if content
|
120
|
+
content = render_individual_file(path, locs, opts, context)
|
121
|
+
path = File.basename(path, File.extname(path))
|
122
|
+
rescue LocalJumpError => e
|
123
|
+
raise "Tried to render a layout (calls yield) at #{path} like it was a template. Non-default layouts need to be in #{source}/layouts."
|
124
|
+
end
|
121
125
|
end
|
122
126
|
|
123
127
|
# Certain output file types don't use layouts
|
@@ -33,7 +33,6 @@ module Middleman
|
|
33
33
|
if ::Less.const_defined? :Engine
|
34
34
|
@engine = ::Less::Engine.new(data)
|
35
35
|
else
|
36
|
-
$stderr.puts "HEEERE"
|
37
36
|
parser = ::Less::Parser.new(options.merge :filename => eval_file, :line => line, :paths => [".", File.dirname(eval_file)])
|
38
37
|
@engine = parser.parse(data)
|
39
38
|
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: 3.0.0.rc.
|
4
|
+
version: 3.0.0.rc.4
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-07-
|
13
|
+
date: 2012-07-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -237,10 +237,10 @@ files:
|
|
237
237
|
- fixtures/extensionless-text-files-app/source/README
|
238
238
|
- fixtures/extensionless-text-files-app/source/index.html
|
239
239
|
- fixtures/external-helpers/config.rb
|
240
|
-
- fixtures/external-helpers/helpers/
|
240
|
+
- fixtures/external-helpers/helpers/derp.rb
|
241
|
+
- fixtures/external-helpers/helpers/four_helpers.rb
|
241
242
|
- fixtures/external-helpers/helpers/one_helper.rb
|
242
|
-
- fixtures/external-helpers/helpers/
|
243
|
-
- fixtures/external-helpers/helpers/two_helper.rb
|
243
|
+
- fixtures/external-helpers/helpers/yet_another_thingy.rb
|
244
244
|
- fixtures/external-helpers/lib/hello_helper.rb
|
245
245
|
- fixtures/external-helpers/source/automatic.html.erb
|
246
246
|
- fixtures/external-helpers/source/index.html.erb
|
@@ -530,7 +530,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
530
530
|
version: '0'
|
531
531
|
segments:
|
532
532
|
- 0
|
533
|
-
hash:
|
533
|
+
hash: 362783579195130288
|
534
534
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
535
535
|
none: false
|
536
536
|
requirements:
|
@@ -643,10 +643,10 @@ test_files:
|
|
643
643
|
- fixtures/extensionless-text-files-app/source/README
|
644
644
|
- fixtures/extensionless-text-files-app/source/index.html
|
645
645
|
- fixtures/external-helpers/config.rb
|
646
|
-
- fixtures/external-helpers/helpers/
|
646
|
+
- fixtures/external-helpers/helpers/derp.rb
|
647
|
+
- fixtures/external-helpers/helpers/four_helpers.rb
|
647
648
|
- fixtures/external-helpers/helpers/one_helper.rb
|
648
|
-
- fixtures/external-helpers/helpers/
|
649
|
-
- fixtures/external-helpers/helpers/two_helper.rb
|
649
|
+
- fixtures/external-helpers/helpers/yet_another_thingy.rb
|
650
650
|
- fixtures/external-helpers/lib/hello_helper.rb
|
651
651
|
- fixtures/external-helpers/source/automatic.html.erb
|
652
652
|
- fixtures/external-helpers/source/index.html.erb
|