middleman-core 4.0.0.beta.2 → 4.0.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/features/builder.feature +9 -1
  3. data/features/collections.feature +43 -2
  4. data/features/data.feature +7 -0
  5. data/features/extension_hooks.feature +13 -0
  6. data/features/front-matter-neighbor.feature +0 -11
  7. data/features/front-matter.feature +0 -22
  8. data/features/markdown_kramdown_in_slim.feature +42 -0
  9. data/fixtures/extension-hooks-app/config.rb +39 -0
  10. data/fixtures/extension-hooks-app/source/index.html.erb +9 -0
  11. data/fixtures/frontmatter-app/source/front-matter-line-2.html.erb +4 -1
  12. data/fixtures/frontmatter-neighbor-app/config.rb +3 -3
  13. data/fixtures/frontmatter-settings-neighbor-app/config.rb +4 -4
  14. data/fixtures/markdown-in-slim-app/config.rb +0 -0
  15. data/fixtures/markdown-in-slim-app/source/images/blank.gif +0 -0
  16. data/fixtures/markdown-in-slim-app/source/link_target.html.markdown +4 -0
  17. data/fixtures/more-traversal-app/source/layout.erb +1 -1
  18. data/fixtures/nested-data-app/data/examples/withcontent.yaml +11 -0
  19. data/fixtures/nested-data-app/source/extracontent.html.haml.erb +4 -0
  20. data/fixtures/traversal-app/source/layout.erb +1 -1
  21. data/lib/middleman-core/application.rb +7 -3
  22. data/lib/middleman-core/builder.rb +2 -1
  23. data/lib/middleman-core/configuration.rb +0 -1
  24. data/lib/middleman-core/contracts.rb +0 -10
  25. data/lib/middleman-core/core_extensions/collections.rb +30 -6
  26. data/lib/middleman-core/core_extensions/data.rb +4 -4
  27. data/lib/middleman-core/core_extensions/file_watcher.rb +1 -1
  28. data/lib/middleman-core/core_extensions/front_matter.rb +10 -104
  29. data/lib/middleman-core/core_extensions/show_exceptions.rb +1 -1
  30. data/lib/middleman-core/extension_manager.rb +2 -1
  31. data/lib/middleman-core/extensions/asset_hash.rb +2 -1
  32. data/lib/middleman-core/extensions/asset_host.rb +1 -1
  33. data/lib/middleman-core/extensions/external_pipeline.rb +4 -1
  34. data/lib/middleman-core/extensions/minify_css.rb +1 -1
  35. data/lib/middleman-core/extensions/minify_javascript.rb +1 -1
  36. data/lib/middleman-core/extensions/relative_assets.rb +1 -1
  37. data/lib/middleman-core/extensions.rb +1 -1
  38. data/lib/middleman-core/file_renderer.rb +6 -4
  39. data/lib/middleman-core/meta_pages/sitemap_resource.rb +1 -1
  40. data/lib/middleman-core/meta_pages/templates/config.html.erb +14 -14
  41. data/lib/middleman-core/meta_pages.rb +6 -1
  42. data/lib/middleman-core/preview_server.rb +21 -2
  43. data/lib/middleman-core/rack.rb +5 -3
  44. data/lib/middleman-core/renderers/haml.rb +22 -6
  45. data/lib/middleman-core/renderers/kramdown.rb +10 -3
  46. data/lib/middleman-core/renderers/liquid.rb +22 -3
  47. data/lib/middleman-core/renderers/redcarpet.rb +7 -5
  48. data/lib/middleman-core/renderers/sass.rb +1 -5
  49. data/lib/middleman-core/renderers/slim.rb +16 -12
  50. data/lib/middleman-core/sitemap/extensions/ignores.rb +2 -0
  51. data/lib/middleman-core/sitemap/extensions/on_disk.rb +2 -0
  52. data/lib/middleman-core/sitemap/extensions/proxies.rb +18 -3
  53. data/lib/middleman-core/sitemap/extensions/redirects.rb +2 -0
  54. data/lib/middleman-core/sitemap/extensions/request_endpoints.rb +2 -0
  55. data/lib/middleman-core/sitemap/resource.rb +24 -17
  56. data/lib/middleman-core/sitemap/store.rb +1 -0
  57. data/lib/middleman-core/sources/source_watcher.rb +26 -1
  58. data/lib/middleman-core/step_definitions/builder_steps.rb +8 -8
  59. data/lib/middleman-core/step_definitions/middleman_steps.rb +8 -2
  60. data/lib/middleman-core/step_definitions/server_steps.rb +17 -18
  61. data/lib/middleman-core/step_definitions.rb +0 -1
  62. data/lib/middleman-core/template_context.rb +2 -2
  63. data/lib/middleman-core/util/data.rb +153 -0
  64. data/lib/middleman-core/util.rb +14 -45
  65. data/lib/middleman-core/version.rb +1 -1
  66. data/middleman-core.gemspec +3 -2
  67. data/spec/middleman-core/util_spec.rb +3 -23
  68. metadata +37 -26
  69. data/fixtures/frontmatter-app/source/json-front-matter-2.php.erb +0 -7
  70. data/fixtures/frontmatter-app/source/json-front-matter-encoding.html.erb +0 -7
  71. data/fixtures/frontmatter-app/source/json-front-matter-line-2.html.erb +0 -7
  72. data/fixtures/frontmatter-app/source/json-front-matter.html.erb +0 -6
  73. data/fixtures/frontmatter-neighbor-app/source/json-front-matter-2.php.erb +0 -2
  74. data/fixtures/frontmatter-neighbor-app/source/json-front-matter-2.php.erb.frontmatter +0 -4
  75. data/fixtures/frontmatter-neighbor-app/source/json-front-matter.html.erb +0 -1
  76. data/fixtures/frontmatter-neighbor-app/source/json-front-matter.html.erb.frontmatter +0 -4
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.add_dependency("addressable", ["~> 2.3.5"])
32
32
 
33
33
  # Watcher
34
- s.add_dependency('listen', ['>= 2.7.9', '< 3.0'])
34
+ s.add_dependency('listen', ['~> 3.0'])
35
35
 
36
36
  # i18n
37
37
  s.add_dependency('i18n', ['~> 0.7.0'])
@@ -52,6 +52,7 @@ Gem::Specification.new do |s|
52
52
  # Testing
53
53
  s.add_dependency('contracts', ['~> 0.9.0'])
54
54
 
55
- # Immutability
55
+ # Hash stuff
56
+ s.add_dependency('hashie', ['~> 3.4'])
56
57
  s.add_dependency('hamster', ['~> 1.0'])
57
58
  end
@@ -54,43 +54,23 @@ describe Middleman::Util do
54
54
  end
55
55
 
56
56
  describe "::recursively_enhance" do
57
- it "returns IndifferentHash if given one" do
58
- input = Middleman::Util::IndifferentHash.new({test: "subject"})
59
- subject = Middleman::Util.recursively_enhance input
60
-
61
- expect( subject ).to be_a Middleman::Util::IndifferentHash
62
- expect( subject.test ).to eq "subject"
63
- end
64
-
65
- it "returns IndifferentHash if given a hash" do
57
+ it "returns Hashie extended Hash if given a hash" do
66
58
  input = {test: "subject"}
67
59
  subject = Middleman::Util.recursively_enhance input
68
-
69
- expect( subject ).to be_a Middleman::Util::IndifferentHash
60
+
70
61
  expect( subject.test ).to eq "subject"
71
62
  end
72
63
 
73
64
  it "returns Array with strings, or IndifferentHash, true, false" do
74
- indifferent_hash = Middleman::Util::IndifferentHash.new({test: "subject"})
65
+ indifferent_hash = {test: "subject"}
75
66
  regular_hash = {regular: "hash"}
76
67
  input = [ indifferent_hash, regular_hash, true, false ]
77
68
  subject = Middleman::Util.recursively_enhance input
78
69
 
79
- expect( subject[0] ).to be_a Middleman::Util::IndifferentHash
80
- expect( subject[1] ).to be_a Middleman::Util::IndifferentHash
81
70
  expect( subject[1].regular ).to eq "hash"
82
71
  expect( subject[2] ).to eq true
83
72
  expect( subject[3] ).to eq false
84
73
  end
85
-
86
- it "returns duplicated & frozen original object if not special cased" do
87
- input = "foo"
88
- subject = Middleman::Util.recursively_enhance input
89
-
90
- expect( subject ).to eq input
91
- expect( subject.object_id ).not_to eq input.object_id
92
- expect( subject ).to be_frozen
93
- end
94
74
  end
95
75
 
96
76
  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: 4.0.0.beta.2
4
+ version: 4.0.0.rc.1
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: 2015-05-04 00:00:00.000000000 Z
13
+ date: 2015-09-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -134,20 +134,14 @@ dependencies:
134
134
  name: listen
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: 2.7.9
140
- - - "<"
137
+ - - "~>"
141
138
  - !ruby/object:Gem::Version
142
139
  version: '3.0'
143
140
  type: :runtime
144
141
  prerelease: false
145
142
  version_requirements: !ruby/object:Gem::Requirement
146
143
  requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- version: 2.7.9
150
- - - "<"
144
+ - - "~>"
151
145
  - !ruby/object:Gem::Version
152
146
  version: '3.0'
153
147
  - !ruby/object:Gem::Dependency
@@ -248,6 +242,20 @@ dependencies:
248
242
  - - "~>"
249
243
  - !ruby/object:Gem::Version
250
244
  version: 0.9.0
245
+ - !ruby/object:Gem::Dependency
246
+ name: hashie
247
+ requirement: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - "~>"
250
+ - !ruby/object:Gem::Version
251
+ version: '3.4'
252
+ type: :runtime
253
+ prerelease: false
254
+ version_requirements: !ruby/object:Gem::Requirement
255
+ requirements:
256
+ - - "~>"
257
+ - !ruby/object:Gem::Version
258
+ version: '3.4'
251
259
  - !ruby/object:Gem::Dependency
252
260
  name: hamster
253
261
  requirement: !ruby/object:Gem::Requirement
@@ -301,6 +309,7 @@ files:
301
309
  - features/data.feature
302
310
  - features/directory_index.feature
303
311
  - features/dynamic_pages.feature
312
+ - features/extension_hooks.feature
304
313
  - features/extensionless_text_files.feature
305
314
  - features/feature_params.feature
306
315
  - features/former_padrino_helpers.feature
@@ -330,6 +339,7 @@ files:
330
339
  - features/markdown.feature
331
340
  - features/markdown_kramdown.feature
332
341
  - features/markdown_kramdown_in_haml.feature
342
+ - features/markdown_kramdown_in_slim.feature
333
343
  - features/markdown_redcarpet.feature
334
344
  - features/markdown_redcarpet_in_haml.feature
335
345
  - features/minify_css.feature
@@ -572,6 +582,8 @@ files:
572
582
  - fixtures/env-app/environments/production.rb
573
583
  - fixtures/env-app/source/index.html.erb
574
584
  - fixtures/env-app/source/stylesheets/site.css.scss
585
+ - fixtures/extension-hooks-app/config.rb
586
+ - fixtures/extension-hooks-app/source/index.html.erb
575
587
  - fixtures/extensionless-text-files-app/config.rb
576
588
  - fixtures/extensionless-text-files-app/source/CNAME
577
589
  - fixtures/extensionless-text-files-app/source/LICENSE
@@ -597,10 +609,6 @@ files:
597
609
  - fixtures/frontmatter-app/source/front-matter-encoding.html.erb
598
610
  - fixtures/frontmatter-app/source/front-matter-line-2.html.erb
599
611
  - fixtures/frontmatter-app/source/front-matter-pandoc.html.md.erb
600
- - fixtures/frontmatter-app/source/json-front-matter-2.php.erb
601
- - fixtures/frontmatter-app/source/json-front-matter-encoding.html.erb
602
- - fixtures/frontmatter-app/source/json-front-matter-line-2.html.erb
603
- - fixtures/frontmatter-app/source/json-front-matter.html.erb
604
612
  - fixtures/frontmatter-app/source/raw-front-matter.html
605
613
  - fixtures/frontmatter-app/source/raw-front-matter.php
606
614
  - fixtures/frontmatter-neighbor-app/config.rb
@@ -610,10 +618,6 @@ files:
610
618
  - fixtures/frontmatter-neighbor-app/source/front-matter-change.html.erb.frontmatter
611
619
  - fixtures/frontmatter-neighbor-app/source/front-matter-encoding.html.erb
612
620
  - fixtures/frontmatter-neighbor-app/source/front-matter-encoding.html.erb.frontmatter
613
- - fixtures/frontmatter-neighbor-app/source/json-front-matter-2.php.erb
614
- - fixtures/frontmatter-neighbor-app/source/json-front-matter-2.php.erb.frontmatter
615
- - fixtures/frontmatter-neighbor-app/source/json-front-matter.html.erb
616
- - fixtures/frontmatter-neighbor-app/source/json-front-matter.html.erb.frontmatter
617
621
  - fixtures/frontmatter-neighbor-app/source/raw-front-matter.html
618
622
  - fixtures/frontmatter-neighbor-app/source/raw-front-matter.html.frontmatter
619
623
  - fixtures/frontmatter-neighbor-app/source/raw-front-matter.php
@@ -791,6 +795,9 @@ files:
791
795
  - fixtures/markdown-in-haml-app/config.rb
792
796
  - fixtures/markdown-in-haml-app/source/images/blank.gif
793
797
  - fixtures/markdown-in-haml-app/source/link_target.html.markdown
798
+ - fixtures/markdown-in-slim-app/config.rb
799
+ - fixtures/markdown-in-slim-app/source/images/blank.gif
800
+ - fixtures/markdown-in-slim-app/source/link_target.html.markdown
794
801
  - fixtures/minify-css-app/source/inline-css.html.haml
795
802
  - fixtures/minify-css-app/source/more-css/site.css
796
803
  - fixtures/minify-css-app/source/stylesheets/report.css
@@ -878,6 +885,8 @@ files:
878
885
  - fixtures/nested-data-app/data/examples/deeper/stuff.yml
879
886
  - fixtures/nested-data-app/data/examples/more.yml
880
887
  - fixtures/nested-data-app/data/examples/test.yml
888
+ - fixtures/nested-data-app/data/examples/withcontent.yaml
889
+ - fixtures/nested-data-app/source/extracontent.html.haml.erb
881
890
  - fixtures/nested-data-app/source/test.html.erb
882
891
  - fixtures/nested-layout-app/config.rb
883
892
  - fixtures/nested-layout-app/source/another.html.markdown
@@ -1200,6 +1209,7 @@ files:
1200
1209
  - lib/middleman-core/template_context.rb
1201
1210
  - lib/middleman-core/template_renderer.rb
1202
1211
  - lib/middleman-core/util.rb
1212
+ - lib/middleman-core/util/data.rb
1203
1213
  - lib/middleman-core/version.rb
1204
1214
  - lib/middleman/rack.rb
1205
1215
  - middleman-core.gemspec
@@ -1262,6 +1272,7 @@ test_files:
1262
1272
  - features/data.feature
1263
1273
  - features/directory_index.feature
1264
1274
  - features/dynamic_pages.feature
1275
+ - features/extension_hooks.feature
1265
1276
  - features/extensionless_text_files.feature
1266
1277
  - features/feature_params.feature
1267
1278
  - features/former_padrino_helpers.feature
@@ -1291,6 +1302,7 @@ test_files:
1291
1302
  - features/markdown.feature
1292
1303
  - features/markdown_kramdown.feature
1293
1304
  - features/markdown_kramdown_in_haml.feature
1305
+ - features/markdown_kramdown_in_slim.feature
1294
1306
  - features/markdown_redcarpet.feature
1295
1307
  - features/markdown_redcarpet_in_haml.feature
1296
1308
  - features/minify_css.feature
@@ -1533,6 +1545,8 @@ test_files:
1533
1545
  - fixtures/env-app/environments/production.rb
1534
1546
  - fixtures/env-app/source/index.html.erb
1535
1547
  - fixtures/env-app/source/stylesheets/site.css.scss
1548
+ - fixtures/extension-hooks-app/config.rb
1549
+ - fixtures/extension-hooks-app/source/index.html.erb
1536
1550
  - fixtures/extensionless-text-files-app/config.rb
1537
1551
  - fixtures/extensionless-text-files-app/source/CNAME
1538
1552
  - fixtures/extensionless-text-files-app/source/LICENSE
@@ -1558,10 +1572,6 @@ test_files:
1558
1572
  - fixtures/frontmatter-app/source/front-matter-encoding.html.erb
1559
1573
  - fixtures/frontmatter-app/source/front-matter-line-2.html.erb
1560
1574
  - fixtures/frontmatter-app/source/front-matter-pandoc.html.md.erb
1561
- - fixtures/frontmatter-app/source/json-front-matter-2.php.erb
1562
- - fixtures/frontmatter-app/source/json-front-matter-encoding.html.erb
1563
- - fixtures/frontmatter-app/source/json-front-matter-line-2.html.erb
1564
- - fixtures/frontmatter-app/source/json-front-matter.html.erb
1565
1575
  - fixtures/frontmatter-app/source/raw-front-matter.html
1566
1576
  - fixtures/frontmatter-app/source/raw-front-matter.php
1567
1577
  - fixtures/frontmatter-neighbor-app/config.rb
@@ -1571,10 +1581,6 @@ test_files:
1571
1581
  - fixtures/frontmatter-neighbor-app/source/front-matter-change.html.erb.frontmatter
1572
1582
  - fixtures/frontmatter-neighbor-app/source/front-matter-encoding.html.erb
1573
1583
  - fixtures/frontmatter-neighbor-app/source/front-matter-encoding.html.erb.frontmatter
1574
- - fixtures/frontmatter-neighbor-app/source/json-front-matter-2.php.erb
1575
- - fixtures/frontmatter-neighbor-app/source/json-front-matter-2.php.erb.frontmatter
1576
- - fixtures/frontmatter-neighbor-app/source/json-front-matter.html.erb
1577
- - fixtures/frontmatter-neighbor-app/source/json-front-matter.html.erb.frontmatter
1578
1584
  - fixtures/frontmatter-neighbor-app/source/raw-front-matter.html
1579
1585
  - fixtures/frontmatter-neighbor-app/source/raw-front-matter.html.frontmatter
1580
1586
  - fixtures/frontmatter-neighbor-app/source/raw-front-matter.php
@@ -1752,6 +1758,9 @@ test_files:
1752
1758
  - fixtures/markdown-in-haml-app/config.rb
1753
1759
  - fixtures/markdown-in-haml-app/source/images/blank.gif
1754
1760
  - fixtures/markdown-in-haml-app/source/link_target.html.markdown
1761
+ - fixtures/markdown-in-slim-app/config.rb
1762
+ - fixtures/markdown-in-slim-app/source/images/blank.gif
1763
+ - fixtures/markdown-in-slim-app/source/link_target.html.markdown
1755
1764
  - fixtures/minify-css-app/source/inline-css.html.haml
1756
1765
  - fixtures/minify-css-app/source/more-css/site.css
1757
1766
  - fixtures/minify-css-app/source/stylesheets/report.css
@@ -1839,6 +1848,8 @@ test_files:
1839
1848
  - fixtures/nested-data-app/data/examples/deeper/stuff.yml
1840
1849
  - fixtures/nested-data-app/data/examples/more.yml
1841
1850
  - fixtures/nested-data-app/data/examples/test.yml
1851
+ - fixtures/nested-data-app/data/examples/withcontent.yaml
1852
+ - fixtures/nested-data-app/source/extracontent.html.haml.erb
1842
1853
  - fixtures/nested-data-app/source/test.html.erb
1843
1854
  - fixtures/nested-layout-app/config.rb
1844
1855
  - fixtures/nested-layout-app/source/another.html.markdown
@@ -1,7 +0,0 @@
1
- ;;;
2
- "layout": false,
3
- "title": "This is the title"
4
- ;;;
5
-
6
- <h1><%= current_page.data.title %></h1>
7
- <?php echo "sup"; ?>
@@ -1,7 +0,0 @@
1
- # encoding: UTF-8
2
- ;;;
3
- "layout": false,
4
- "title": "This is the title"
5
- ;;;
6
-
7
- <h1><%= current_page.data.title %></h1>
@@ -1,7 +0,0 @@
1
- <h2> Test</h2>
2
- ;;;
3
- layout: false,
4
- title: "This is the title"
5
- ;;;
6
-
7
- <h1><%= current_page.data.title %></h1>
@@ -1,6 +0,0 @@
1
- ;;;
2
- "layout": false,
3
- "title": "This is the title"
4
- ;;;
5
-
6
- <h1><%= current_page.data.title %></h1>
@@ -1,2 +0,0 @@
1
- <h1><%= current_page.data.title %></h1>
2
- <?php echo "sup"; ?>
@@ -1,4 +0,0 @@
1
- ;;;
2
- "layout": false,
3
- "title": "This is the title"
4
- ;;;
@@ -1 +0,0 @@
1
- <h1><%= current_page.data.title %></h1>
@@ -1,4 +0,0 @@
1
- ;;;
2
- "layout": false,
3
- "title": "This is the title"
4
- ;;;