middleman-core 3.0.0.beta.3 → 3.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/bin/middleman +32 -30
  2. data/features/clean_build.feature +0 -13
  3. data/features/extensionless_text_files.feature +2 -34
  4. data/features/front-matter.feature +27 -6
  5. data/features/frontmatter_page_settings.feature +6 -15
  6. data/features/ignore.feature +1 -78
  7. data/features/sitemap_traversal.feature +5 -5
  8. data/features/support/env.rb +3 -0
  9. data/features/wildcard_page_helper.feature +0 -9
  10. data/fixtures/frontmatter-app/source/front-matter-encoding.html.erb +7 -0
  11. data/fixtures/frontmatter-app/source/{front-matter.html.erb → front-matter-line-2.html.erb} +0 -1
  12. data/fixtures/frontmatter-app/source/json-front-matter-2.php.erb +2 -2
  13. data/fixtures/frontmatter-app/source/json-front-matter-auto.erb +2 -2
  14. data/fixtures/frontmatter-app/source/json-front-matter-encoding.html.erb +7 -0
  15. data/fixtures/frontmatter-app/source/json-front-matter-line-2.html.erb +7 -0
  16. data/fixtures/frontmatter-app/source/json-front-matter.html.erb +2 -2
  17. data/fixtures/frontmatter-settings-app/config.rb +1 -3
  18. data/fixtures/indexable-app/config.rb +0 -4
  19. data/fixtures/traversal-app/config.rb +0 -2
  20. data/lib/middleman-core/application.rb +7 -48
  21. data/lib/middleman-core/cli.rb +49 -46
  22. data/lib/middleman-core/cli/build.rb +62 -30
  23. data/lib/middleman-core/cli/extension.rb +1 -1
  24. data/lib/middleman-core/cli/server.rb +4 -3
  25. data/lib/middleman-core/core_extensions.rb +1 -10
  26. data/lib/middleman-core/core_extensions/extensions.rb +14 -9
  27. data/lib/middleman-core/core_extensions/file_watcher.rb +44 -46
  28. data/lib/middleman-core/core_extensions/front_matter.rb +27 -11
  29. data/lib/middleman-core/core_extensions/rendering.rb +74 -7
  30. data/lib/middleman-core/core_extensions/request.rb +32 -33
  31. data/lib/middleman-core/core_extensions/routing.rb +5 -3
  32. data/lib/middleman-core/extensions.rb +11 -21
  33. data/lib/middleman-core/preview_server.rb +3 -3
  34. data/lib/middleman-core/renderers/coffee_script.rb +41 -0
  35. data/lib/middleman-core/renderers/haml.rb +30 -0
  36. data/lib/middleman-core/renderers/less.rb +46 -0
  37. data/lib/middleman-core/renderers/liquid.rb +35 -0
  38. data/lib/middleman-core/renderers/markdown.rb +57 -0
  39. data/lib/middleman-core/renderers/redcarpet.rb +38 -0
  40. data/lib/middleman-core/renderers/sass.rb +85 -0
  41. data/lib/middleman-core/renderers/slim.rb +30 -0
  42. data/lib/middleman-core/sitemap/resource.rb +6 -2
  43. data/lib/middleman-core/step_definitions/middleman_steps.rb +2 -2
  44. data/lib/middleman-core/templates/extension/gemspec +1 -1
  45. data/lib/middleman-core/templates/extension/lib/lib.rb +1 -1
  46. data/lib/middleman-core/util.rb +4 -0
  47. data/lib/middleman-core/version.rb +1 -9
  48. data/middleman-core.gemspec +3 -7
  49. metadata +146 -312
  50. data/features/asset_host.feature +0 -7
  51. data/features/automatic_image_sizes.feature +0 -16
  52. data/features/content_for.feature +0 -6
  53. data/features/directory_index.feature +0 -66
  54. data/features/former_padrino_helpers.feature +0 -12
  55. data/features/helpers_auto_javascript_include_tag.feature +0 -27
  56. data/features/helpers_auto_stylesheet_link_tag.feature +0 -27
  57. data/features/helpers_lorem.feature +0 -6
  58. data/features/helpers_page_classes.feature +0 -17
  59. data/features/helpers_relative_link_to.feature +0 -68
  60. data/features/i18n_builder.feature +0 -121
  61. data/features/i18n_preview.feature +0 -113
  62. data/features/instance_vars.feature +0 -18
  63. data/features/nested_layouts.feature +0 -24
  64. data/features/partials.feature +0 -46
  65. data/fixtures/asset-host-app/config.rb +0 -6
  66. data/fixtures/asset-host-app/source/.htaccess +0 -1
  67. data/fixtures/asset-host-app/source/asset_host.html.erb +0 -1
  68. data/fixtures/asset-host-app/source/images/blank.gif +0 -0
  69. data/fixtures/auto-css-app/config.rb +0 -11
  70. data/fixtures/auto-css-app/source/auto-css.html.erb +0 -1
  71. data/fixtures/auto-css-app/source/auto-css/auto-css.html.erb +0 -1
  72. data/fixtures/auto-css-app/source/auto-css/index.html.erb +0 -1
  73. data/fixtures/auto-css-app/source/auto-css/sub/auto-css.html.erb +0 -1
  74. data/fixtures/auto-css-app/source/stylesheets/auto-css.css +0 -3
  75. data/fixtures/auto-css-app/source/stylesheets/auto-css/auto-css.css +0 -3
  76. data/fixtures/auto-css-app/source/stylesheets/auto-css/index.css +0 -0
  77. data/fixtures/auto-css-app/source/stylesheets/auto-css/sub/auto-css.css +0 -3
  78. data/fixtures/auto-js-app/config.rb +0 -11
  79. data/fixtures/auto-js-app/source/auto-js.html.erb +0 -1
  80. data/fixtures/auto-js-app/source/auto-js/auto-js.html.erb +0 -1
  81. data/fixtures/auto-js-app/source/auto-js/index.html.erb +0 -1
  82. data/fixtures/auto-js-app/source/auto-js/sub/auto-js.html.erb +0 -1
  83. data/fixtures/auto-js-app/source/javascripts/auto-js.js +0 -1
  84. data/fixtures/auto-js-app/source/javascripts/auto-js/auto-js.js +0 -1
  85. data/fixtures/auto-js-app/source/javascripts/auto-js/index.js +0 -1
  86. data/fixtures/auto-js-app/source/javascripts/auto-js/sub/auto-js.js +0 -1
  87. data/fixtures/automatic-image-size-app/config.rb +0 -0
  88. data/fixtures/automatic-image-size-app/source/auto-image-sizes.html.erb +0 -1
  89. data/fixtures/automatic-image-size-app/source/images/blank.gif +0 -0
  90. data/fixtures/clean-dir-app/config.rb +0 -2
  91. data/fixtures/clean-dir-app/source/about.html +0 -1
  92. data/fixtures/content-for-app/config.rb +0 -3
  93. data/fixtures/content-for-app/source/content_for_erb.html.erb +0 -5
  94. data/fixtures/content-for-app/source/layouts/content_for.erb +0 -4
  95. data/fixtures/different-engine-partial/config.rb +0 -0
  96. data/fixtures/different-engine-partial/source/index.html.erb +0 -1
  97. data/fixtures/different-engine-partial/source/layouts/layout.erb +0 -7
  98. data/fixtures/different-engine-partial/source/shared/_footer.str +0 -1
  99. data/fixtures/different-engine-partial/source/shared/_header.erb +0 -1
  100. data/fixtures/frontmatter-settings-app/source/no_index.html.erb +0 -5
  101. data/fixtures/i18n-alt-root-app/locales/en.yml +0 -4
  102. data/fixtures/i18n-alt-root-app/locales/es.yml +0 -7
  103. data/fixtures/i18n-alt-root-app/source/lang_data/hello.html.erb +0 -1
  104. data/fixtures/i18n-alt-root-app/source/lang_data/index.html.erb +0 -1
  105. data/fixtures/i18n-alt-root-app/source/layout.erb +0 -1
  106. data/fixtures/i18n-test-app/locales/en.yml +0 -4
  107. data/fixtures/i18n-test-app/locales/es.yml +0 -7
  108. data/fixtures/i18n-test-app/source/layout.erb +0 -1
  109. data/fixtures/i18n-test-app/source/localizable/hello.html.erb +0 -1
  110. data/fixtures/i18n-test-app/source/localizable/index.html.erb +0 -1
  111. data/fixtures/instance-vars-app/config.rb +0 -0
  112. data/fixtures/instance-vars-app/source/_vartial.erb +0 -5
  113. data/fixtures/instance-vars-app/source/instance-var-set.html.erb +0 -2
  114. data/fixtures/instance-vars-app/source/layout.erb +0 -3
  115. data/fixtures/instance-vars-app/source/no-instance-var.html.erb +0 -1
  116. data/fixtures/lorem-app/config.rb +0 -1
  117. data/fixtures/lorem-app/source/lorem.html.erb +0 -13
  118. data/fixtures/nested-layout-app/config.rb +0 -1
  119. data/fixtures/nested-layout-app/source/data-one.html.erb +0 -5
  120. data/fixtures/nested-layout-app/source/data-two.html.erb +0 -5
  121. data/fixtures/nested-layout-app/source/index.html.erb +0 -1
  122. data/fixtures/nested-layout-app/source/layouts/inner.erb +0 -4
  123. data/fixtures/nested-layout-app/source/layouts/master.erb +0 -3
  124. data/fixtures/nested-layout-app/source/layouts/outer.erb +0 -4
  125. data/fixtures/padrino-helpers-app/config.rb +0 -0
  126. data/fixtures/padrino-helpers-app/source/former_padrino_test.html.erb +0 -5
  127. data/fixtures/page-classes-app/config.rb +0 -4
  128. data/fixtures/page-classes-app/source/page-classes.html.erb +0 -1
  129. data/fixtures/page-classes-app/source/sub1/page-classes.html.erb +0 -1
  130. data/fixtures/page-classes-app/source/sub1/sub2/page-classes.html.erb +0 -1
  131. data/fixtures/partials-app/config.rb +0 -0
  132. data/fixtures/partials-app/source/_locals.erb +0 -1
  133. data/fixtures/partials-app/source/_main.erb +0 -1
  134. data/fixtures/partials-app/source/_main.str +0 -1
  135. data/fixtures/partials-app/source/index.html.erb +0 -3
  136. data/fixtures/partials-app/source/locals.html.erb +0 -1
  137. data/fixtures/partials-app/source/second.html.str +0 -3
  138. data/fixtures/partials-app/source/shared/_footer.erb +0 -1
  139. data/fixtures/partials-app/source/shared/_header.erb +0 -1
  140. data/fixtures/partials-app/source/shared/snippet.erb +0 -1
  141. data/fixtures/partials-app/source/sub/_local.erb +0 -1
  142. data/fixtures/partials-app/source/sub/index.html.erb +0 -3
  143. data/fixtures/partials-app/source/using_snippet.html.erb +0 -1
  144. data/fixtures/wildcard-directory-index-app/config.rb +0 -2
  145. data/fixtures/wildcard-directory-index-app/source/admin/index.html.erb +0 -1
  146. data/fixtures/wildcard-directory-index-app/source/admin/page.html.erb +0 -1
  147. data/fixtures/wildcard-directory-index-app/source/index.html.erb +0 -1
  148. data/fixtures/wildcard-directory-index-app/source/layouts/admin.erb +0 -2
  149. data/fixtures/wildcard-directory-index-app/source/layouts/layout.erb +0 -2
  150. data/lib/middleman-core/core_extensions/assets.rb +0 -43
  151. data/lib/middleman-core/core_extensions/default_helpers.rb +0 -172
  152. data/lib/middleman-core/core_extensions/i18n.rb +0 -146
  153. data/lib/middleman-core/extensions/asset_host.rb +0 -47
  154. data/lib/middleman-core/extensions/automatic_image_sizes.rb +0 -57
  155. data/lib/middleman-core/extensions/automatic_image_sizes/fastimage.rb +0 -287
  156. data/lib/middleman-core/extensions/directory_indexes.rb +0 -54
  157. data/lib/middleman-core/extensions/lorem.rb +0 -195
data/bin/middleman CHANGED
@@ -4,56 +4,58 @@
4
4
  libdir = File.expand_path(File.join(File.dirname(File.dirname(__FILE__)), "lib"))
5
5
  $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
6
6
 
7
- # Setup RubyGems
8
- require "rubygems"
7
+ moredir = File.expand_path(File.join(File.dirname(File.dirname(libdir)), "middleman-more", "lib", "middleman-more"))
8
+ $LOAD_PATH.unshift(moredir) unless $LOAD_PATH.include?(moredir)
9
9
 
10
10
  # Core Pathname library used for traversal
11
11
  require "pathname"
12
12
 
13
13
  # Recursive method to find config.rb
14
- def locate_middleman_root!(cwd = Pathname.new(Dir.pwd))
15
- return cwd.to_s if File.exists?(File.join(cwd, 'config.rb'))
14
+ def locate_root(cwd = Pathname.new(Dir.pwd))
15
+ return cwd.to_s if (cwd + 'config.rb').exist?
16
16
  return false if cwd.root?
17
- locate_middleman_root!(cwd.parent)
17
+ locate_root(cwd.parent)
18
18
  end
19
19
 
20
20
  # Only look for config.rb if MM_ROOT isn't set
21
- if !ENV["MM_ROOT"] && found_path = locate_middleman_root!
21
+ if !ENV["MM_ROOT"] && found_path = locate_root
22
22
  ENV["MM_ROOT"] = found_path
23
23
  end
24
24
 
25
25
  # If we've found the root, try to setup Bundler
26
26
  if ENV["MM_ROOT"]
27
27
 
28
- # Set up gems listed in the Gemfile.
29
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('Gemfile', ENV["MM_ROOT"])
30
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
31
- end
32
-
33
- # Default command is server
34
- ARGV.unshift("server") if ARGV.length < 1 || ARGV.first.include?("-")
35
-
36
- begin
37
- # Local
38
- require File.expand_path(File.join(File.dirname(File.dirname(libdir)), "middleman-more", "lib", "middleman-more"))
39
- rescue LoadError
40
- begin
41
- # Rubygems
42
- require "middleman-more"
43
- rescue LoadError
44
- # Require Middleman
45
- require 'middleman-core'
28
+ root_gemfile = File.expand_path('Gemfile', ENV["MM_ROOT"])
29
+ ENV['BUNDLE_GEMFILE'] ||= root_gemfile
30
+
31
+ if !File.exists?(ENV['BUNDLE_GEMFILE'])
32
+ git_gemfile = Pathname.new(__FILE__).expand_path.parent.parent.parent + "Gemfile"
33
+ ENV['BUNDLE_GEMFILE'] = git_gemfile.to_s
46
34
  end
35
+
36
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
47
37
  end
48
38
 
49
39
  # Automatically discover extensions in RubyGems
50
- Middleman.load_extensions_in_path
40
+ require "middleman-core/extensions"
41
+ ::Middleman.load_extensions_in_path
51
42
 
52
43
  require "middleman-core/cli"
53
44
 
54
- # Change directory to the root
55
- Dir.chdir(ENV["MM_ROOT"] || Dir.pwd) do
56
-
57
- # Start the CLI
58
- Middleman::Cli::Base.start
45
+ # Change flag to a module
46
+ ARGV.unshift("help") if ARGV.delete("--help")
47
+
48
+ # Default command is server
49
+ if ARGV[0] != "help" && (ARGV.length < 1 || ARGV.first.include?("-"))
50
+ ARGV.unshift("server")
59
51
  end
52
+
53
+ # Start the CLI
54
+ if ENV["MM_ROOT"]
55
+ # Change directory to the root
56
+ Dir.chdir(ENV["MM_ROOT"]) do
57
+ Middleman::Cli::Base.start
58
+ end
59
+ else
60
+ Middleman::Cli::Base.start
61
+ end
@@ -16,19 +16,6 @@ Feature: Build Clean
16
16
  | build/should_be_ignored3.html |
17
17
  And the file "build/index.html" should contain "Comment in layout"
18
18
 
19
- Scenario: Clean an app with directory indexes
20
- Given a successfully built app at "clean-dir-app"
21
- Then the following files should exist:
22
- | build/about/index.html |
23
- Given a successfully built app at "clean-dir-app" with flags "--clean"
24
- Then the following files should exist:
25
- | build/about/index.html |
26
-
27
- Scenario: Clean build an app that's never been built
28
- Given a successfully built app at "clean-dir-app" with flags "--clean"
29
- Then the following files should exist:
30
- | build/about/index.html |
31
-
32
19
  Scenario: Clean build an app with newly ignored files and a nested output directory
33
20
  Given a built app at "clean-nested-app"
34
21
  Then a directory named "sub/dir" should exist
@@ -1,46 +1,14 @@
1
1
  Feature: Text Files Without Extensions Should Build and Preview
2
2
 
3
3
  Scenario: Building Text Files without directory indexes
4
- Given a fixture app "extensionless-text-files-app"
5
- And a file named "config.rb" with:
6
- """
7
- """
8
- And a successfully built app at "extensionless-text-files-app"
4
+ Given a successfully built app at "extensionless-text-files-app"
9
5
  When I cd to "build"
10
6
  Then the following files should exist:
11
7
  | CNAME |
12
8
  | LICENSE |
13
9
  | README |
14
-
15
- Scenario: Building Text Files with directory indexes
16
- Given a fixture app "extensionless-text-files-app"
17
- And a file named "config.rb" with:
18
- """
19
- activate :directory_indexes
20
- """
21
- And a successfully built app at "extensionless-text-files-app"
22
- When I cd to "build"
23
- Then the following files should exist:
24
- | CNAME |
25
- | LICENSE |
26
- | README |
27
- Then the following files should not exist:
28
- | CNAME/index.html |
29
- | LICENSE/index.html |
30
- | README/index.html |
31
10
 
32
- Scenario: Previewing Text Files without directory indexes
33
- Given "directory_indexes" feature is "disabled"
34
- Given the Server is running at "extensionless-text-files-app"
35
- When I go to "/CNAME"
36
- Then I should see "test.github.com"
37
- When I go to "/LICENSE"
38
- Then I should see "You have the right to remain classy."
39
- When I go to "/README"
40
- Then I should see "Bork bork bork"
41
-
42
- Scenario: Previewing Text Files with directory indexes
43
- Given "directory_indexes" feature is "enabled"
11
+ Scenario: Previewing Text Files
44
12
  Given the Server is running at "extensionless-text-files-app"
45
13
  When I go to "/CNAME"
46
14
  Then I should see "test.github.com"
@@ -6,26 +6,47 @@ Feature: YAML Front Matter
6
6
  When I go to "/front-matter-auto.html"
7
7
  Then I should see "<h1>This is the title</h1>"
8
8
  Then I should not see "---"
9
- When I go to "/front-matter.html"
10
- Then I should see "<h1>This is the title</h1>"
11
- Then I should not see "---"
12
9
  When I go to "/front-matter-2.php"
13
10
  Then I should see "<h1>This is the title</h1>"
14
11
  Then I should see "<?php"
15
12
  Then I should not see "---"
13
+
14
+ Scenario: YAML not on first line, no encoding
15
+ Given the Server is running at "frontmatter-app"
16
+ When I go to "/front-matter-line-2.html"
17
+ Then I should see "<h1></h1>"
18
+ Then I should see "---"
19
+
20
+ Scenario: YAML not on first line, with encoding
21
+ Given the Server is running at "frontmatter-app"
22
+ When I go to "/front-matter-encoding.html"
23
+ Then I should see "<h1>This is the title</h1>"
24
+ Then I should not see "---"
16
25
 
17
26
  Scenario: Rendering html (json)
18
27
  Given the Server is running at "frontmatter-app"
19
28
  When I go to "/json-front-matter-auto.html"
20
29
  Then I should see "<h1>This is the title</h1>"
21
- Then I should not see "{"
30
+ Then I should not see ";;;"
22
31
  When I go to "/json-front-matter.html"
23
32
  Then I should see "<h1>This is the title</h1>"
24
- Then I should not see "{"
33
+ Then I should not see ";;;"
25
34
  When I go to "/json-front-matter-2.php"
26
35
  Then I should see "<h1>This is the title</h1>"
27
36
  Then I should see "<?php"
28
- Then I should not see "{"
37
+ Then I should not see ";;;"
38
+
39
+ Scenario: JSON not on first line, no encoding
40
+ Given the Server is running at "frontmatter-app"
41
+ When I go to "/json-front-matter-line-2.html"
42
+ Then I should see "<h1></h1>"
43
+ Then I should see ";;;"
44
+
45
+ Scenario: JSON not on first line, with encoding
46
+ Given the Server is running at "frontmatter-app"
47
+ When I go to "/json-front-matter-encoding.html"
48
+ Then I should see "<h1>This is the title</h1>"
49
+ Then I should not see ";;;"
29
50
 
30
51
  Scenario: A template changes frontmatter during preview
31
52
  Given the Server is running at "frontmatter-app"
@@ -2,33 +2,24 @@ Feature: Setting page settings through frontmatter
2
2
  Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (build)
3
3
  Given a successfully built app at "frontmatter-settings-app"
4
4
  Then the following files should exist:
5
- | build/proxied/index.html |
6
- | build/no_index.html |
7
- And the file "build/alternate_layout/index.html" should contain "Alternate layout"
5
+ | build/proxied.html |
6
+ And the file "build/alternate_layout.html" should contain "Alternate layout"
8
7
  And the following files should not exist:
9
- | build/ignored/index.html |
10
- | build/no_index/index.html |
11
-
8
+ | build/ignored.html |
12
9
 
13
10
  Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (preview)
14
11
  Given the Server is running at "frontmatter-settings-app"
15
- # When I go to "/proxied/"
16
- # Then I should not see "File Not Found"
17
- When I go to "/no_index.html"
18
- Then I should not see "File Not Found"
19
- When I go to "/alternate_layout/"
12
+ When I go to "/alternate_layout.html"
20
13
  Then I should not see "File Not Found"
21
14
  And I should see "Alternate layout"
22
15
  When I go to "/ignored.html"
23
16
  Then I should see "File Not Found"
24
17
  When I go to "/ignored/index.html"
25
18
  Then I should see "File Not Found"
26
- When I go to "/no_index/index.html"
27
- Then I should see "File Not Found"
28
19
 
29
20
  Scenario: Changing frontmatter in preview server
30
21
  Given the Server is running at "frontmatter-settings-app"
31
- When I go to "/ignored/index.html"
22
+ When I go to "/ignored.html"
32
23
  Then I should see "File Not Found"
33
24
  And the file "source/ignored.html.erb" has the contents
34
25
  """
@@ -38,5 +29,5 @@ Feature: Setting page settings through frontmatter
38
29
 
39
30
  This file is no longer ignored.
40
31
  """
41
- When I go to "/ignored/index.html"
32
+ When I go to "/ignored.html"
42
33
  Then I should see "This file is no longer ignored."
@@ -118,81 +118,4 @@ Feature: Ignoring paths
118
118
  When I go to "/reports/another.html"
119
119
  Then I should see "File Not Found"
120
120
  When I go to "/images/icons/messages.png"
121
- Then I should see "File Not Found"
122
-
123
- Scenario: Ignore with directory indexes (source file, build)
124
- Given a fixture app "ignore-app"
125
- And a file named "config.rb" with:
126
- """
127
- activate :directory_indexes
128
- ignore 'about.html.erb'
129
- ignore 'plain.html'
130
- """
131
- And a successfully built app at "ignore-app"
132
- Then the following files should exist:
133
- | build/index.html |
134
- And the following files should not exist:
135
- | build/about/index.html |
136
- | build/plain/index.html |
137
-
138
- Scenario: Ignore with directory indexes (source file, server)
139
- Given a fixture app "ignore-app"
140
- And a file named "config.rb" with:
141
- """
142
- activate :directory_indexes
143
- ignore 'about.html.erb'
144
- ignore 'plain.html'
145
- """
146
- And the Server is running
147
- When I go to "/index.html"
148
- Then I should not see "File Not Found"
149
- When I go to "/about/index.html"
150
- Then I should see "File Not Found"
151
- When I go to "/plain/index.html"
152
- Then I should see "File Not Found"
153
-
154
- Scenario: Ignore with directory indexes (output path splat, build)
155
- Given a fixture app "ignore-app"
156
- And a file named "config.rb" with:
157
- """
158
- activate :directory_indexes
159
- ignore 'about*'
160
- ignore 'plain*'
161
- """
162
- And a successfully built app at "ignore-app"
163
- Then the following files should exist:
164
- | build/index.html |
165
- And the following files should not exist:
166
- | build/about/index.html |
167
- | build/plain/index.html |
168
-
169
- Scenario: Ignore with directory indexes (output path splat, server)
170
- Given a fixture app "ignore-app"
171
- And a file named "config.rb" with:
172
- """
173
- activate :directory_indexes
174
- ignore 'about*'
175
- ignore 'plain*'
176
- """
177
- And the Server is running
178
- When I go to "/index.html"
179
- Then I should not see "File Not Found"
180
- When I go to "/about/index.html"
181
- Then I should see "File Not Found"
182
- When I go to "/plain/index.html"
183
- Then I should see "File Not Found"
184
-
185
- # Scenario: Ignore with directory indexes (output path index)
186
- # Given a fixture app "ignore-app"
187
- # And a file named "config.rb" with:
188
- # """
189
- # activate :directory_indexes
190
- # ignore 'about/index.html'
191
- # ignore 'plain/index.html'
192
- # """
193
- # And a successfully built app at "ignore-app"
194
- # Then the following files should exist:
195
- # | build/index.html |
196
- # And the following files should not exist:
197
- # | build/about/index.html |
198
- # | build/plain/index.html |
121
+ Then I should see "File Not Found"
@@ -35,7 +35,7 @@ Feature: Step through sitemap as a tree
35
35
 
36
36
  Scenario: Page has siblings, parent, and source file
37
37
  Given the Server is running at "traversal-app"
38
- When I go to "/sub/sibling/"
38
+ When I go to "/sub/sibling.html"
39
39
  Then I should see "Parent: sub/index.html"
40
40
  Then I should see "Sibling: sub/fake.html"
41
41
  Then I should see "Sibling: sub/fake2.html"
@@ -45,7 +45,7 @@ Feature: Step through sitemap as a tree
45
45
 
46
46
  Scenario: Proxied page has siblings, parent, and source file
47
47
  Given the Server is running at "traversal-app"
48
- When I go to "/sub/fake/"
48
+ When I go to "/sub/fake.html"
49
49
  Then I should see "Path: sub/fake.html"
50
50
  Then I should see "Parent: sub/index.html"
51
51
  Then I should see "Sibling: sub/fake2.html"
@@ -56,13 +56,13 @@ Feature: Step through sitemap as a tree
56
56
 
57
57
  Scenario: Child pages have data
58
58
  Given the Server is running at "traversal-app"
59
- When I go to "/directory-indexed"
59
+ When I go to "/directory-indexed.html"
60
60
  Then I should see "Title of Sibling One"
61
61
  Then I should see "Title of Sibling Two"
62
62
 
63
- Scenario: When directory_index extension is active, child pages are found in named directory
63
+ Scenario: When directory_index extension is inactive, child pages are found in named directory
64
64
  Given the Server is running at "traversal-app"
65
- When I go to "/directory-indexed"
65
+ When I go to "/directory-indexed.html"
66
66
  Then I should see "Path: directory-indexed.html"
67
67
  Then I should see "Parent: index.html"
68
68
  Then I should see "Child: directory-indexed/fake.html"
@@ -1,3 +1,6 @@
1
+ ENV["TEST"] = "true"
2
+ ENV["AUTOLOAD_SPROCKETS"] = "false"
3
+
1
4
  PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
5
  require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-core')
3
6
  require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-core', 'step_definitions')
@@ -7,13 +7,4 @@ Feature: Wildcards in Page helper
7
7
  When I go to "/admin/index.html"
8
8
  Then I should see "Admin Layout"
9
9
  When I go to "/admin/page.html"
10
- Then I should see "Admin Layout"
11
-
12
- Scenario: Setting the layout for a folder
13
- Given the Server is running at "wildcard-directory-index-app"
14
- When I go to "/"
15
- Then I should see "Normal Layout"
16
- When I go to "/admin/"
17
- Then I should see "Admin Layout"
18
- When I go to "/admin/page/"
19
10
  Then I should see "Admin Layout"
@@ -0,0 +1,7 @@
1
+ # encoding: UTF-8
2
+ ---
3
+ layout: false
4
+ title: This is the title
5
+ ---
6
+
7
+ <h1><%= data.page.title %></h1>
@@ -1,5 +1,4 @@
1
1
  <h2> Test</h2>
2
-
3
2
  ---
4
3
  layout: false
5
4
  title: This is the title
@@ -1,7 +1,7 @@
1
- {{{
1
+ ;;;
2
2
  "layout": false,
3
3
  "title": "This is the title"
4
- }}}
4
+ ;;;
5
5
 
6
6
  <h1><%= data.page.title %></h1>
7
7
  <?php echo "sup"; ?>
@@ -1,6 +1,6 @@
1
- {{{
1
+ ;;;
2
2
  "layout": false,
3
3
  "title": "This is the title"
4
- }}}
4
+ ;;;
5
5
 
6
6
  <h1><%= data.page.title %></h1>
@@ -0,0 +1,7 @@
1
+ # encoding: UTF-8
2
+ ;;;
3
+ "layout": false,
4
+ "title": "This is the title"
5
+ ;;;
6
+
7
+ <h1><%= data.page.title %></h1>