benoit 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. data/.gitignore +4 -0
  2. data/.gitmodules +3 -0
  3. data/.rspec +1 -0
  4. data/.rspec-turnip +1 -0
  5. data/.ruby-version +1 -0
  6. data/Assetfile +44 -0
  7. data/Gemfile +5 -0
  8. data/Gemfile.lock +110 -0
  9. data/Rakefile +9 -0
  10. data/benoit.gemspec +50 -0
  11. data/bin/benoit +121 -0
  12. data/bin/bundle-development +1 -0
  13. data/bin/bundle-sandbox +1 -0
  14. data/lib/benoit.rb +36 -0
  15. data/lib/benoit/cadenza.rb +11 -0
  16. data/lib/benoit/cadenza/output_filters.rb +21 -0
  17. data/lib/benoit/cleaner.rb +10 -0
  18. data/lib/benoit/compiler_error.rb +49 -0
  19. data/lib/benoit/configuration.rb +24 -0
  20. data/lib/benoit/current_site.rb +12 -0
  21. data/lib/benoit/file_wrapper_extensions.rb +13 -0
  22. data/lib/benoit/filters.rb +15 -0
  23. data/lib/benoit/filters/base_filter.rb +44 -0
  24. data/lib/benoit/filters/blacklist_filter.rb +18 -0
  25. data/lib/benoit/filters/cadenza_filter.rb +75 -0
  26. data/lib/benoit/filters/content_page_filter.rb +45 -0
  27. data/lib/benoit/filters/markdown_filter.rb +19 -0
  28. data/lib/benoit/filters/metadata_cleaner.rb +30 -0
  29. data/lib/benoit/filters/move_to_root_filter.rb +22 -0
  30. data/lib/benoit/filters/pagination_filter.rb +23 -0
  31. data/lib/benoit/filters/pass_thru_filter.rb +22 -0
  32. data/lib/benoit/filters/sass_filter.rb +74 -0
  33. data/lib/benoit/filters/set_metadata_filter.rb +15 -0
  34. data/lib/benoit/logger.rb +69 -0
  35. data/lib/benoit/page.rb +88 -0
  36. data/lib/benoit/page_metadata.rb +8 -0
  37. data/lib/benoit/page_metadata/container.rb +74 -0
  38. data/lib/benoit/page_metadata/json_converter.rb +28 -0
  39. data/lib/benoit/page_metadata/parser.rb +38 -0
  40. data/lib/benoit/page_metadata/store.rb +75 -0
  41. data/lib/benoit/pipeline.rb +1 -0
  42. data/lib/benoit/pipeline/dsl_extensions.rb +8 -0
  43. data/lib/benoit/pipeline/pagination_matcher.rb +53 -0
  44. data/lib/benoit/pipeline_project.rb +81 -0
  45. data/lib/benoit/site_context.rb +123 -0
  46. data/lib/benoit/utils/finds_layouts_for_template.rb +77 -0
  47. data/lib/benoit/utils/normalizes_path_to_template.rb +43 -0
  48. data/lib/benoit/utils/paginated_list.rb +102 -0
  49. data/lib/benoit/version.rb +3 -0
  50. data/lib/build_notifiers/file_built_notifier.rb +20 -0
  51. data/lib/build_notifiers/progress_notifier.rb +57 -0
  52. data/lib/cli.rb +39 -0
  53. data/spec/.rbenv-gemsets +1 -0
  54. data/spec/Gemfile +9 -0
  55. data/spec/Gemfile.lock +57 -0
  56. data/spec/bin/autospec +16 -0
  57. data/spec/bin/cucumber +16 -0
  58. data/spec/bin/htmldiff +16 -0
  59. data/spec/bin/ldiff +16 -0
  60. data/spec/bin/rspec +16 -0
  61. data/spec/features/build_command.feature +46 -0
  62. data/spec/features/frontmatter_metadata.feature +99 -0
  63. data/spec/features/javascript_files.feature +35 -0
  64. data/spec/features/output_filters.feature +20 -0
  65. data/spec/features/page_layouts.feature +72 -0
  66. data/spec/features/pagination.feature +58 -0
  67. data/spec/features/sass_files.feature +30 -0
  68. data/spec/features/version.feature +5 -0
  69. data/spec/lib/filters/base_filter_spec.rb +141 -0
  70. data/spec/lib/filters/markdown_filter_spec.rb +65 -0
  71. data/spec/lib/filters/sass_filter_spec.rb +73 -0
  72. data/spec/lib/metadata_json_converter_spec.rb +65 -0
  73. data/spec/lib/metadata_store_spec.rb +148 -0
  74. data/spec/lib/page_spec.rb +19 -0
  75. data/spec/lib/site_context_spec.rb +106 -0
  76. data/spec/spec_helper.rb +16 -0
  77. data/spec/steps/output_file_steps.rb +45 -0
  78. data/spec/steps/run_steps.rb +71 -0
  79. data/spec/steps/staticly_steps.rb +194 -0
  80. data/spec/support/aruba/rspec.rb +66 -0
  81. data/spec/support/files/img.png +0 -0
  82. data/spec/support/files/input.css.scss +7 -0
  83. data/spec/support/files/input.scss +7 -0
  84. data/spec/support/spec_helpers/file_helpers.rb +8 -0
  85. data/spec/support/spec_helpers/memory_file_wrapper.rb +43 -0
  86. data/spec/support/spec_helpers/memory_manifest.rb +19 -0
  87. data/spec/turnip_helper.rb +19 -0
  88. data/vendor/frontmatter/frontmatter.gemspec +24 -0
  89. data/vendor/frontmatter/lib/frontmatter.rb +92 -0
  90. data/vendor/frontmatter/lib/frontmatter/version.rb +3 -0
  91. data/vendor/rake-pipeline/.gitignore +18 -0
  92. data/vendor/rake-pipeline/.rspec +1 -0
  93. data/vendor/rake-pipeline/.travis.yml +12 -0
  94. data/vendor/rake-pipeline/.yardopts +2 -0
  95. data/vendor/rake-pipeline/GETTING_STARTED.md +268 -0
  96. data/vendor/rake-pipeline/Gemfile +14 -0
  97. data/vendor/rake-pipeline/LICENSE +20 -0
  98. data/vendor/rake-pipeline/README.markdown +11 -0
  99. data/vendor/rake-pipeline/README.yard +178 -0
  100. data/vendor/rake-pipeline/Rakefile +21 -0
  101. data/vendor/rake-pipeline/bin/rakep +4 -0
  102. data/vendor/rake-pipeline/examples/copying_files.md +12 -0
  103. data/vendor/rake-pipeline/examples/minifying_files.md +37 -0
  104. data/vendor/rake-pipeline/examples/modifying_pipelines.md +67 -0
  105. data/vendor/rake-pipeline/examples/multiple_pipelines.md +77 -0
  106. data/vendor/rake-pipeline/lib/generators/rake/pipeline/install/install_generator.rb +70 -0
  107. data/vendor/rake-pipeline/lib/rake-pipeline.rb +509 -0
  108. data/vendor/rake-pipeline/lib/rake-pipeline/cli.rb +57 -0
  109. data/vendor/rake-pipeline/lib/rake-pipeline/dsl.rb +9 -0
  110. data/vendor/rake-pipeline/lib/rake-pipeline/dsl/pipeline_dsl.rb +246 -0
  111. data/vendor/rake-pipeline/lib/rake-pipeline/dsl/project_dsl.rb +108 -0
  112. data/vendor/rake-pipeline/lib/rake-pipeline/dynamic_file_task.rb +194 -0
  113. data/vendor/rake-pipeline/lib/rake-pipeline/error.rb +17 -0
  114. data/vendor/rake-pipeline/lib/rake-pipeline/file_wrapper.rb +195 -0
  115. data/vendor/rake-pipeline/lib/rake-pipeline/filter.rb +267 -0
  116. data/vendor/rake-pipeline/lib/rake-pipeline/filters.rb +4 -0
  117. data/vendor/rake-pipeline/lib/rake-pipeline/filters/concat_filter.rb +63 -0
  118. data/vendor/rake-pipeline/lib/rake-pipeline/filters/gsub_filter.rb +56 -0
  119. data/vendor/rake-pipeline/lib/rake-pipeline/filters/ordering_concat_filter.rb +38 -0
  120. data/vendor/rake-pipeline/lib/rake-pipeline/filters/pipeline_finalizing_filter.rb +21 -0
  121. data/vendor/rake-pipeline/lib/rake-pipeline/graph.rb +178 -0
  122. data/vendor/rake-pipeline/lib/rake-pipeline/manifest.rb +82 -0
  123. data/vendor/rake-pipeline/lib/rake-pipeline/manifest_entry.rb +34 -0
  124. data/vendor/rake-pipeline/lib/rake-pipeline/matcher.rb +141 -0
  125. data/vendor/rake-pipeline/lib/rake-pipeline/middleware.rb +73 -0
  126. data/vendor/rake-pipeline/lib/rake-pipeline/precompile.rake +8 -0
  127. data/vendor/rake-pipeline/lib/rake-pipeline/project.rb +338 -0
  128. data/vendor/rake-pipeline/lib/rake-pipeline/rails_plugin.rb +10 -0
  129. data/vendor/rake-pipeline/lib/rake-pipeline/railtie.rb +34 -0
  130. data/vendor/rake-pipeline/lib/rake-pipeline/reject_matcher.rb +29 -0
  131. data/vendor/rake-pipeline/lib/rake-pipeline/server.rb +15 -0
  132. data/vendor/rake-pipeline/lib/rake-pipeline/sorted_pipeline.rb +19 -0
  133. data/vendor/rake-pipeline/lib/rake-pipeline/version.rb +6 -0
  134. data/vendor/rake-pipeline/rails/init.rb +2 -0
  135. data/vendor/rake-pipeline/rake-pipeline.gemspec +24 -0
  136. data/vendor/rake-pipeline/spec/cli_spec.rb +73 -0
  137. data/vendor/rake-pipeline/spec/concat_filter_spec.rb +37 -0
  138. data/vendor/rake-pipeline/spec/dsl/pipeline_dsl_spec.rb +165 -0
  139. data/vendor/rake-pipeline/spec/dsl/project_dsl_spec.rb +41 -0
  140. data/vendor/rake-pipeline/spec/dynamic_file_task_spec.rb +119 -0
  141. data/vendor/rake-pipeline/spec/encoding_spec.rb +106 -0
  142. data/vendor/rake-pipeline/spec/file_wrapper_spec.rb +132 -0
  143. data/vendor/rake-pipeline/spec/filter_spec.rb +367 -0
  144. data/vendor/rake-pipeline/spec/graph_spec.rb +56 -0
  145. data/vendor/rake-pipeline/spec/gsub_filter_spec.rb +87 -0
  146. data/vendor/rake-pipeline/spec/manifest_entry_spec.rb +46 -0
  147. data/vendor/rake-pipeline/spec/manifest_spec.rb +67 -0
  148. data/vendor/rake-pipeline/spec/matcher_spec.rb +141 -0
  149. data/vendor/rake-pipeline/spec/middleware_spec.rb +199 -0
  150. data/vendor/rake-pipeline/spec/ordering_concat_filter_spec.rb +42 -0
  151. data/vendor/rake-pipeline/spec/pipeline_spec.rb +232 -0
  152. data/vendor/rake-pipeline/spec/project_spec.rb +295 -0
  153. data/vendor/rake-pipeline/spec/rake_acceptance_spec.rb +720 -0
  154. data/vendor/rake-pipeline/spec/rake_tasks_spec.rb +21 -0
  155. data/vendor/rake-pipeline/spec/reject_matcher_spec.rb +31 -0
  156. data/vendor/rake-pipeline/spec/sorted_pipeline_spec.rb +27 -0
  157. data/vendor/rake-pipeline/spec/spec_helper.rb +38 -0
  158. data/vendor/rake-pipeline/spec/support/spec_helpers/file_utils.rb +35 -0
  159. data/vendor/rake-pipeline/spec/support/spec_helpers/filters.rb +37 -0
  160. data/vendor/rake-pipeline/spec/support/spec_helpers/input_helpers.rb +23 -0
  161. data/vendor/rake-pipeline/spec/support/spec_helpers/memory_file_wrapper.rb +35 -0
  162. data/vendor/rake-pipeline/spec/support/spec_helpers/memory_manifest.rb +19 -0
  163. data/vendor/rake-pipeline/tools/perfs +101 -0
  164. metadata +497 -0
@@ -0,0 +1,57 @@
1
+ module BuildNotifiers
2
+ include Rake::Pipeline::Web::Filters
3
+ include Benoit::Filters
4
+
5
+ FILTER_PHASES = {
6
+ none: [],
7
+ preparing: [MetadataCleaner],
8
+ compiling: [MarkdownFilter, MinispadeFilter, HandlebarsFilter, SassFilter, PaginationFilter, ContentPageFilter, CadenzaFilter],
9
+ finishing: [Rake::Pipeline::PipelineFinalizingFilter]
10
+ }
11
+
12
+
13
+ module ProgressNotifier
14
+
15
+ def self.finalizing?
16
+ @finalizing
17
+ end
18
+
19
+ def self.finalizing=(value)
20
+ @finalizing = true
21
+ end
22
+
23
+ def self.call(_,filter)
24
+ if TrackPhase.last_phase?(filter)
25
+ notify(TrackPhase.lookup_phase(filter))
26
+ end
27
+ if filter.class == Rake::Pipeline::PipelineFinalizingFilter
28
+ ProgressNotifier.finalizing = true
29
+ end
30
+ end
31
+
32
+ def self.notify(phase)
33
+ if Benoit.config.output_mode == :app
34
+ $stdout.puts({ type: "progress", name: phase}.to_json)
35
+ else
36
+ puts "Phase complete: #{phase}"
37
+ end
38
+ $stdout.flush
39
+ end
40
+
41
+ module TrackPhase
42
+
43
+ def self.lookup_phase(filter)
44
+ FILTER_PHASES.keys.detect do |phase|
45
+ FILTER_PHASES[phase].include? filter.class
46
+ end || :none
47
+ end
48
+
49
+ def self.last_phase?(filter)
50
+ FILTER_PHASES[lookup_phase(filter)].first == filter.class
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+
57
+ end
@@ -0,0 +1,39 @@
1
+ require 'json'
2
+
3
+ begin
4
+ $: << File.expand_path("../../bundle", __FILE__)
5
+ require 'bundler/setup'
6
+ rescue LoadError => ex
7
+ output = { message: ex.message, trace: ex.backtrace, load_path: $:.to_json }
8
+ $stderr.puts output
9
+ end
10
+
11
+ $: << File.expand_path(File.dirname(__FILE__))
12
+
13
+ begin
14
+ require 'psych'
15
+ require 'rake'
16
+ require 'rake-pipeline'
17
+ require 'benoit'
18
+ rescue LoadError => ex
19
+ output = { message: ex.message, trace: ex.backtrace, load_path: $:.to_json }
20
+ $stderr.puts output
21
+ raise
22
+ end
23
+
24
+ require 'benoit/filters'
25
+
26
+ begin
27
+ assetfile_path = File.join(File.expand_path("../../", __FILE__), "Assetfile")
28
+ pipeline = RakePipelineInvoke.new(assetfile_path, ARGV[0], ARGV[1])
29
+ pipeline.invoke
30
+ rescue Benoit::CompilerError => ex
31
+ output = { message: ex.message, path: ex.file_path, line_no: ex.line, original_error: ex.output }
32
+ Benoit::Logger.report_error(ex.output)
33
+ $stderr.puts output.to_json
34
+ rescue StandardError => ex
35
+ Benoit::Logger.report_error(ex)
36
+ rescue StandardError => ex
37
+ output = { message: ex.message, trace: ex.backtrace, load_path: $:.to_json }
38
+ $stderr.puts output
39
+ end
@@ -0,0 +1 @@
1
+ benoit-cli global
@@ -0,0 +1,9 @@
1
+ source :rubygems
2
+
3
+ gem 'rspec'
4
+ gem 'turnip'
5
+ gem 'turnip-kanban'
6
+ gem 'aruba'
7
+ gem 'pry'
8
+ gem 'pry-nav'
9
+ gem 'pry-remote'
@@ -0,0 +1,57 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ aruba (0.5.1)
5
+ childprocess (~> 0.3.6)
6
+ cucumber (>= 1.1.1)
7
+ rspec-expectations (>= 2.7.0)
8
+ builder (3.1.4)
9
+ childprocess (0.3.6)
10
+ ffi (~> 1.0, >= 1.0.6)
11
+ coderay (1.0.8)
12
+ cucumber (1.2.1)
13
+ builder (>= 2.1.2)
14
+ diff-lcs (>= 1.1.3)
15
+ gherkin (~> 2.11.0)
16
+ json (>= 1.4.6)
17
+ diff-lcs (1.1.3)
18
+ ffi (1.2.0)
19
+ gherkin (2.11.5)
20
+ json (>= 1.4.6)
21
+ json (1.7.6)
22
+ method_source (0.8.1)
23
+ pry (0.9.10)
24
+ coderay (~> 1.0.5)
25
+ method_source (~> 0.8)
26
+ slop (~> 3.3.1)
27
+ pry-nav (0.2.3)
28
+ pry (~> 0.9.10)
29
+ pry-remote (0.1.6)
30
+ pry (~> 0.9)
31
+ slop (~> 3.0)
32
+ rspec (2.12.0)
33
+ rspec-core (~> 2.12.0)
34
+ rspec-expectations (~> 2.12.0)
35
+ rspec-mocks (~> 2.12.0)
36
+ rspec-core (2.12.2)
37
+ rspec-expectations (2.12.1)
38
+ diff-lcs (~> 1.1.3)
39
+ rspec-mocks (2.12.1)
40
+ slop (3.3.3)
41
+ turnip (1.1.0)
42
+ gherkin (>= 2.5)
43
+ rspec (~> 2.0)
44
+ turnip-kanban (0.0.1)
45
+ turnip
46
+
47
+ PLATFORMS
48
+ ruby
49
+
50
+ DEPENDENCIES
51
+ aruba
52
+ pry
53
+ pry-nav
54
+ pry-remote
55
+ rspec
56
+ turnip
57
+ turnip-kanban
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'autospec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'autospec')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'cucumber' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('cucumber', 'cucumber')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'htmldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'htmldiff')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'ldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'ldiff')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -0,0 +1,46 @@
1
+ Feature: benoit build
2
+
3
+ Background:
4
+ Given a site
5
+
6
+ Scenario: Defaults output path to "./_build"
7
+ When I build the site
8
+ Then a directory named "_build" should exist
9
+
10
+ Scenario: Defaults cache path to "~/.benoit/tmpcache/{site}"
11
+ When I build the site
12
+ Then a cache directory should exist for that site
13
+
14
+ Scenario: Successfully processes images
15
+ Given the site has a file that is an image
16
+ When I build the site
17
+ Then the image should exist in the output site
18
+
19
+ Scenario: --clean argument cleans before building
20
+ Given a file
21
+ When I build the site
22
+ Then that file should exist in the output site
23
+ When I delete the file
24
+ And I build the site with the flag "--clean"
25
+ Then that file should not exist in the output site
26
+
27
+ @backlog
28
+ Scenario: Override default output path
29
+ When I run `benoit build --output-path _compiled`
30
+ Then an empty directory named "_compiled" should exist
31
+
32
+ @backlog
33
+ Scenario: Override default cache path
34
+ When I run `benoit build --cache-path _cache`
35
+ Then an empty directory named "_cache" should exist
36
+
37
+ Scenario: Builds a single file
38
+ Given a file named "index.html" with content:
39
+ """
40
+ <h1>Hello World</h1>
41
+ """
42
+ When I run `benoit build`
43
+ Then the output file "index.html" should have content:
44
+ """
45
+ <h1>Hello World</h1>
46
+ """
@@ -0,0 +1,99 @@
1
+ Feature: Site Context
2
+
3
+ Scenario: Groups posts by type
4
+ Given a site named "subpages"
5
+ And a file named "index.html" with content:
6
+ """
7
+ {% for post in site.posts | sort: "date" | reverse | limit: 5 %}
8
+ <a href="{{ post.permalink }}">{{ post.title }}</a>
9
+ {% endfor %}
10
+ """
11
+ And a file named "entries/post.markdown" with content:
12
+ """
13
+ ---
14
+ layout: _post
15
+ type: post
16
+ title: Testing Post
17
+ ---
18
+
19
+ This is a test
20
+ """
21
+ And an empty file named "_layouts/_post.html"
22
+ When I run `benoit build`
23
+ Then the output file "index.html" should have content:
24
+ """
25
+ <a href="/entries/post.html">Testing Post</a>
26
+ """
27
+
28
+ @backlog
29
+ Scenario: Group arbitrary page types by type
30
+
31
+
32
+ Scenario: Loads content from markdown files
33
+ Given a site named "test"
34
+ And a file named "index.html" with content:
35
+ """
36
+ {% for post in site.posts %}
37
+ {{ post.content }}
38
+ {% endfor %}
39
+ """
40
+ And a file named "entries/post.markdown" with content:
41
+ """
42
+ ---
43
+ layout: _post
44
+ type: post
45
+ ---
46
+
47
+ This is the content
48
+ """
49
+ And an empty file named "_layouts/_post.html"
50
+ When I run `benoit build`
51
+ Then the output file "index.html" should have content:
52
+ """
53
+ This is the content
54
+ """
55
+
56
+ Scenario: Parses field named 'date' as a date object for reliable sorting
57
+ Given a site
58
+ And a file containing metadata:
59
+ """
60
+ date: December 12th, 2012
61
+ type: post
62
+ """
63
+ And a file containing metadata:
64
+ """
65
+ date: April 13th, 2022
66
+ type: post
67
+ """
68
+ And a file named "index.html" with content:
69
+ """
70
+ {% for post in site.posts | sort: "date" %}{{ post.date }}
71
+ {% endfor %}
72
+ """
73
+ When I build the site
74
+ Then the output file "index.html" should have content:
75
+ """
76
+ 2012-12-12
77
+ 2022-04-13
78
+ """
79
+
80
+ Scenario: Metadata contains rendered Markdown
81
+ Given a site
82
+ And a file wih an extension of ".markdown" with content:
83
+ """
84
+ ---
85
+ type: post
86
+ ---
87
+
88
+ [a link](http://www.example.com)
89
+ """
90
+ And a file named "index.html" with content:
91
+ """
92
+ {% for post in site.posts %}{{ post.content }}
93
+ {% endfor %}
94
+ """
95
+ When I build the site
96
+ Then the output file "index.html" should have content:
97
+ """
98
+ <a href="http://www.example.com">a link</a>
99
+ """
@@ -0,0 +1,35 @@
1
+ Feature: Javascript Files
2
+
3
+ Background:
4
+ Given a site
5
+
6
+ Scenario: Concatenates multiple scripts
7
+ Given a file named "js/a.js" with content:
8
+ """
9
+ var blah = "diddy";
10
+ """
11
+ And a file named "js/b.js" with content:
12
+ """
13
+ var doo = "dah";
14
+ """
15
+ When I build the site
16
+ Then the output file "js/app.js" should exist
17
+ And the output file "js/app.js" should only have content:
18
+ """
19
+ var blah = "diddy";var doo = "dah";
20
+ """
21
+ And "a.js" should not exist in the output site
22
+ And "b.js" should not exist in the output site
23
+
24
+ Scenario: Parses Handlebars templates into js/templates.js
25
+ Given a file named "js/templates/blah.handlebars" with content:
26
+ """
27
+ {{ blah }}
28
+ """
29
+ And an empty file named "js/a.js"
30
+ When I build the site
31
+ Then the output file "js/templates.js" should have content:
32
+ """
33
+ Ember.TEMPLATES['blah']=Ember.Handlebars.compile("{{ blah }}")
34
+ """
35
+ And "js/templates/blah.handlebars" should not exist in the output site
@@ -0,0 +1,20 @@
1
+ Feature: format_like Output Filter
2
+
3
+ Background:
4
+ Given a site
5
+
6
+ Scenario: Formats simple dates according to passed example
7
+ Given a file containing metadata:
8
+ """
9
+ date: 2012-12-23
10
+ type: post
11
+ """
12
+ And that file has content:
13
+ """
14
+ {{page.date|format_like:"March 23, 2012"}}
15
+ """
16
+ When I build the site
17
+ Then the output file should have content:
18
+ """
19
+ December 23, 2012
20
+ """