middleman-core-with-external-sources-watch-fix 4.1.0 → 4.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/features/asset_hash.feature +47 -10
  3. data/features/builder.feature +8 -4
  4. data/features/collections.feature +27 -0
  5. data/features/custom_layouts.feature +17 -1
  6. data/features/dynamic_pages.feature +15 -12
  7. data/features/front-matter-neighbor.feature +6 -2
  8. data/features/helpers_link_to.feature +11 -1
  9. data/features/i18n_link_to.feature +34 -34
  10. data/features/markdown_redcarpet_in_slim.feature +41 -0
  11. data/features/page-id.feature +26 -0
  12. data/features/partials.feature +17 -5
  13. data/features/relative_assets.feature +1 -1
  14. data/features/relative_assets_helpers_only.feature +123 -0
  15. data/features/sass_in_slim.feature +40 -0
  16. data/features/template-key-collision.feature +26 -0
  17. data/fixtures/asset-hash-minified-app/source/images/100px.jpg +0 -0
  18. data/fixtures/asset-hash-minified-app/source/stylesheets/test.css +3 -0
  19. data/fixtures/asset-hash-prefix/config.rb +7 -0
  20. data/fixtures/asset-hash-prefix/lib/middleware.rb +16 -0
  21. data/fixtures/asset-hash-prefix/source/index.html.erb +6 -0
  22. data/fixtures/asset-hash-prefix/source/javascripts/application.js +2 -0
  23. data/fixtures/asset-hash-prefix/source/javascripts/application.js.map +1 -0
  24. data/fixtures/asset-hash-prefix/source/layout.erb +17 -0
  25. data/fixtures/asset-hash-source-map/config.rb +6 -0
  26. data/fixtures/asset-hash-source-map/lib/middleware.rb +16 -0
  27. data/fixtures/asset-hash-source-map/source/index.html.erb +6 -0
  28. data/fixtures/asset-hash-source-map/source/javascripts/application.js +2 -0
  29. data/fixtures/asset-hash-source-map/source/javascripts/application.js.map +1 -0
  30. data/fixtures/asset-hash-source-map/source/layout.erb +17 -0
  31. data/fixtures/asset-host-app/source/images/blank0.gif +0 -0
  32. data/fixtures/asset-host-app/source/images/blank1.gif +0 -0
  33. data/fixtures/asset-host-app/source/images/blank10.gif +0 -0
  34. data/fixtures/asset-host-app/source/images/blank100.gif +0 -0
  35. data/fixtures/asset-host-app/source/images/blank101.gif +0 -0
  36. data/fixtures/asset-host-app/source/images/blank1010.gif +0 -0
  37. data/fixtures/asset-host-app/source/images/blank102.gif +0 -0
  38. data/fixtures/asset-host-app/source/images/blank1020.gif +0 -0
  39. data/fixtures/asset-host-app/source/images/blank1021.gif +0 -0
  40. data/fixtures/asset-host-app/source/images/blank1022.gif +0 -0
  41. data/fixtures/asset-host-app/source/images/blank1023.gif +0 -0
  42. data/fixtures/asset-host-app/source/images/blank1024.gif +0 -0
  43. data/fixtures/asset-host-app/source/images/blank103.gif +0 -0
  44. data/fixtures/asset-host-app/source/images/blank1030.gif +0 -0
  45. data/fixtures/asset-host-app/source/images/blank1031.gif +0 -0
  46. data/fixtures/asset-host-app/source/images/blank1032.gif +0 -0
  47. data/fixtures/asset-host-app/source/images/blank1033.gif +0 -0
  48. data/fixtures/asset-host-app/source/images/blank1034.gif +0 -0
  49. data/fixtures/asset-host-app/source/images/blank104.gif +0 -0
  50. data/fixtures/asset-host-app/source/images/blank1043.gif +0 -0
  51. data/fixtures/asset-host-app/source/images/blank1054.gif +0 -0
  52. data/fixtures/asset-host-app/source/images/blank2.gif +0 -0
  53. data/fixtures/asset-host-app/source/images/blank20.gif +0 -0
  54. data/fixtures/asset-host-app/source/images/blank21.gif +0 -0
  55. data/fixtures/asset-host-app/source/images/blank22.gif +0 -0
  56. data/fixtures/asset-host-app/source/images/blank23.gif +0 -0
  57. data/fixtures/asset-host-app/source/images/blank24.gif +0 -0
  58. data/fixtures/asset-host-app/source/images/blank3.gif +0 -0
  59. data/fixtures/asset-host-app/source/images/blank30.gif +0 -0
  60. data/fixtures/asset-host-app/source/images/blank31.gif +0 -0
  61. data/fixtures/asset-host-app/source/images/blank32.gif +0 -0
  62. data/fixtures/asset-host-app/source/images/blank33.gif +0 -0
  63. data/fixtures/asset-host-app/source/images/blank34.gif +0 -0
  64. data/fixtures/asset-host-app/source/images/blank4.gif +0 -0
  65. data/fixtures/asset-host-app/source/images/blank43.gif +0 -0
  66. data/fixtures/asset-host-app/source/images/blank54.gif +0 -0
  67. data/fixtures/dynamic-pages-app/config.rb +4 -0
  68. data/fixtures/dynamic-pages-app/source/should_be_ignored9.html +1 -0
  69. data/fixtures/external-pipeline-error/config.rb +5 -0
  70. data/fixtures/external-pipeline-error/source/javascripts/file.js +0 -0
  71. data/fixtures/page-id-app/config.rb +5 -0
  72. data/fixtures/page-id-app/source/fm.html.erb +5 -0
  73. data/fixtures/page-id-app/source/index.html.erb +6 -0
  74. data/fixtures/page-id-app/source/overwrites/from-default.html.erb +1 -0
  75. data/fixtures/page-id-app/source/overwrites/from-frontmatter.html.erb +5 -0
  76. data/fixtures/partials-app/source/_block.erb +3 -0
  77. data/fixtures/partials-app/source/block.html.erb +3 -0
  78. data/fixtures/partials-app/source/index_missing.html.erb +3 -0
  79. data/fixtures/relative-assets-app/source/images/blank2.gif +0 -0
  80. data/fixtures/sass-in-slim-app/config.rb +0 -0
  81. data/lib/middleman-core/application.rb +30 -4
  82. data/lib/middleman-core/builder.rb +8 -2
  83. data/lib/middleman-core/config_context.rb +5 -1
  84. data/lib/middleman-core/configuration.rb +1 -1
  85. data/lib/middleman-core/core_extensions/collections.rb +28 -17
  86. data/lib/middleman-core/core_extensions/collections/step_context.rb +14 -7
  87. data/lib/middleman-core/core_extensions/data.rb +4 -2
  88. data/lib/middleman-core/core_extensions/default_helpers.rb +1 -0
  89. data/lib/middleman-core/core_extensions/front_matter.rb +8 -6
  90. data/lib/middleman-core/core_extensions/i18n.rb +3 -1
  91. data/lib/middleman-core/core_extensions/inline_url_rewriter.rb +20 -35
  92. data/lib/middleman-core/core_extensions/routing.rb +6 -3
  93. data/lib/middleman-core/extension.rb +41 -6
  94. data/lib/middleman-core/extensions.rb +2 -2
  95. data/lib/middleman-core/extensions/asset_hash.rb +10 -5
  96. data/lib/middleman-core/extensions/asset_host.rb +4 -3
  97. data/lib/middleman-core/extensions/cache_buster.rb +2 -2
  98. data/lib/middleman-core/extensions/directory_indexes.rb +8 -2
  99. data/lib/middleman-core/extensions/external_pipeline.rb +54 -8
  100. data/lib/middleman-core/extensions/minify_css.rb +9 -1
  101. data/lib/middleman-core/extensions/minify_javascript.rb +8 -0
  102. data/lib/middleman-core/extensions/relative_assets.rb +38 -13
  103. data/lib/middleman-core/file_renderer.rb +4 -4
  104. data/lib/middleman-core/load_paths.rb +3 -1
  105. data/lib/middleman-core/logger.rb +1 -1
  106. data/lib/middleman-core/meta_pages/templates/index.html.erb +3 -1
  107. data/lib/middleman-core/preview_server.rb +25 -18
  108. data/lib/middleman-core/rack.rb +2 -0
  109. data/lib/middleman-core/renderers/redcarpet.rb +2 -2
  110. data/lib/middleman-core/renderers/sass_functions.rb +4 -6
  111. data/lib/middleman-core/renderers/slim.rb +1 -5
  112. data/lib/middleman-core/sitemap/extensions/import.rb +2 -2
  113. data/lib/middleman-core/sitemap/extensions/proxies.rb +4 -1
  114. data/lib/middleman-core/sitemap/extensions/redirects.rb +1 -2
  115. data/lib/middleman-core/sitemap/resource.rb +15 -5
  116. data/lib/middleman-core/sitemap/store.rb +33 -2
  117. data/lib/middleman-core/sources.rb +2 -1
  118. data/lib/middleman-core/sources/source_watcher.rb +17 -6
  119. data/lib/middleman-core/template_context.rb +26 -21
  120. data/lib/middleman-core/template_renderer.rb +22 -9
  121. data/lib/middleman-core/util/binary.rb +4 -5
  122. data/lib/middleman-core/util/data.rb +33 -18
  123. data/lib/middleman-core/util/files.rb +27 -24
  124. data/lib/middleman-core/util/paths.rb +74 -14
  125. data/lib/middleman-core/util/rack.rb +16 -6
  126. data/lib/middleman-core/version.rb +1 -1
  127. data/middleman-core.gemspec +11 -8
  128. data/spec/middleman-core/core_extensions/data_spec.rb +107 -1
  129. data/spec/middleman-core/util_spec.rb +37 -0
  130. metadata +196 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ca25c0db0b5bbd38dc2315422909ca0034eaf222e85be89942a43c31ea48a4e
4
- data.tar.gz: 7668aabc3404f8a2e87cc1e268e46be098c55611bc52ffaa7d79f30bef68a298
3
+ metadata.gz: 36ecba701249f86c63098958a1fa6336d3c7f93fbf6101f7520732005b17a02c
4
+ data.tar.gz: d59964efdc041ea5249d294badee1e779e5d63f946fcda64a698fcfcf1538e10
5
5
  SHA512:
6
- metadata.gz: a6f20b541a9d3ae4a5682ff003c527e8889cba45897d04bd5e7d74249a3a92f13ac36db17afad94c19958f82977836296fc950d23c8c1e03b98700787b85e0f3
7
- data.tar.gz: 2de2bf773efc53b5836d0e41133394d25003fccd7a4b06f6a41921fa21e5851de121504550fb441e5ad1c91421b8a8f04b8866f040c2106d4b5d54276d9a99ca
6
+ metadata.gz: 400216d0c4be9e44ce836d1a4df80fe03e38e910759eb910293fcefd645674fe02f806e5b9f5fa67bbfd252021c462a65dbdfa2eae669bcfc7472df3a7c1927a
7
+ data.tar.gz: 37320bdbea6d80457e30efe8403d26e5264dc66805b8a5003344e75e71a548cae76b5f98dc2d4b49a93eb1a79a077e962326ae0a7df2364cda0e6e4b58c1c446
@@ -111,28 +111,29 @@ Feature: Assets get file hashes appended to them and references to them are upda
111
111
  Given a fixture app "asset-hash-host-app"
112
112
  And a file named "config.rb" with:
113
113
  """
114
+ set :sass_source_maps, false
114
115
  activate :asset_hash
115
116
  activate :directory_indexes
116
117
  activate :asset_host, host: 'http://middlemanapp.com'
117
118
  """
118
119
  Given the Server is running at "asset-hash-host-app"
119
120
  When I go to "/"
120
- Then I should see 'href="http://middlemanapp.com/stylesheets/site-210612a0.css"'
121
- Then I should see 'href="http://middlemanapp.com/stylesheets/fragment-7000b132.css"'
121
+ Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
122
+ Then I should see 'href="http://middlemanapp.com/stylesheets/fragment-2902933e.css"'
122
123
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
123
124
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
124
125
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
125
126
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
126
127
  When I go to "/subdir/"
127
- Then I should see 'href="http://middlemanapp.com/stylesheets/site-210612a0.css"'
128
+ Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
128
129
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
129
130
  When I go to "/other/"
130
- Then I should see 'href="http://middlemanapp.com/stylesheets/site-210612a0.css"'
131
+ Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
131
132
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
132
133
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
133
134
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
134
135
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
135
- When I go to "/stylesheets/fragment-7000b132.css"
136
+ When I go to "/stylesheets/fragment-2902933e.css"
136
137
  And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg");'
137
138
  And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?test");'
138
139
  And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test");'
@@ -142,28 +143,29 @@ Feature: Assets get file hashes appended to them and references to them are upda
142
143
  Given a fixture app "asset-hash-host-app"
143
144
  And a file named "config.rb" with:
144
145
  """
146
+ set :sass_source_maps, false
145
147
  activate :asset_host, host: 'http://middlemanapp.com'
146
148
  activate :directory_indexes
147
149
  activate :asset_hash
148
150
  """
149
151
  Given the Server is running at "asset-hash-host-app"
150
152
  When I go to "/"
151
- Then I should see 'href="http://middlemanapp.com/stylesheets/site-210612a0.css"'
152
- Then I should see 'href="http://middlemanapp.com/stylesheets/fragment-7000b132.css"'
153
+ Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
154
+ Then I should see 'href="http://middlemanapp.com/stylesheets/fragment-2902933e.css"'
153
155
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
154
156
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
155
157
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
156
158
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
157
159
  When I go to "/subdir/"
158
- Then I should see 'href="http://middlemanapp.com/stylesheets/site-210612a0.css"'
160
+ Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
159
161
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
160
162
  When I go to "/other/"
161
- Then I should see 'href="http://middlemanapp.com/stylesheets/site-210612a0.css"'
163
+ Then I should see 'href="http://middlemanapp.com/stylesheets/site-7474cadd.css"'
162
164
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg"'
163
165
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?test"'
164
166
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test"'
165
167
  And I should see 'src="http://middlemanapp.com/images/100px-5fd6fb90.jpg#test"'
166
- When I go to "/stylesheets/fragment-7000b132.css"
168
+ When I go to "/stylesheets/fragment-2902933e.css"
167
169
  And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg")'
168
170
  And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?test")'
169
171
  And I should see 'url("http://middlemanapp.com/images/100px-5fd6fb90.jpg?#test")'
@@ -283,5 +285,40 @@ Feature: Assets get file hashes appended to them and references to them are upda
283
285
  When I cd to "build"
284
286
  Then the following files should exist:
285
287
  | javascripts/jquery.min-276c87ff.js |
288
+ | stylesheets/test-7de2ad06.css |
286
289
  And the following files should not exist:
287
290
  | javascripts/jquery.min.js |
291
+ And the file "stylesheets/test-7de2ad06.css" should contain:
292
+ """
293
+ .no-bug{background-image:url(/images/100px-5fd6fb90.jpg)}
294
+ .bug{content:"";background-image:url(/images/100px-5fd6fb90.jpg)}
295
+ .no-bug{content:""; background-image:url(/images/100px-5fd6fb90.jpg)}
296
+ """
297
+
298
+ Scenario: Source map paths include the hash
299
+ Given a successfully built app at "asset-hash-source-map"
300
+ When I cd to "build"
301
+ Then the following files should exist:
302
+ | index.html |
303
+ | javascripts/application-4553338c.js |
304
+ | javascripts/application.js-22cc2b5f.map |
305
+ | index.html |
306
+ And the following files should not exist:
307
+ | javascripts/application.js |
308
+ | javascripts/application.js.map |
309
+
310
+ And the file "javascripts/application-4553338c.js" should contain "//# sourceMappingURL=application.js-22cc2b5f.map"
311
+
312
+ Scenario: Hashes can contain a prefix
313
+ Given a successfully built app at "asset-hash-prefix"
314
+ When I cd to "build"
315
+ Then the following files should exist:
316
+ | index.html |
317
+ | javascripts/application-myprefix-4553338c.js |
318
+ | javascripts/application.js-myprefix-22cc2b5f.map |
319
+ | index.html |
320
+ And the following files should not exist:
321
+ | javascripts/application.js |
322
+ | javascripts/application.js.map |
323
+
324
+ And the file "javascripts/application-myprefix-4553338c.js" should contain "//# sourceMappingURL=application.js-myprefix-22cc2b5f.map"
@@ -20,13 +20,13 @@ Feature: Builder
20
20
  | layout |
21
21
  | layouts/custom |
22
22
  | layouts/content_for |
23
-
23
+
24
24
  And the file "index.html" should contain "Comment in layout"
25
25
  And the file "index.html" should contain "<h1>Welcome</h1>"
26
26
  And the file "static.html" should contain "Static, no code!"
27
27
  And the file "services/index.html" should contain "Services"
28
28
  And the file "stylesheets/static.css" should contain "body"
29
-
29
+
30
30
  Scenario: Build glob
31
31
  Given a successfully built app at "glob-app" with flags "--glob '*.css'"
32
32
  When I cd to "build"
@@ -34,15 +34,19 @@ Feature: Builder
34
34
  | index.html |
35
35
  Then the following files should exist:
36
36
  | stylesheets/site.css |
37
-
37
+
38
38
  Scenario: Build with errors
39
39
  Given a built app at "build-with-errors-app"
40
40
  Then the exit status should be 1
41
-
41
+
42
42
  Scenario: Build empty errors
43
43
  Given a built app at "empty-app"
44
44
  Then the exit status should be 1
45
45
 
46
+ Scenario: Build external_pipeline errors
47
+ Given a built app at "external-pipeline-error"
48
+ Then the exit status should be 1
49
+
46
50
  Scenario: Build alias (b)
47
51
  Given a fixture app "large-build-app"
48
52
  When I run `middleman b`
@@ -144,6 +144,33 @@ Feature: Collections
144
144
  And I should see 'Article: Blog3 Another Article'
145
145
  And I should see 'Article: Blog2 Yet Another Article'
146
146
 
147
+ Scenario: Work with local helpers
148
+ Given a fixture app "collections-app"
149
+ And a file named "config.rb" with:
150
+ """
151
+ module TestHelper
152
+ def help_me
153
+ "ok"
154
+ end
155
+ end
156
+
157
+ include TestHelper
158
+
159
+ data.articles.each_with_index do |a, i|
160
+ proxy "/#{i}-#{help_me}.html", a
161
+ end
162
+ """
163
+ And a file named "data/articles.yaml" with:
164
+ """
165
+ ---
166
+ - "/blog1/2011-01-01-new-article.html"
167
+ - "/blog2/2011-01-02-another-article.html"
168
+ """
169
+ Given the Server is running at "collections-app"
170
+ When I go to "0-ok.html"
171
+ Then I should see 'Newer Article Content'
172
+ When I go to "1-ok.html"
173
+ Then I should see 'Another Article Content'
147
174
 
148
175
  Scenario: Collected data update with file changes
149
176
  Given a fixture app "collections-app"
@@ -11,6 +11,22 @@ Feature: Custom layouts
11
11
  When I go to "/custom-layout.html"
12
12
  Then I should see "Custom Layout"
13
13
 
14
+ Scenario: Using custom :layout attribute with proxy
15
+ Given a fixture app "custom-layout-app2"
16
+ And a file named "config.rb" with:
17
+ """
18
+ page '/test/*', layout: :custom
19
+ proxy "/test/me.html", "/custom-layout.html"
20
+ live { %w(you) }.each do |who|
21
+ proxy "/test/#{who}.html", "/custom-layout.html"
22
+ end
23
+ """
24
+ And the Server is running at "custom-layout-app2"
25
+ When I go to "/test/me.html"
26
+ Then I should see "Custom Layout"
27
+ When I go to "/test/you.html"
28
+ Then I should see "Custom Layout"
29
+
14
30
  Scenario: Using custom :layout attribute with folders
15
31
  Given a fixture app "custom-layout-app2"
16
32
  And a file named "config.rb" with:
@@ -65,4 +81,4 @@ Feature: Custom layouts
65
81
  When I go to "/path/index.html"
66
82
  Then I should see "Alt"
67
83
  And I should see "Monde"
68
- And I should not see "Hello"
84
+ And I should not see "Hello"
@@ -31,7 +31,8 @@ Feature: Dynamic Pages
31
31
  | should_be_ignored6.html |
32
32
  | should_be_ignored7.html |
33
33
  | should_be_ignored8.html |
34
-
34
+ | should_be_ignored9.html |
35
+
35
36
  Scenario: Preview basic proxy
36
37
  Given the Server is running at "dynamic-pages-app"
37
38
  When I go to "/fake.html"
@@ -42,46 +43,46 @@ Feature: Dynamic Pages
42
43
  Then I should see "I am real"
43
44
  When I go to "/fake4.html"
44
45
  Then I should see "I am real"
45
-
46
+
46
47
  Scenario: Preview proxy with variable one
47
48
  Given the Server is running at "dynamic-pages-app"
48
49
  When I go to "/fake/one.html"
49
50
  Then I should see "I am real: one"
50
51
  Then I should see "Global: I am one glob"
51
52
  Then I should see "All: I am all glob"
52
-
53
+
53
54
  When I go to "/fake2/one.html"
54
55
  Then I should see "I am real: one"
55
56
  Then I should see "Global: I am two glob"
56
57
  Then I should see "All: I am all glob"
57
-
58
+
58
59
  When I go to "/fake3/one.html"
59
60
  Then I should see "I am real: one"
60
61
  Then I should see "Global: I am three glob"
61
62
  Then I should see "All: I am all glob"
62
-
63
+
63
64
  When I go to "/fake4/one.html"
64
65
  Then I should see "I am real: one"
65
66
  Then I should see "Global: I am four glob"
66
67
  Then I should see "All: I am all glob"
67
-
68
+
68
69
  Scenario: Preview proxy with variable two
69
70
  Given the Server is running at "dynamic-pages-app"
70
71
  When I go to "/fake/two.html"
71
72
  Then I should see "I am real: two"
72
73
  Then I should see "Global: I am one glob"
73
74
  Then I should see "All: I am all glob"
74
-
75
+
75
76
  When I go to "/fake2/two.html"
76
77
  Then I should see "I am real: two"
77
78
  Then I should see "Global: I am two glob"
78
79
  Then I should see "All: I am all glob"
79
-
80
+
80
81
  When I go to "/fake3/two.html"
81
82
  Then I should see "I am real: two"
82
83
  Then I should see "Global: I am three glob"
83
84
  Then I should see "All: I am all glob"
84
-
85
+
85
86
  When I go to "/fake4/two.html"
86
87
  Then I should see "I am real: two"
87
88
  Then I should see "Global: I am four glob"
@@ -101,7 +102,7 @@ Feature: Dynamic Pages
101
102
  Then the file "fake3/one.html" should contain "I am real: one"
102
103
  Then the file "fake3/one.html" should contain "Global: I am three glob"
103
104
  Then the file "fake3/one.html" should contain "All: I am all glob"
104
-
105
+
105
106
  Scenario: Target ignore
106
107
  Given the Server is running at "dynamic-pages-app"
107
108
  When I go to "/target_ignore.html"
@@ -112,7 +113,7 @@ Feature: Dynamic Pages
112
113
  Then I should see "Ignore me! 7"
113
114
  When I go to "/target_ignore4.html"
114
115
  Then I should see "Ignore me! 8"
115
-
116
+
116
117
  Scenario: Preview ignored paths
117
118
  Given the Server is running at "dynamic-pages-app"
118
119
  When I go to "/should_be_ignored.html"
@@ -130,4 +131,6 @@ Feature: Dynamic Pages
130
131
  When I go to "/should_be_ignored7.html"
131
132
  Then I should see "File Not Found"
132
133
  When I go to "/should_be_ignored8.html"
133
- Then I should see "File Not Found"
134
+ Then I should see "File Not Found"
135
+ When I go to "/should_be_ignored9.html"
136
+ Then I should see "File Not Found"
@@ -22,7 +22,7 @@ Feature: Neighboring YAML Front Matter
22
22
  Then I should not see "---"
23
23
  When I go to "/raw-front-matter.php.frontmatter"
24
24
  Then I should see "File Not Found"
25
-
25
+
26
26
  Scenario: YAML not on first line, with encoding
27
27
  Given the Server is running at "frontmatter-neighbor-app"
28
28
  When I go to "/front-matter-encoding.html"
@@ -35,7 +35,7 @@ Feature: Neighboring YAML Front Matter
35
35
  Given the Server is running at "frontmatter-neighbor-app"
36
36
  And the file "source/front-matter-change.html.erb" has the contents
37
37
  """
38
- <%= current_page.data.title %>
38
+ FileA <%= current_page.data.title %>
39
39
  """
40
40
  And the file "source/front-matter-change.html.erb.frontmatter" has the contents
41
41
  """
@@ -43,6 +43,8 @@ Feature: Neighboring YAML Front Matter
43
43
  title: Hello World
44
44
  layout: false
45
45
  ---
46
+
47
+ FileB
46
48
  """
47
49
  When I go to "/front-matter-change.html"
48
50
  Then I should see "Hello World"
@@ -52,6 +54,8 @@ Feature: Neighboring YAML Front Matter
52
54
  title: Hola Mundo
53
55
  layout: false
54
56
  ---
57
+
58
+ FileC
55
59
  """
56
60
  When I go to "/front-matter-change.html"
57
61
  Then I should see "Hola Mundo"
@@ -40,19 +40,29 @@ Feature: link_to helper
40
40
  """
41
41
  absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
42
42
  relative: <%= link_to "Relative", "needs_index.html", relative: true %>
43
+
44
+ absolute spaces: <%= link_to "Spaces Index", "/evil spaces.html", relative: true %>
45
+ relative spaces: <%= link_to "Spaces Relative", "evil spaces.html", relative: true %>
43
46
  """
44
47
  And a file named "source/link_to/sub.html.erb" with:
45
48
  """
46
49
  absolute: <%= link_to "Needs Index", "/needs_index.html", relative: true %>
47
50
  relative: <%= link_to "Relative", "../needs_index.html", relative: true %>
51
+
52
+ absolute spaces: <%= link_to "Spaces Index", "/evil spaces.html", relative: true %>
53
+ relative spaces: <%= link_to "Spaces Relative", "../evil spaces.html", relative: true %>
48
54
  """
49
55
  And the Server is running at "indexable-app"
50
56
  When I go to "/link_to.html"
51
57
  Then I should see 'absolute: <a href="needs_index.html">Needs Index</a>'
52
58
  Then I should see 'relative: <a href="needs_index.html">Relative</a>'
59
+ Then I should see 'absolute spaces: <a href="evil%20spaces.html">Spaces Index</a>'
60
+ Then I should see 'relative spaces: <a href="evil%20spaces.html">Spaces Relative</a>'
53
61
  When I go to "/link_to/sub.html"
54
62
  Then I should see 'absolute: <a href="../needs_index.html">Needs Index</a>'
55
63
  Then I should see 'relative: <a href="../needs_index.html">Relative</a>'
64
+ Then I should see 'absolute spaces: <a href="../evil%20spaces.html">Spaces Index</a>'
65
+ Then I should see 'relative spaces: <a href="../evil%20spaces.html">Spaces Relative</a>'
56
66
 
57
67
  Scenario: link_to relative works with strip_index_file
58
68
  Given a fixture app "indexable-app"
@@ -113,7 +123,7 @@ Feature: link_to helper
113
123
  When I go to "/link_to/sub.html"
114
124
  Then I should see 'absolute: <a href="../needs_index.html">Needs Index</a>'
115
125
  Then I should see 'relative: <a href="../needs_index.html">Relative</a>'
116
-
126
+
117
127
  Scenario: link_to knows about directory indexes
118
128
  Given a fixture app "indexable-app"
119
129
  And a file named "source/link_to.html.erb" with:
@@ -4,7 +4,7 @@ Feature: i18n Paths
4
4
  Given a fixture app "empty-app"
5
5
  And a file named "data/pages.yml" with:
6
6
  """
7
- - hello.html
7
+ - hello.html
8
8
  """
9
9
  And a file named "locales/en.yml" with:
10
10
  """
@@ -50,24 +50,24 @@ Feature: i18n Paths
50
50
  Given the Server is running at "empty-app"
51
51
  When I go to "/hello.html"
52
52
  Then I should see "Page: Hello"
53
- Then I should see '<a class="current" href="/index.html">Current Home</a>'
54
- Then I should see '<a title="Other Home" href="/es/index.html">Other Home</a>'
55
- Then I should see '<a class="current" href="/index.html"><span>Home: Current Block</span></a>'
56
- Then I should see '<a title="Other Home" href="/es/index.html"><span>Home: Other Block</span></a>'
57
- Then I should see '<a class="current" href="/hello.html">Current hello.html</a>'
58
- Then I should see '<a title="Other hello.html" href="/es/hola.html">Other hello.html</a>'
59
- Then I should see '<a class="current" href="/hello.html"><span>Current Block</span></a>'
60
- Then I should see '<a title="Other hello.html" href="/es/hola.html"><span>Other Block</span></a>'
53
+ Then I should see '<a href="/index.html" class="current">Current Home</a>'
54
+ Then I should see '<a href="/es/index.html" title="Other Home">Other Home</a>'
55
+ Then I should see '<a href="/index.html" class="current"><span>Home: Current Block</span></a>'
56
+ Then I should see '<a href="/es/index.html" title="Other Home"><span>Home: Other Block</span></a>'
57
+ Then I should see '<a href="/hello.html" class="current">Current hello.html</a>'
58
+ Then I should see '<a href="/es/hola.html" title="Other hello.html">Other hello.html</a>'
59
+ Then I should see '<a href="/hello.html" class="current"><span>Current Block</span></a>'
60
+ Then I should see '<a href="/es/hola.html" title="Other hello.html"><span>Other Block</span></a>'
61
61
  When I go to "/es/hola.html"
62
62
  Then I should see "Page: Hola"
63
- Then I should see '<a class="current" href="/es/index.html">Current Home</a>'
64
- Then I should see '<a title="Other Home" href="/index.html">Other Home</a>'
65
- Then I should see '<a class="current" href="/es/index.html"><span>Home: Current Block</span></a>'
66
- Then I should see '<a title="Other Home" href="/index.html"><span>Home: Other Block</span></a>'
67
- Then I should see '<a class="current" href="/es/hola.html">Current hello.html</a>'
68
- Then I should see '<a title="Other hello.html" href="/hello.html">Other hello.html</a>'
69
- Then I should see '<a class="current" href="/es/hola.html"><span>Current Block</span></a>'
70
- Then I should see '<a title="Other hello.html" href="/hello.html"><span>Other Block</span></a>'
63
+ Then I should see '<a href="/es/index.html" class="current">Current Home</a>'
64
+ Then I should see '<a href="/index.html" title="Other Home">Other Home</a>'
65
+ Then I should see '<a href="/es/index.html" class="current"><span>Home: Current Block</span></a>'
66
+ Then I should see '<a href="/index.html" title="Other Home"><span>Home: Other Block</span></a>'
67
+ Then I should see '<a href="/es/hola.html" class="current">Current hello.html</a>'
68
+ Then I should see '<a href="/hello.html" title="Other hello.html">Other hello.html</a>'
69
+ Then I should see '<a href="/es/hola.html" class="current"><span>Current Block</span></a>'
70
+ Then I should see '<a href="/hello.html" title="Other hello.html"><span>Other Block</span></a>'
71
71
 
72
72
  Scenario: link_to is i18n aware and supports relative_links
73
73
  Given a fixture app "empty-app"
@@ -124,30 +124,30 @@ Feature: i18n Paths
124
124
  Then I should see "assets/css/main.css"
125
125
  When I go to "/hello.html"
126
126
  Then I should see "Page: Hello"
127
- Then I should see '<a class="current" href="index.html">Current Home</a>'
128
- Then I should see '<a title="Other Home" href="es/index.html">Other Home</a>'
129
- Then I should see '<a class="current" href="index.html"><span>Home: Current Block</span></a>'
130
- Then I should see '<a title="Other Home" href="es/index.html"><span>Home: Other Block</span></a>'
131
- Then I should see '<a class="current" href="hello.html">Current hello.html</a>'
132
- Then I should see '<a title="Other hello.html" href="es/hola.html">Other hello.html</a>'
133
- Then I should see '<a class="current" href="hello.html"><span>Current Block</span></a>'
134
- Then I should see '<a title="Other hello.html" href="es/hola.html"><span>Other Block</span></a>'
127
+ Then I should see '<a href="index.html" class="current">Current Home</a>'
128
+ Then I should see '<a href="es/index.html" title="Other Home">Other Home</a>'
129
+ Then I should see '<a href="index.html" class="current"><span>Home: Current Block</span></a>'
130
+ Then I should see '<a href="es/index.html" title="Other Home"><span>Home: Other Block</span></a>'
131
+ Then I should see '<a href="hello.html" class="current">Current hello.html</a>'
132
+ Then I should see '<a href="es/hola.html" title="Other hello.html">Other hello.html</a>'
133
+ Then I should see '<a href="hello.html" class="current"><span>Current Block</span></a>'
134
+ Then I should see '<a href="es/hola.html" title="Other hello.html"><span>Other Block</span></a>'
135
135
  When I go to "/es/hola.html"
136
136
  Then I should see "Page: Hola"
137
- Then I should see '<a class="current" href="index.html">Current Home</a>'
138
- Then I should see '<a title="Other Home" href="../index.html">Other Home</a>'
139
- Then I should see '<a class="current" href="index.html"><span>Home: Current Block</span></a>'
140
- Then I should see '<a title="Other Home" href="../index.html"><span>Home: Other Block</span></a>'
141
- Then I should see '<a class="current" href="hola.html">Current hello.html</a>'
142
- Then I should see '<a title="Other hello.html" href="../hello.html">Other hello.html</a>'
143
- Then I should see '<a class="current" href="hola.html"><span>Current Block</span></a>'
144
- Then I should see '<a title="Other hello.html" href="../hello.html"><span>Other Block</span></a>'
137
+ Then I should see '<a href="index.html" class="current">Current Home</a>'
138
+ Then I should see '<a href="../index.html" title="Other Home">Other Home</a>'
139
+ Then I should see '<a href="index.html" class="current"><span>Home: Current Block</span></a>'
140
+ Then I should see '<a href="../index.html" title="Other Home"><span>Home: Other Block</span></a>'
141
+ Then I should see '<a href="hola.html" class="current">Current hello.html</a>'
142
+ Then I should see '<a href="../hello.html" title="Other hello.html">Other hello.html</a>'
143
+ Then I should see '<a href="hola.html" class="current"><span>Current Block</span></a>'
144
+ Then I should see '<a href="../hello.html" title="Other hello.html"><span>Other Block</span></a>'
145
145
 
146
146
  Scenario: url_for is i18n aware
147
147
  Given a fixture app "empty-app"
148
148
  And a file named "data/pages.yml" with:
149
149
  """
150
- - hello.html
150
+ - hello.html
151
151
  - article.html
152
152
  """
153
153
  And a file named "locales/en.yml" with: