monad 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. data/CONTRIBUTING.md +68 -0
  2. data/Gemfile +2 -0
  3. data/LICENSE +21 -0
  4. data/README.md +88 -0
  5. data/Rakefile +136 -0
  6. data/bin/monad +102 -0
  7. data/cucumber.yml +3 -0
  8. data/features/create_sites.feature +112 -0
  9. data/features/data_sources.feature +76 -0
  10. data/features/drafts.feature +25 -0
  11. data/features/embed_filters.feature +60 -0
  12. data/features/markdown.feature +30 -0
  13. data/features/pagination.feature +54 -0
  14. data/features/permalinks.feature +65 -0
  15. data/features/post_data.feature +214 -0
  16. data/features/site_configuration.feature +206 -0
  17. data/features/site_data.feature +101 -0
  18. data/features/step_definitions/monad_steps.rb +175 -0
  19. data/features/support/env.rb +25 -0
  20. data/lib/monad.rb +90 -0
  21. data/lib/monad/command.rb +27 -0
  22. data/lib/monad/commands/build.rb +64 -0
  23. data/lib/monad/commands/doctor.rb +29 -0
  24. data/lib/monad/commands/new.rb +50 -0
  25. data/lib/monad/commands/serve.rb +33 -0
  26. data/lib/monad/configuration.rb +183 -0
  27. data/lib/monad/converter.rb +48 -0
  28. data/lib/monad/converters/identity.rb +21 -0
  29. data/lib/monad/converters/markdown.rb +43 -0
  30. data/lib/monad/converters/markdown/kramdown_parser.rb +44 -0
  31. data/lib/monad/converters/markdown/maruku_parser.rb +47 -0
  32. data/lib/monad/converters/markdown/rdiscount_parser.rb +35 -0
  33. data/lib/monad/converters/markdown/redcarpet_parser.rb +70 -0
  34. data/lib/monad/converters/textile.rb +50 -0
  35. data/lib/monad/convertible.rb +152 -0
  36. data/lib/monad/core_ext.rb +68 -0
  37. data/lib/monad/deprecator.rb +32 -0
  38. data/lib/monad/draft.rb +35 -0
  39. data/lib/monad/drivers/json_driver.rb +39 -0
  40. data/lib/monad/drivers/yaml_driver.rb +23 -0
  41. data/lib/monad/errors.rb +4 -0
  42. data/lib/monad/filters.rb +154 -0
  43. data/lib/monad/generator.rb +4 -0
  44. data/lib/monad/generators/pagination.rb +143 -0
  45. data/lib/monad/layout.rb +42 -0
  46. data/lib/monad/logger.rb +54 -0
  47. data/lib/monad/mime.types +85 -0
  48. data/lib/monad/page.rb +163 -0
  49. data/lib/monad/plugin.rb +75 -0
  50. data/lib/monad/post.rb +377 -0
  51. data/lib/monad/site.rb +455 -0
  52. data/lib/monad/static_file.rb +70 -0
  53. data/lib/monad/tags/gist.rb +30 -0
  54. data/lib/monad/tags/highlight.rb +85 -0
  55. data/lib/monad/tags/include.rb +37 -0
  56. data/lib/monad/tags/post_url.rb +61 -0
  57. data/lib/site_template/.gitignore +1 -0
  58. data/lib/site_template/_config.yml +2 -0
  59. data/lib/site_template/_layouts/default.html +46 -0
  60. data/lib/site_template/_layouts/post.html +9 -0
  61. data/lib/site_template/_posts/0000-00-00-welcome-to-monad.markdown.erb +24 -0
  62. data/lib/site_template/css/main.css +165 -0
  63. data/lib/site_template/css/syntax.css +60 -0
  64. data/lib/site_template/index.html +13 -0
  65. data/monad.gemspec +197 -0
  66. data/script/bootstrap +2 -0
  67. data/test/fixtures/broken_front_matter1.erb +5 -0
  68. data/test/fixtures/broken_front_matter2.erb +4 -0
  69. data/test/fixtures/broken_front_matter3.erb +7 -0
  70. data/test/fixtures/exploit_front_matter.erb +4 -0
  71. data/test/fixtures/front_matter.erb +4 -0
  72. data/test/fixtures/members.yaml +7 -0
  73. data/test/helper.rb +62 -0
  74. data/test/source/.htaccess +8 -0
  75. data/test/source/_includes/sig.markdown +3 -0
  76. data/test/source/_layouts/default.html +27 -0
  77. data/test/source/_layouts/simple.html +1 -0
  78. data/test/source/_plugins/dummy.rb +8 -0
  79. data/test/source/_posts/2008-02-02-not-published.textile +8 -0
  80. data/test/source/_posts/2008-02-02-published.textile +8 -0
  81. data/test/source/_posts/2008-10-18-foo-bar.textile +8 -0
  82. data/test/source/_posts/2008-11-21-complex.textile +8 -0
  83. data/test/source/_posts/2008-12-03-permalinked-post.textile +9 -0
  84. data/test/source/_posts/2008-12-13-include.markdown +8 -0
  85. data/test/source/_posts/2009-01-27-array-categories.textile +10 -0
  86. data/test/source/_posts/2009-01-27-categories.textile +7 -0
  87. data/test/source/_posts/2009-01-27-category.textile +7 -0
  88. data/test/source/_posts/2009-01-27-empty-categories.textile +7 -0
  89. data/test/source/_posts/2009-01-27-empty-category.textile +7 -0
  90. data/test/source/_posts/2009-03-12-hash-#1.markdown +6 -0
  91. data/test/source/_posts/2009-05-18-empty-tag.textile +6 -0
  92. data/test/source/_posts/2009-05-18-empty-tags.textile +6 -0
  93. data/test/source/_posts/2009-05-18-tag.textile +6 -0
  94. data/test/source/_posts/2009-05-18-tags.textile +9 -0
  95. data/test/source/_posts/2009-06-22-empty-yaml.textile +3 -0
  96. data/test/source/_posts/2009-06-22-no-yaml.textile +1 -0
  97. data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
  98. data/test/source/_posts/2010-01-09-date-override.textile +7 -0
  99. data/test/source/_posts/2010-01-09-time-override.textile +7 -0
  100. data/test/source/_posts/2010-01-09-timezone-override.textile +7 -0
  101. data/test/source/_posts/2010-01-16-override-data.textile +4 -0
  102. data/test/source/_posts/2011-04-12-md-extension.md +7 -0
  103. data/test/source/_posts/2011-04-12-text-extension.text +0 -0
  104. data/test/source/_posts/2013-01-02-post-excerpt.markdown +14 -0
  105. data/test/source/_posts/2013-01-12-nil-layout.textile +6 -0
  106. data/test/source/_posts/2013-01-12-no-layout.textile +5 -0
  107. data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
  108. data/test/source/_posts/2013-04-11-custom-excerpt.markdown +10 -0
  109. data/test/source/_posts/2013-05-10-number-category.textile +7 -0
  110. data/test/source/_posts/es/2008-11-21-nested.textile +8 -0
  111. data/test/source/about.html +6 -0
  112. data/test/source/category/_posts/2008-9-23-categories.textile +6 -0
  113. data/test/source/contacts.html +5 -0
  114. data/test/source/contacts/bar.html +5 -0
  115. data/test/source/contacts/index.html +5 -0
  116. data/test/source/css/screen.css +76 -0
  117. data/test/source/deal.with.dots.html +7 -0
  118. data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +8 -0
  119. data/test/source/index.html +22 -0
  120. data/test/source/sitemap.xml +32 -0
  121. data/test/source/symlink-test/symlinked-file +22 -0
  122. data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +7 -0
  123. data/test/source/z_category/_posts/2008-9-23-categories.textile +6 -0
  124. data/test/suite.rb +11 -0
  125. data/test/test_command.rb +39 -0
  126. data/test/test_configuration.rb +137 -0
  127. data/test/test_convertible.rb +51 -0
  128. data/test/test_core_ext.rb +88 -0
  129. data/test/test_filters.rb +102 -0
  130. data/test/test_generated_site.rb +83 -0
  131. data/test/test_json_driver.rb +63 -0
  132. data/test/test_kramdown.rb +35 -0
  133. data/test/test_new_command.rb +104 -0
  134. data/test/test_page.rb +193 -0
  135. data/test/test_pager.rb +115 -0
  136. data/test/test_post.rb +573 -0
  137. data/test/test_rdiscount.rb +22 -0
  138. data/test/test_redcarpet.rb +61 -0
  139. data/test/test_redcloth.rb +86 -0
  140. data/test/test_site.rb +374 -0
  141. data/test/test_tags.rb +310 -0
  142. data/test/test_yaml_driver.rb +35 -0
  143. metadata +554 -0
@@ -0,0 +1,60 @@
1
+ .highlight { background: #ffffff; }
2
+ .highlight .c { color: #999988; font-style: italic } /* Comment */
3
+ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
4
+ .highlight .k { font-weight: bold } /* Keyword */
5
+ .highlight .o { font-weight: bold } /* Operator */
6
+ .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
7
+ .highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
8
+ .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
9
+ .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
10
+ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
11
+ .highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
12
+ .highlight .ge { font-style: italic } /* Generic.Emph */
13
+ .highlight .gr { color: #aa0000 } /* Generic.Error */
14
+ .highlight .gh { color: #999999 } /* Generic.Heading */
15
+ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
16
+ .highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
17
+ .highlight .go { color: #888888 } /* Generic.Output */
18
+ .highlight .gp { color: #555555 } /* Generic.Prompt */
19
+ .highlight .gs { font-weight: bold } /* Generic.Strong */
20
+ .highlight .gu { color: #aaaaaa } /* Generic.Subheading */
21
+ .highlight .gt { color: #aa0000 } /* Generic.Traceback */
22
+ .highlight .kc { font-weight: bold } /* Keyword.Constant */
23
+ .highlight .kd { font-weight: bold } /* Keyword.Declaration */
24
+ .highlight .kp { font-weight: bold } /* Keyword.Pseudo */
25
+ .highlight .kr { font-weight: bold } /* Keyword.Reserved */
26
+ .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
27
+ .highlight .m { color: #009999 } /* Literal.Number */
28
+ .highlight .s { color: #d14 } /* Literal.String */
29
+ .highlight .na { color: #008080 } /* Name.Attribute */
30
+ .highlight .nb { color: #0086B3 } /* Name.Builtin */
31
+ .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
32
+ .highlight .no { color: #008080 } /* Name.Constant */
33
+ .highlight .ni { color: #800080 } /* Name.Entity */
34
+ .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
35
+ .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
36
+ .highlight .nn { color: #555555 } /* Name.Namespace */
37
+ .highlight .nt { color: #000080 } /* Name.Tag */
38
+ .highlight .nv { color: #008080 } /* Name.Variable */
39
+ .highlight .ow { font-weight: bold } /* Operator.Word */
40
+ .highlight .w { color: #bbbbbb } /* Text.Whitespace */
41
+ .highlight .mf { color: #009999 } /* Literal.Number.Float */
42
+ .highlight .mh { color: #009999 } /* Literal.Number.Hex */
43
+ .highlight .mi { color: #009999 } /* Literal.Number.Integer */
44
+ .highlight .mo { color: #009999 } /* Literal.Number.Oct */
45
+ .highlight .sb { color: #d14 } /* Literal.String.Backtick */
46
+ .highlight .sc { color: #d14 } /* Literal.String.Char */
47
+ .highlight .sd { color: #d14 } /* Literal.String.Doc */
48
+ .highlight .s2 { color: #d14 } /* Literal.String.Double */
49
+ .highlight .se { color: #d14 } /* Literal.String.Escape */
50
+ .highlight .sh { color: #d14 } /* Literal.String.Heredoc */
51
+ .highlight .si { color: #d14 } /* Literal.String.Interpol */
52
+ .highlight .sx { color: #d14 } /* Literal.String.Other */
53
+ .highlight .sr { color: #009926 } /* Literal.String.Regex */
54
+ .highlight .s1 { color: #d14 } /* Literal.String.Single */
55
+ .highlight .ss { color: #990073 } /* Literal.String.Symbol */
56
+ .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
57
+ .highlight .vc { color: #008080 } /* Name.Variable.Class */
58
+ .highlight .vg { color: #008080 } /* Name.Variable.Global */
59
+ .highlight .vi { color: #008080 } /* Name.Variable.Instance */
60
+ .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
@@ -0,0 +1,13 @@
1
+ ---
2
+ layout: default
3
+ title: Your New Monad Site
4
+ ---
5
+
6
+ <div id="home">
7
+ <h1>Blog Posts</h1>
8
+ <ul class="posts">
9
+ {% for post in site.posts %}
10
+ <li><span>{{ post.date | date_to_string }}</span> &raquo; <a href="{{ post.url }}">{{ post.title }}</a></li>
11
+ {% endfor %}
12
+ </ul>
13
+ </div>
@@ -0,0 +1,197 @@
1
+ Gem::Specification.new do |s|
2
+ s.specification_version = 2 if s.respond_to? :specification_version=
3
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
4
+ s.rubygems_version = '1.3.5'
5
+
6
+ s.name = 'monad'
7
+ s.version = '0.0.1'
8
+ s.license = 'MIT'
9
+ s.date = '2013-05-13'
10
+
11
+ s.summary = "A simple, blog aware, static site generator based on jekyll."
12
+ s.description = "Monad is a simple, blog aware, static site generator based on jekyll."
13
+
14
+ s.authors = ["liufengyun"]
15
+ s.email = 'liufengyunchina@gmail.com'
16
+ s.homepage = 'http://github.com/liufengyun/monad'
17
+
18
+ s.require_paths = %w[lib]
19
+
20
+ s.executables = ["monad"]
21
+
22
+ s.rdoc_options = ["--charset=UTF-8"]
23
+ s.extra_rdoc_files = %w[README.md LICENSE]
24
+
25
+ s.add_runtime_dependency('liquid', "~> 2.3")
26
+ s.add_runtime_dependency('classifier', "~> 1.3")
27
+ s.add_runtime_dependency('directory_watcher', "~> 1.4.1")
28
+ s.add_runtime_dependency('maruku', "~> 0.5")
29
+ s.add_runtime_dependency('kramdown', "~> 1.0.2")
30
+ s.add_runtime_dependency('pygments.rb', "~> 0.5.0")
31
+ s.add_runtime_dependency('commander', "~> 4.1.3")
32
+ s.add_runtime_dependency('safe_yaml', "~> 0.7.0")
33
+ s.add_runtime_dependency('colorator', "~> 0.1")
34
+
35
+ s.add_development_dependency('rake', "~> 10.0.3")
36
+ s.add_development_dependency('rdoc', "~> 3.11")
37
+ s.add_development_dependency('redgreen', "~> 1.2")
38
+ s.add_development_dependency('shoulda', "~> 3.3.2")
39
+ s.add_development_dependency('rr', "~> 1.0")
40
+ s.add_development_dependency('cucumber', "~> 1.2.1", '!= 1.2.4')
41
+ s.add_development_dependency('RedCloth', "~> 4.2")
42
+ s.add_development_dependency('rdiscount', "~> 1.6")
43
+ s.add_development_dependency('redcarpet', "~> 2.2.2")
44
+ s.add_development_dependency('launchy', "~> 2.1.2")
45
+ s.add_development_dependency('simplecov', "~> 0.7")
46
+ s.add_development_dependency('simplecov-gem-adapter', "~> 1.0.1")
47
+
48
+ # = MANIFEST =
49
+ s.files = %w[
50
+ CONTRIBUTING.md
51
+ Gemfile
52
+ LICENSE
53
+ README.md
54
+ Rakefile
55
+ bin/monad
56
+ cucumber.yml
57
+ features/create_sites.feature
58
+ features/data_sources.feature
59
+ features/drafts.feature
60
+ features/embed_filters.feature
61
+ features/markdown.feature
62
+ features/pagination.feature
63
+ features/permalinks.feature
64
+ features/post_data.feature
65
+ features/site_configuration.feature
66
+ features/site_data.feature
67
+ features/step_definitions/monad_steps.rb
68
+ features/support/env.rb
69
+ lib/monad.rb
70
+ lib/monad/command.rb
71
+ lib/monad/commands/build.rb
72
+ lib/monad/commands/doctor.rb
73
+ lib/monad/commands/new.rb
74
+ lib/monad/commands/serve.rb
75
+ lib/monad/configuration.rb
76
+ lib/monad/converter.rb
77
+ lib/monad/converters/identity.rb
78
+ lib/monad/converters/markdown.rb
79
+ lib/monad/converters/markdown/kramdown_parser.rb
80
+ lib/monad/converters/markdown/maruku_parser.rb
81
+ lib/monad/converters/markdown/rdiscount_parser.rb
82
+ lib/monad/converters/markdown/redcarpet_parser.rb
83
+ lib/monad/converters/textile.rb
84
+ lib/monad/convertible.rb
85
+ lib/monad/core_ext.rb
86
+ lib/monad/deprecator.rb
87
+ lib/monad/draft.rb
88
+ lib/monad/drivers/json_driver.rb
89
+ lib/monad/drivers/yaml_driver.rb
90
+ lib/monad/errors.rb
91
+ lib/monad/filters.rb
92
+ lib/monad/generator.rb
93
+ lib/monad/generators/pagination.rb
94
+ lib/monad/layout.rb
95
+ lib/monad/logger.rb
96
+ lib/monad/mime.types
97
+ lib/monad/page.rb
98
+ lib/monad/plugin.rb
99
+ lib/monad/post.rb
100
+ lib/monad/site.rb
101
+ lib/monad/static_file.rb
102
+ lib/monad/tags/gist.rb
103
+ lib/monad/tags/highlight.rb
104
+ lib/monad/tags/include.rb
105
+ lib/monad/tags/post_url.rb
106
+ lib/site_template/.gitignore
107
+ lib/site_template/_config.yml
108
+ lib/site_template/_layouts/default.html
109
+ lib/site_template/_layouts/post.html
110
+ lib/site_template/_posts/0000-00-00-welcome-to-monad.markdown.erb
111
+ lib/site_template/css/main.css
112
+ lib/site_template/css/syntax.css
113
+ lib/site_template/index.html
114
+ monad.gemspec
115
+ script/bootstrap
116
+ test/fixtures/broken_front_matter1.erb
117
+ test/fixtures/broken_front_matter2.erb
118
+ test/fixtures/broken_front_matter3.erb
119
+ test/fixtures/exploit_front_matter.erb
120
+ test/fixtures/front_matter.erb
121
+ test/fixtures/members.yaml
122
+ test/helper.rb
123
+ test/source/.htaccess
124
+ test/source/_includes/sig.markdown
125
+ test/source/_layouts/default.html
126
+ test/source/_layouts/simple.html
127
+ test/source/_plugins/dummy.rb
128
+ test/source/_posts/2008-02-02-not-published.textile
129
+ test/source/_posts/2008-02-02-published.textile
130
+ test/source/_posts/2008-10-18-foo-bar.textile
131
+ test/source/_posts/2008-11-21-complex.textile
132
+ test/source/_posts/2008-12-03-permalinked-post.textile
133
+ test/source/_posts/2008-12-13-include.markdown
134
+ test/source/_posts/2009-01-27-array-categories.textile
135
+ test/source/_posts/2009-01-27-categories.textile
136
+ test/source/_posts/2009-01-27-category.textile
137
+ test/source/_posts/2009-01-27-empty-categories.textile
138
+ test/source/_posts/2009-01-27-empty-category.textile
139
+ test/source/_posts/2009-03-12-hash-#1.markdown
140
+ test/source/_posts/2009-05-18-empty-tag.textile
141
+ test/source/_posts/2009-05-18-empty-tags.textile
142
+ test/source/_posts/2009-05-18-tag.textile
143
+ test/source/_posts/2009-05-18-tags.textile
144
+ test/source/_posts/2009-06-22-empty-yaml.textile
145
+ test/source/_posts/2009-06-22-no-yaml.textile
146
+ test/source/_posts/2010-01-08-triple-dash.markdown
147
+ test/source/_posts/2010-01-09-date-override.textile
148
+ test/source/_posts/2010-01-09-time-override.textile
149
+ test/source/_posts/2010-01-09-timezone-override.textile
150
+ test/source/_posts/2010-01-16-override-data.textile
151
+ test/source/_posts/2011-04-12-md-extension.md
152
+ test/source/_posts/2011-04-12-text-extension.text
153
+ test/source/_posts/2013-01-02-post-excerpt.markdown
154
+ test/source/_posts/2013-01-12-nil-layout.textile
155
+ test/source/_posts/2013-01-12-no-layout.textile
156
+ test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep
157
+ test/source/_posts/2013-04-11-custom-excerpt.markdown
158
+ test/source/_posts/2013-05-10-number-category.textile
159
+ test/source/_posts/es/2008-11-21-nested.textile
160
+ test/source/about.html
161
+ test/source/category/_posts/2008-9-23-categories.textile
162
+ test/source/contacts.html
163
+ test/source/contacts/bar.html
164
+ test/source/contacts/index.html
165
+ test/source/css/screen.css
166
+ test/source/deal.with.dots.html
167
+ test/source/foo/_posts/bar/2008-12-12-topical-post.textile
168
+ test/source/index.html
169
+ test/source/sitemap.xml
170
+ test/source/symlink-test/symlinked-dir
171
+ test/source/symlink-test/symlinked-file
172
+ test/source/win/_posts/2009-05-24-yaml-linebreak.markdown
173
+ test/source/z_category/_posts/2008-9-23-categories.textile
174
+ test/suite.rb
175
+ test/test_command.rb
176
+ test/test_configuration.rb
177
+ test/test_convertible.rb
178
+ test/test_core_ext.rb
179
+ test/test_filters.rb
180
+ test/test_generated_site.rb
181
+ test/test_json_driver.rb
182
+ test/test_kramdown.rb
183
+ test/test_new_command.rb
184
+ test/test_page.rb
185
+ test/test_pager.rb
186
+ test/test_post.rb
187
+ test/test_rdiscount.rb
188
+ test/test_redcarpet.rb
189
+ test/test_redcloth.rb
190
+ test/test_site.rb
191
+ test/test_tags.rb
192
+ test/test_yaml_driver.rb
193
+ ]
194
+ # = MANIFEST =
195
+
196
+ s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
197
+ end
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ bundle install
@@ -0,0 +1,5 @@
1
+ # Some stuff on the first line
2
+ ---
3
+ test: good
4
+ ---
5
+ Real content starts here
@@ -0,0 +1,4 @@
1
+ ---
2
+ bad yaml: [
3
+ ---
4
+ Real content starts here
@@ -0,0 +1,7 @@
1
+ ---
2
+ test: good
3
+ ---
4
+ Real content starts here
5
+
6
+ ������� �����
7
+
@@ -0,0 +1,4 @@
1
+ ---
2
+ test: !ruby/hash:DoesNotExist {}
3
+ ---
4
+ Real content starts here
@@ -0,0 +1,4 @@
1
+ ---
2
+ test: good
3
+ ---
4
+ Real content starts here
@@ -0,0 +1,7 @@
1
+ - name: jack
2
+ age: 27
3
+ blog: http://test.com/jack
4
+
5
+ - name: john
6
+ age: 32
7
+ blog: http://test.com/john
@@ -0,0 +1,62 @@
1
+ if RUBY_VERSION > '1.9' && ENV["COVERAGE"] == "true"
2
+ require 'simplecov'
3
+ require 'simplecov-gem-adapter'
4
+ SimpleCov.start('gem')
5
+ end
6
+
7
+ require 'rubygems'
8
+ require 'test/unit'
9
+ require 'ostruct'
10
+ gem 'RedCloth', '>= 4.2.1'
11
+
12
+ require 'monad'
13
+
14
+ require 'RedCloth'
15
+ require 'rdiscount'
16
+ require 'kramdown'
17
+ require 'redcarpet'
18
+
19
+ require 'redgreen' if RUBY_VERSION < '1.9'
20
+ require 'shoulda'
21
+ require 'rr'
22
+
23
+ include Monad
24
+
25
+ # Send STDERR into the void to suppress program output messages
26
+ STDERR.reopen(test(?e, '/dev/null') ? '/dev/null' : 'NUL:')
27
+
28
+ class Test::Unit::TestCase
29
+ include RR::Adapters::TestUnit
30
+
31
+ def dest_dir(*subdirs)
32
+ test_dir('dest', *subdirs)
33
+ end
34
+
35
+ def source_dir(*subdirs)
36
+ test_dir('source', *subdirs)
37
+ end
38
+
39
+ def clear_dest
40
+ FileUtils.rm_rf(dest_dir)
41
+ end
42
+
43
+ def test_dir(*subdirs)
44
+ File.join(File.dirname(__FILE__), *subdirs)
45
+ end
46
+
47
+ def directory_with_contents(path)
48
+ FileUtils.rm_rf(path)
49
+ FileUtils.mkdir(path)
50
+ File.open("#{path}/index.html", "w"){ |f| f.write("I was previously generated.") }
51
+ end
52
+
53
+ def capture_stdout
54
+ $old_stdout = $stdout
55
+ $stdout = StringIO.new
56
+ yield
57
+ $stdout.rewind
58
+ return $stdout.string
59
+ ensure
60
+ $stdout = $old_stdout
61
+ end
62
+ end
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: nil
3
+ ---
4
+ ErrorDocument 404 /404.html
5
+ ErrorDocument 500 /500.html
6
+ {% for post in site.posts %}
7
+ # {{ post.url }}
8
+ {% endfor %}
@@ -0,0 +1,3 @@
1
+ --
2
+ Tom Preston-Werner
3
+ github.com/mojombo
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
5
+ <head>
6
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7
+ <title>{{ page.title }}</title>
8
+ <meta name="author" content="<%= @page.author %>" />
9
+
10
+ <!-- CodeRay syntax highlighting CSS -->
11
+ <link rel="stylesheet" href="/css/coderay.css" type="text/css" />
12
+
13
+ <!-- Homepage CSS -->
14
+ <link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen, projection" />
15
+ </head>
16
+ <body>
17
+
18
+ <div class="site">
19
+ <div class="title">
20
+ Tom Preston-Werner
21
+ </div>
22
+
23
+ {{ content }}
24
+ </div>
25
+
26
+ </body>
27
+ </html>
@@ -0,0 +1 @@
1
+ <<< {{ content }} >>>
@@ -0,0 +1,8 @@
1
+ module Monad
2
+ class Dummy < Generator
3
+ priority :high
4
+
5
+ def generate(site)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: Not published!
4
+ published: false
5
+ category: publish_test
6
+ ---
7
+
8
+ This should *not* be published!