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.
@@ -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: Default extensions preview
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"
@@ -1,3 +1,3 @@
1
- module ThreeHelper
1
+ module Derp
2
2
  def three; "Three"; end
3
3
  end
@@ -1,3 +1,3 @@
1
- module FourHelper
1
+ module FourHelpers
2
2
  def four; "Four"; end
3
3
  end
@@ -0,0 +1,3 @@
1
+ module YetAnotherThingy
2
+ def two; "Two"; end
3
+ end
@@ -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, "**/*_helper.rb"
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
- opts[:template_body] = content if content
119
- content = render_individual_file(path, locs, opts, context)
120
- path = File.basename(path, File.extname(path))
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
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  # Current Version
3
3
  # @return [String]
4
- VERSION = '3.0.0.rc.3' unless const_defined?(:VERSION)
4
+ VERSION = '3.0.0.rc.4' 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: 3.0.0.rc.3
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-03 00:00:00.000000000 Z
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/four_helper.rb
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/three_helper.rb
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: 4571590905911767496
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/four_helper.rb
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/three_helper.rb
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
@@ -1,3 +0,0 @@
1
- module TwoHelper
2
- def two; "Two"; end
3
- end