jekyll 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jekyll might be problematic. Click here for more details.

Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/README.markdown +1 -1
  3. data/lib/jekyll.rb +0 -1
  4. data/lib/jekyll/collection.rb +18 -3
  5. data/lib/jekyll/command.rb +0 -25
  6. data/lib/jekyll/commands/build.rb +7 -2
  7. data/lib/jekyll/commands/help.rb +33 -0
  8. data/lib/jekyll/configuration.rb +36 -28
  9. data/lib/jekyll/converters/markdown/kramdown_parser.rb +1 -1
  10. data/lib/jekyll/convertible.rb +43 -20
  11. data/lib/jekyll/deprecator.rb +15 -8
  12. data/lib/jekyll/document.rb +21 -4
  13. data/lib/jekyll/filters.rb +27 -1
  14. data/lib/jekyll/frontmatter_defaults.rb +46 -12
  15. data/lib/jekyll/plugin.rb +10 -1
  16. data/lib/jekyll/post.rb +6 -13
  17. data/lib/jekyll/related_posts.rb +2 -2
  18. data/lib/jekyll/renderer.rb +7 -2
  19. data/lib/jekyll/site.rb +5 -7
  20. data/lib/jekyll/static_file.rb +24 -4
  21. data/lib/jekyll/tags/include.rb +3 -1
  22. data/lib/jekyll/tags/post_url.rb +2 -2
  23. data/lib/jekyll/utils.rb +88 -69
  24. data/lib/jekyll/version.rb +1 -1
  25. data/lib/site_template/_config.yml +6 -4
  26. data/lib/site_template/_includes/footer.html +43 -49
  27. data/lib/site_template/_includes/head.html +3 -4
  28. data/lib/site_template/_includes/header.html +9 -10
  29. data/lib/site_template/_layouts/default.html +6 -5
  30. data/lib/site_template/_layouts/page.html +3 -3
  31. data/lib/site_template/_layouts/post.html +4 -4
  32. data/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb +6 -5
  33. data/lib/site_template/_sass/_base.scss +203 -0
  34. data/lib/site_template/_sass/_layout.scss +236 -0
  35. data/lib/site_template/_sass/_syntax-highlighting.scss +67 -0
  36. data/lib/site_template/css/main.scss +49 -0
  37. data/lib/site_template/feed.xml +1 -1
  38. data/lib/site_template/index.html +7 -4
  39. metadata +24 -431
  40. data/.gitignore +0 -15
  41. data/.travis.yml +0 -27
  42. data/CONTRIBUTING.markdown +0 -91
  43. data/Gemfile +0 -2
  44. data/History.markdown +0 -1310
  45. data/Rakefile +0 -268
  46. data/cucumber.yml +0 -3
  47. data/docs/jp/CONTRIBUTING.jp.markdown +0 -93
  48. data/docs/jp/README.jp.markdown +0 -68
  49. data/features/collections.feature +0 -145
  50. data/features/create_sites.feature +0 -158
  51. data/features/data.feature +0 -105
  52. data/features/drafts.feature +0 -46
  53. data/features/embed_filters.feature +0 -107
  54. data/features/frontmatter_defaults.feature +0 -136
  55. data/features/include_tag.feature +0 -68
  56. data/features/markdown.feature +0 -67
  57. data/features/pagination.feature +0 -82
  58. data/features/permalinks.feature +0 -85
  59. data/features/post_data.feature +0 -261
  60. data/features/post_excerpts.feature +0 -50
  61. data/features/rendering.feature +0 -34
  62. data/features/site_configuration.feature +0 -283
  63. data/features/site_data.feature +0 -107
  64. data/features/step_definitions/jekyll_steps.rb +0 -201
  65. data/features/support/env.rb +0 -65
  66. data/jekyll.gemspec +0 -66
  67. data/lib/site_template/css/main.css +0 -410
  68. data/script/bootstrap +0 -4
  69. data/script/branding +0 -11
  70. data/script/cibuild +0 -7
  71. data/script/console +0 -38
  72. data/script/proof +0 -22
  73. data/script/rebund +0 -140
  74. data/script/test +0 -17
  75. data/site/.gitignore +0 -4
  76. data/site/CNAME +0 -1
  77. data/site/README +0 -1
  78. data/site/_config.yml +0 -9
  79. data/site/_data/docs.yml +0 -46
  80. data/site/_includes/analytics.html +0 -30
  81. data/site/_includes/anchor_links.html +0 -32
  82. data/site/_includes/css/font-awesome.css +0 -44
  83. data/site/_includes/css/gridism.css +0 -110
  84. data/site/_includes/css/normalize.css +0 -1
  85. data/site/_includes/css/pygments.css +0 -72
  86. data/site/_includes/css/style.css +0 -1045
  87. data/site/_includes/docs_contents.html +0 -8
  88. data/site/_includes/docs_contents_mobile.html +0 -10
  89. data/site/_includes/docs_option.html +0 -11
  90. data/site/_includes/docs_ul.html +0 -20
  91. data/site/_includes/footer.html +0 -15
  92. data/site/_includes/header.html +0 -18
  93. data/site/_includes/news_contents.html +0 -33
  94. data/site/_includes/news_contents_mobile.html +0 -11
  95. data/site/_includes/news_item.html +0 -24
  96. data/site/_includes/primary-nav-items.html +0 -17
  97. data/site/_includes/section_nav.html +0 -22
  98. data/site/_includes/top.html +0 -17
  99. data/site/_layouts/default.html +0 -13
  100. data/site/_layouts/docs.html +0 -23
  101. data/site/_layouts/news.html +0 -19
  102. data/site/_layouts/news_item.html +0 -27
  103. data/site/_posts/2013-05-06-jekyll-1-0-0-released.markdown +0 -23
  104. data/site/_posts/2013-05-08-jekyll-1-0-1-released.markdown +0 -27
  105. data/site/_posts/2013-05-12-jekyll-1-0-2-released.markdown +0 -28
  106. data/site/_posts/2013-06-07-jekyll-1-0-3-released.markdown +0 -25
  107. data/site/_posts/2013-07-14-jekyll-1-1-0-released.markdown +0 -27
  108. data/site/_posts/2013-07-24-jekyll-1-1-1-released.markdown +0 -31
  109. data/site/_posts/2013-07-25-jekyll-1-0-4-released.markdown +0 -20
  110. data/site/_posts/2013-07-25-jekyll-1-1-2-released.markdown +0 -20
  111. data/site/_posts/2013-09-06-jekyll-1-2-0-released.markdown +0 -23
  112. data/site/_posts/2013-09-14-jekyll-1-2-1-released.markdown +0 -19
  113. data/site/_posts/2013-10-28-jekyll-1-3-0-rc1-released.markdown +0 -19
  114. data/site/_posts/2013-11-04-jekyll-1-3-0-released.markdown +0 -43
  115. data/site/_posts/2013-11-26-jekyll-1-3-1-released.markdown +0 -21
  116. data/site/_posts/2013-12-07-jekyll-1-4-0-released.markdown +0 -30
  117. data/site/_posts/2013-12-09-jekyll-1-4-1-released.markdown +0 -20
  118. data/site/_posts/2013-12-16-jekyll-1-4-2-released.markdown +0 -18
  119. data/site/_posts/2014-01-13-jekyll-1-4-3-released.markdown +0 -26
  120. data/site/_posts/2014-03-24-jekyll-1-5-0-released.markdown +0 -19
  121. data/site/_posts/2014-03-27-jekyll-1-5-1-released.markdown +0 -26
  122. data/site/_posts/2014-05-06-jekyll-turns-2-0-0.markdown +0 -31
  123. data/site/_posts/2014-05-08-jekyll-2-0-3-released.markdown +0 -18
  124. data/site/_posts/2014-06-04-jekyll-stickers-1-dollar-stickermule.markdown +0 -19
  125. data/site/_posts/2014-06-28-jekyll-turns-21-i-mean-2-1-0.markdown +0 -31
  126. data/site/_posts/2014-07-01-jekyll-2-1-1-released.markdown +0 -30
  127. data/site/_posts/2014-07-29-jekyll-2-2-0-released.markdown +0 -19
  128. data/site/css/screen.css +0 -31
  129. data/site/docs/assets.md +0 -66
  130. data/site/docs/collections.md +0 -259
  131. data/site/docs/configuration.md +0 -536
  132. data/site/docs/continuous-integration.md +0 -177
  133. data/site/docs/contributing.md +0 -133
  134. data/site/docs/datafiles.md +0 -108
  135. data/site/docs/deployment-methods.md +0 -127
  136. data/site/docs/drafts.md +0 -21
  137. data/site/docs/extras.md +0 -18
  138. data/site/docs/frontmatter.md +0 -191
  139. data/site/docs/github-pages.md +0 -91
  140. data/site/docs/history.md +0 -1514
  141. data/site/docs/index.md +0 -58
  142. data/site/docs/installation.md +0 -106
  143. data/site/docs/migrations.md +0 -11
  144. data/site/docs/pages.md +0 -86
  145. data/site/docs/pagination.md +0 -212
  146. data/site/docs/permalinks.md +0 -188
  147. data/site/docs/plugins.md +0 -561
  148. data/site/docs/posts.md +0 -211
  149. data/site/docs/quickstart.md +0 -26
  150. data/site/docs/resources.md +0 -43
  151. data/site/docs/sites.md +0 -29
  152. data/site/docs/structure.md +0 -190
  153. data/site/docs/templates.md +0 -376
  154. data/site/docs/troubleshooting.md +0 -147
  155. data/site/docs/upgrading.md +0 -146
  156. data/site/docs/usage.md +0 -74
  157. data/site/docs/variables.md +0 -382
  158. data/site/docs/windows.md +0 -44
  159. data/site/favicon.ico +0 -0
  160. data/site/feed.xml +0 -48
  161. data/site/fonts/FontAwesome.otf +0 -0
  162. data/site/fonts/fontawesome-webfont.eot +0 -0
  163. data/site/fonts/fontawesome-webfont.svg +0 -504
  164. data/site/fonts/fontawesome-webfont.ttf +0 -0
  165. data/site/fonts/fontawesome-webfont.woff +0 -0
  166. data/site/freenode.txt +0 -1
  167. data/site/img/article-footer.png +0 -0
  168. data/site/img/footer-arrow.png +0 -0
  169. data/site/img/footer-logo.png +0 -0
  170. data/site/img/jekyll-sticker.jpg +0 -0
  171. data/site/img/logo-2x.png +0 -0
  172. data/site/img/logo-rss.png +0 -0
  173. data/site/img/octojekyll.png +0 -0
  174. data/site/index.html +0 -90
  175. data/site/js/html5shiv.min.js +0 -4
  176. data/site/js/respond.min.js +0 -5
  177. data/site/news/index.html +0 -10
  178. data/site/news/releases/index.html +0 -10
  179. data/test/fixtures/broken_front_matter1.erb +0 -5
  180. data/test/fixtures/broken_front_matter2.erb +0 -4
  181. data/test/fixtures/broken_front_matter3.erb +0 -7
  182. data/test/fixtures/exploit_front_matter.erb +0 -4
  183. data/test/fixtures/front_matter.erb +0 -4
  184. data/test/helper.rb +0 -80
  185. data/test/source/+/%# +.md +0 -6
  186. data/test/source/+/foo.md +0 -7
  187. data/test/source/.htaccess +0 -8
  188. data/test/source/_config.dev.toml +0 -2
  189. data/test/source/_data/categories/dairy.yaml +0 -6
  190. data/test/source/_data/languages.yml +0 -2
  191. data/test/source/_data/members.json +0 -12
  192. data/test/source/_data/members.yaml +0 -7
  193. data/test/source/_data/products.yml +0 -4
  194. data/test/source/_drafts/draft-properties.text +0 -11
  195. data/test/source/_includes/include.html +0 -1
  196. data/test/source/_includes/params.html +0 -7
  197. data/test/source/_includes/sig.markdown +0 -3
  198. data/test/source/_layouts/default.html +0 -27
  199. data/test/source/_layouts/post/simple.html +0 -1
  200. data/test/source/_layouts/simple.html +0 -1
  201. data/test/source/_methods/_do_not_read_me.md +0 -5
  202. data/test/source/_methods/configuration.md +0 -8
  203. data/test/source/_methods/sanitized_path.md +0 -5
  204. data/test/source/_methods/site/_dont_include_me_either.md +0 -5
  205. data/test/source/_methods/site/generate.md +0 -6
  206. data/test/source/_methods/site/initialize.md +0 -4
  207. data/test/source/_methods/um_hi.md +0 -6
  208. data/test/source/_plugins/dummy.rb +0 -8
  209. data/test/source/_posts/2008-02-02-not-published.textile +0 -8
  210. data/test/source/_posts/2008-02-02-published.textile +0 -8
  211. data/test/source/_posts/2008-10-18-foo-bar.textile +0 -8
  212. data/test/source/_posts/2008-11-21-complex.textile +0 -8
  213. data/test/source/_posts/2008-12-03-permalinked-post.textile +0 -9
  214. data/test/source/_posts/2008-12-13-include.markdown +0 -8
  215. data/test/source/_posts/2009-01-27-array-categories.textile +0 -10
  216. data/test/source/_posts/2009-01-27-categories.textile +0 -7
  217. data/test/source/_posts/2009-01-27-category.textile +0 -7
  218. data/test/source/_posts/2009-01-27-empty-categories.textile +0 -7
  219. data/test/source/_posts/2009-01-27-empty-category.textile +0 -7
  220. data/test/source/_posts/2009-01-27-no-category.textile +0 -6
  221. data/test/source/_posts/2009-03-12-hash-#1.markdown +0 -6
  222. data/test/source/_posts/2009-05-18-empty-tag.textile +0 -6
  223. data/test/source/_posts/2009-05-18-empty-tags.textile +0 -6
  224. data/test/source/_posts/2009-05-18-tag.textile +0 -6
  225. data/test/source/_posts/2009-05-18-tags.textile +0 -9
  226. data/test/source/_posts/2009-06-22-empty-yaml.textile +0 -3
  227. data/test/source/_posts/2009-06-22-no-yaml.textile +0 -1
  228. data/test/source/_posts/2010-01-08-triple-dash.markdown +0 -5
  229. data/test/source/_posts/2010-01-09-date-override.textile +0 -7
  230. data/test/source/_posts/2010-01-09-time-override.textile +0 -7
  231. data/test/source/_posts/2010-01-09-timezone-override.textile +0 -7
  232. data/test/source/_posts/2010-01-16-override-data.textile +0 -4
  233. data/test/source/_posts/2011-04-12-md-extension.md +0 -7
  234. data/test/source/_posts/2011-04-12-text-extension.text +0 -0
  235. data/test/source/_posts/2013-01-02-post-excerpt.markdown +0 -14
  236. data/test/source/_posts/2013-01-12-nil-layout.textile +0 -6
  237. data/test/source/_posts/2013-01-12-no-layout.textile +0 -5
  238. data/test/source/_posts/2013-03-19-not-a-post.markdown/.gitkeep +0 -0
  239. data/test/source/_posts/2013-04-11-custom-excerpt.markdown +0 -10
  240. data/test/source/_posts/2013-05-10-number-category.textile +0 -7
  241. data/test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown +0 -23
  242. data/test/source/_posts/2013-08-01-mkdn-extension.mkdn +0 -0
  243. data/test/source/_posts/2013-12-17-include-variable-filters.markdown +0 -21
  244. data/test/source/_posts/2013-12-20-properties.text +0 -11
  245. data/test/source/_posts/2014-01-06-permalink-traversal.md +0 -5
  246. data/test/source/_posts/2014-03-03-yaml-with-dots.md +0 -5
  247. data/test/source/_posts/2014-03-22-escape-+ %20[].markdown +0 -6
  248. data/test/source/_posts/es/2008-11-21-nested.textile +0 -8
  249. data/test/source/_sass/_grid.scss +0 -1
  250. data/test/source/_slides/example-slide-1.html +0 -4
  251. data/test/source/_slides/example-slide-2.html +0 -7
  252. data/test/source/_slides/example-slide-3.html +0 -5
  253. data/test/source/_with.dots/all.dots/2.4.0.md +0 -5
  254. data/test/source/_with.dots/file.with.dots.md +0 -0
  255. data/test/source/about.html +0 -6
  256. data/test/source/category/_posts/2008-9-23-categories.textile +0 -6
  257. data/test/source/contacts.html +0 -5
  258. data/test/source/contacts/bar.html +0 -5
  259. data/test/source/contacts/index.html +0 -5
  260. data/test/source/css/main.scss +0 -4
  261. data/test/source/css/screen.css +0 -76
  262. data/test/source/deal.with.dots.html +0 -7
  263. data/test/source/environment.html +0 -5
  264. data/test/source/exploit.md +0 -5
  265. data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +0 -8
  266. data/test/source/index.html +0 -22
  267. data/test/source/js/coffeescript.coffee +0 -10
  268. data/test/source/pgp.key +0 -2
  269. data/test/source/products.yml +0 -4
  270. data/test/source/properties.html +0 -8
  271. data/test/source/sitemap.xml +0 -32
  272. data/test/source/static_files.html +0 -4
  273. data/test/source/symlink-test/symlinked-file +0 -22
  274. data/test/source/unpublished.html +0 -7
  275. data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +0 -7
  276. data/test/source/z_category/_posts/2008-9-23-categories.textile +0 -6
  277. data/test/suite.rb +0 -11
  278. data/test/test_cleaner.rb +0 -77
  279. data/test/test_coffeescript.rb +0 -49
  280. data/test/test_collections.rb +0 -224
  281. data/test/test_command.rb +0 -53
  282. data/test/test_configuration.rb +0 -201
  283. data/test/test_convertible.rb +0 -49
  284. data/test/test_document.rb +0 -193
  285. data/test/test_draft.rb +0 -56
  286. data/test/test_entry_filter.rb +0 -124
  287. data/test/test_excerpt.rb +0 -131
  288. data/test/test_filters.rb +0 -207
  289. data/test/test_generated_site.rb +0 -97
  290. data/test/test_kramdown.rb +0 -62
  291. data/test/test_layout_reader.rb +0 -34
  292. data/test/test_liquid_extensions.rb +0 -31
  293. data/test/test_log_adapter.rb +0 -59
  294. data/test/test_new_command.rb +0 -104
  295. data/test/test_page.rb +0 -254
  296. data/test/test_path_sanitization.rb +0 -18
  297. data/test/test_post.rb +0 -741
  298. data/test/test_rdiscount.rb +0 -22
  299. data/test/test_redcarpet.rb +0 -77
  300. data/test/test_redcloth.rb +0 -86
  301. data/test/test_related_posts.rb +0 -47
  302. data/test/test_sass.rb +0 -26
  303. data/test/test_site.rb +0 -452
  304. data/test/test_tags.rb +0 -509
  305. data/test/test_url.rb +0 -28
  306. data/test/test_utils.rb +0 -67
@@ -1,97 +0,0 @@
1
- require 'helper'
2
-
3
- class TestGeneratedSite < Test::Unit::TestCase
4
- context "generated sites" do
5
- setup do
6
- clear_dest
7
- stub(Jekyll).configuration do
8
- Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
9
- end
10
-
11
- @site = Site.new(Jekyll.configuration)
12
- @site.process
13
- @index = File.read(dest_dir('index.html'))
14
- end
15
-
16
- should "ensure post count is as expected" do
17
- assert_equal 42, @site.posts.size
18
- end
19
-
20
- should "insert site.posts into the index" do
21
- assert @index.include?("#{@site.posts.size} Posts")
22
- end
23
-
24
- should "render latest post's content" do
25
- assert @index.include?(@site.posts.last.content)
26
- end
27
-
28
- should "hide unpublished posts" do
29
- published = Dir[dest_dir('publish_test/2008/02/02/*.html')].map {|f| File.basename(f)}
30
-
31
- assert_equal 1, published.size
32
- assert_equal "published.html", published.first
33
- end
34
-
35
- should "hide unpublished page" do
36
- assert !File.exist?(dest_dir('/unpublished.html'))
37
- end
38
-
39
- should "not copy _posts directory" do
40
- assert !File.exist?(dest_dir('_posts'))
41
- end
42
-
43
- should "process other static files and generate correct permalinks" do
44
- assert File.exist?(dest_dir('/about/index.html'))
45
- assert File.exist?(dest_dir('/contacts.html'))
46
- end
47
-
48
- should "print a nice list of static files" do
49
- expected_output = Regexp.new <<-OUTPUT
50
- - /css/screen.css last edited at \\d+ with extname .css
51
- - /pgp.key last edited at \\d+ with extname .key
52
- - /products.yml last edited at \\d+ with extname .yml
53
- - /symlink-test/symlinked-dir/screen.css last edited at \\d+ with extname .css
54
- OUTPUT
55
- assert_match expected_output, File.read(dest_dir('static_files.html'))
56
- end
57
- end
58
-
59
- context "generating limited posts" do
60
- setup do
61
- clear_dest
62
- stub(Jekyll).configuration do
63
- Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 5})
64
- end
65
-
66
- @site = Site.new(Jekyll.configuration)
67
- @site.process
68
- @index = File.read(dest_dir('index.html'))
69
- end
70
-
71
- should "generate only the specified number of posts" do
72
- assert_equal 5, @site.posts.size
73
- end
74
-
75
- should "ensure limit posts is 0 or more" do
76
- assert_raise ArgumentError do
77
- clear_dest
78
- stub(Jekyll).configuration do
79
- Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => -1})
80
- end
81
-
82
- @site = Site.new(Jekyll.configuration)
83
- end
84
- end
85
-
86
- should "acceptable limit post is 0" do
87
- assert_nothing_raised ArgumentError do
88
- clear_dest
89
- stub(Jekyll).configuration do
90
- Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir, 'limit_posts' => 0})
91
- end
92
-
93
- @site = Site.new(Jekyll.configuration)
94
- end
95
- end
96
- end
97
- end
@@ -1,62 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require 'helper'
4
-
5
- class TestKramdown < Test::Unit::TestCase
6
- context "kramdown" do
7
- setup do
8
- @config = {
9
- 'markdown' => 'kramdown',
10
- 'kramdown' => {
11
- 'auto_ids' => false,
12
- 'footnote_nr' => 1,
13
- 'entity_output' => 'as_char',
14
- 'toc_levels' => '1..6',
15
- 'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
16
-
17
- 'use_coderay' => true,
18
- 'coderay_bold_every'=> 12,
19
- 'coderay' => {
20
- 'coderay_css' => :style,
21
- 'coderay_bold_every' => 8
22
- }
23
- }
24
- }
25
- @config = Jekyll.configuration(@config)
26
- @markdown = Converters::Markdown.new(@config)
27
- end
28
-
29
- # http://kramdown.gettalong.org/converter/html.html#options
30
- should "pass kramdown options" do
31
- assert_equal "<h1>Some Header</h1>", @markdown.convert('# Some Header #').strip
32
- end
33
-
34
- should "convert quotes to smart quotes" do
35
- assert_match /<p>(&#8220;|“)Pit(&#8217;|’)hy(&#8221;|”)<\/p>/, @markdown.convert(%{"Pit'hy"}).strip
36
-
37
- override = { 'kramdown' => { 'smart_quotes' => 'lsaquo,rsaquo,laquo,raquo' } }
38
- markdown = Converters::Markdown.new(Utils.deep_merge_hashes(@config, override))
39
- assert_match /<p>(&#171;|«)Pit(&#8250;|›)hy(&#187;|»)<\/p>/, markdown.convert(%{"Pit'hy"}).strip
40
- end
41
-
42
- context "moving up nested coderay options" do
43
- setup do
44
- @markdown.convert('some markup')
45
- @converter_config = @markdown.instance_variable_get(:@config)['kramdown']
46
- end
47
-
48
- should "work correctly" do
49
- assert_equal :style, @converter_config['coderay_css']
50
- end
51
-
52
- should "also work for defaults" do
53
- default = Jekyll::Configuration::DEFAULTS['kramdown']['coderay']['coderay_tab_width']
54
- assert_equal default, @converter_config['coderay_tab_width']
55
- end
56
-
57
- should "not overwrite" do
58
- assert_equal 12, @converter_config['coderay_bold_every']
59
- end
60
- end
61
- end
62
- end
@@ -1,34 +0,0 @@
1
- require 'helper'
2
-
3
- class TestLayoutReader < Test::Unit::TestCase
4
- context "reading layouts" do
5
- setup do
6
- stub(Jekyll).configuration do
7
- Jekyll::Configuration::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
8
- end
9
- @site = Site.new(Jekyll.configuration)
10
- end
11
-
12
- should "read layouts" do
13
- layouts = LayoutReader.new(@site).read
14
- assert_equal ["default", "simple", "post/simple"].sort, layouts.keys.sort
15
- end
16
-
17
- context "when no _layouts directory exists in CWD" do
18
- should "know to use the layout directory relative to the site source" do
19
- assert_equal LayoutReader.new(@site).layout_directory, source_dir("_layouts")
20
- end
21
- end
22
-
23
- context "when a _layouts directory exists in CWD" do
24
- setup do
25
- stub(File).directory? { true }
26
- stub(Dir).pwd { source_dir("blah") }
27
- end
28
-
29
- should "know to use the layout directory relative to CWD" do
30
- assert_equal LayoutReader.new(@site).layout_directory, source_dir("blah/_layouts")
31
- end
32
- end
33
- end
34
- end
@@ -1,31 +0,0 @@
1
- require 'helper'
2
-
3
- class TestLiquidExtensions < Test::Unit::TestCase
4
-
5
- context "looking up a variable in a Liquid context" do
6
- class SayHi < Liquid::Tag
7
- include Jekyll::LiquidExtensions
8
-
9
- def initialize(tag_name, markup, tokens)
10
- @markup = markup.strip
11
- end
12
-
13
- def render(context)
14
- "hi #{lookup_variable(context, @markup)}"
15
- end
16
- end
17
- Liquid::Template.register_tag('say_hi', SayHi)
18
- setup do
19
- @template = Liquid::Template.parse("{% say_hi page.name %}") # Parses and compiles the template
20
- end
21
-
22
- should "extract the var properly" do
23
- assert_equal @template.render({'page' => {'name' => 'tobi'}}), 'hi tobi'
24
- end
25
-
26
- should "return the variable name if the value isn't there" do
27
- assert_equal @template.render({'page' => {'title' => 'tobi'}}), 'hi page.name'
28
- end
29
- end
30
-
31
- end
@@ -1,59 +0,0 @@
1
- require 'helper'
2
-
3
- class TestLogAdapter < Test::Unit::TestCase
4
- class LoggerDouble
5
- attr_accessor :level
6
- end
7
-
8
- context "#log_level=" do
9
- should "set the writers logging level" do
10
- subject = Jekyll::LogAdapter.new(LoggerDouble.new)
11
- subject.log_level = :error
12
- assert_equal Jekyll::LogAdapter::LOG_LEVELS[:error], subject.writer.level
13
- end
14
- end
15
-
16
- context "#debug" do
17
- should "call #debug on writer return true" do
18
- writer = LoggerDouble.new
19
- logger = Jekyll::LogAdapter.new(writer)
20
- stub(writer).debug('topic '.rjust(20) + 'log message') { true }
21
- assert logger.debug('topic', 'log message')
22
- end
23
- end
24
-
25
- context "#info" do
26
- should "call #info on writer return true" do
27
- writer = LoggerDouble.new
28
- logger = Jekyll::LogAdapter.new(writer)
29
- stub(writer).info('topic '.rjust(20) + 'log message') { true }
30
- assert logger.info('topic', 'log message')
31
- end
32
- end
33
-
34
- context "#warn" do
35
- should "call #warn on writer return true" do
36
- writer = LoggerDouble.new
37
- logger = Jekyll::LogAdapter.new(writer)
38
- stub(writer).warn('topic '.rjust(20) + 'log message') { true }
39
- assert logger.warn('topic', 'log message')
40
- end
41
- end
42
-
43
- context "#error" do
44
- should "call #error on writer return true" do
45
- writer = LoggerDouble.new
46
- logger = Jekyll::LogAdapter.new(writer)
47
- stub(writer).error('topic '.rjust(20) + 'log message') { true }
48
- assert logger.error('topic', 'log message')
49
- end
50
- end
51
-
52
- context "#abort_with" do
53
- should "call #error and abort" do
54
- logger = Jekyll::LogAdapter.new(LoggerDouble.new)
55
- stub(logger).error('topic', 'log message') { true }
56
- assert_raise(SystemExit) { logger.abort_with('topic', 'log message') }
57
- end
58
- end
59
- end
@@ -1,104 +0,0 @@
1
- require 'helper'
2
- require 'jekyll/commands/new'
3
-
4
- class TestNewCommand < Test::Unit::TestCase
5
- def dir_contents(path)
6
- Dir["#{path}/**/*"].each do |file|
7
- file.gsub! path, ''
8
- end
9
- end
10
-
11
- def site_template
12
- File.expand_path("../lib/site_template", File.dirname(__FILE__))
13
- end
14
-
15
- context 'when args contains a path' do
16
- setup do
17
- @path = 'new-site'
18
- @args = [@path]
19
- @full_path = File.expand_path(@path, Dir.pwd)
20
- end
21
-
22
- teardown do
23
- FileUtils.rm_r @full_path
24
- end
25
-
26
- should 'create a new directory' do
27
- assert !File.exist?(@full_path)
28
- capture_stdout { Jekyll::Commands::New.process(@args) }
29
- assert File.exist?(@full_path)
30
- end
31
-
32
- should 'display a success message' do
33
- output = capture_stdout { Jekyll::Commands::New.process(@args) }
34
- success_message = "New jekyll site installed in #{@full_path}. \n"
35
- assert_equal success_message, output
36
- end
37
-
38
- should 'copy the static files in site template to the new directory' do
39
- static_template_files = dir_contents(site_template).reject do |f|
40
- File.extname(f) == '.erb'
41
- end
42
-
43
- capture_stdout { Jekyll::Commands::New.process(@args) }
44
-
45
- new_site_files = dir_contents(@full_path).reject do |f|
46
- File.extname(f) == '.markdown'
47
- end
48
-
49
- assert_same_elements static_template_files, new_site_files
50
- end
51
-
52
- should 'process any ERB files' do
53
- erb_template_files = dir_contents(site_template).select do |f|
54
- File.extname(f) == '.erb'
55
- end
56
-
57
- stubbed_date = '2013-01-01'
58
- stub.instance_of(Time).strftime { stubbed_date }
59
-
60
- erb_template_files.each do |f|
61
- f.chomp! '.erb'
62
- f.gsub! '0000-00-00', stubbed_date
63
- end
64
-
65
- capture_stdout { Jekyll::Commands::New.process(@args) }
66
-
67
- new_site_files = dir_contents(@full_path).select do |f|
68
- erb_template_files.include? f
69
- end
70
-
71
- assert_same_elements erb_template_files, new_site_files
72
- end
73
- end
74
-
75
- context 'when multiple args are given' do
76
- setup do
77
- @site_name_with_spaces = 'new site name'
78
- @multiple_args = @site_name_with_spaces.split
79
- end
80
-
81
- teardown do
82
- FileUtils.rm_r File.expand_path(@site_name_with_spaces, Dir.pwd)
83
- end
84
-
85
- should 'create a new directory' do
86
- assert !File.exist?(@site_name_with_spaces)
87
- capture_stdout { Jekyll::Commands::New.process(@multiple_args) }
88
- assert File.exist?(@site_name_with_spaces)
89
- end
90
- end
91
-
92
- context 'when no args are given' do
93
- setup do
94
- @empty_args = []
95
- end
96
-
97
- should 'raise an ArgumentError' do
98
- exception = assert_raise ArgumentError do
99
- Jekyll::Commands::New.process(@empty_args)
100
- end
101
- assert_equal 'You must specify a path.', exception.message
102
- end
103
- end
104
- end
@@ -1,254 +0,0 @@
1
- require 'helper'
2
-
3
- class TestPage < Test::Unit::TestCase
4
- def setup_page(*args)
5
- dir, file = args
6
- dir, file = ['', dir] if file.nil?
7
- @page = Page.new(@site, source_dir, dir, file)
8
- end
9
-
10
- def do_render(page)
11
- layouts = { "default" => Layout.new(@site, source_dir('_layouts'), "simple.html")}
12
- page.render(layouts, {"site" => {"posts" => []}})
13
- end
14
-
15
- context "A Page" do
16
- setup do
17
- clear_dest
18
- stub(Jekyll).configuration { Jekyll::Configuration::DEFAULTS }
19
- @site = Site.new(Jekyll.configuration)
20
- end
21
-
22
- context "processing pages" do
23
- should "create url based on filename" do
24
- @page = setup_page('contacts.html')
25
- assert_equal "/contacts.html", @page.url
26
- end
27
-
28
- should "not published when published yaml is false" do
29
- @page = setup_page("unpublished.html")
30
- assert_equal false, @page.published?
31
- end
32
-
33
- should "create url with non-alphabetic characters" do
34
- @page = setup_page('+', '%# +.md')
35
- assert_equal "/+/%25%23%20+.html", @page.url
36
- end
37
-
38
- context "in a directory hierarchy" do
39
- should "create url based on filename" do
40
- @page = setup_page('/contacts', 'bar.html')
41
- assert_equal "/contacts/bar.html", @page.url
42
- end
43
-
44
- should "create index url based on filename" do
45
- @page = setup_page('/contacts', 'index.html')
46
- assert_equal "/contacts/index.html", @page.url
47
- end
48
- end
49
-
50
- should "deal properly with extensions" do
51
- @page = setup_page('deal.with.dots.html')
52
- assert_equal ".html", @page.ext
53
- end
54
-
55
- should "deal properly with dots" do
56
- @page = setup_page('deal.with.dots.html')
57
- assert_equal "deal.with.dots", @page.basename
58
- end
59
-
60
- should "make properties accessible through #[]" do
61
- page = setup_page('properties.html')
62
- attrs = {
63
- content: "All the properties.\n",
64
- dir: "/properties/",
65
- excerpt: nil,
66
- foo: 'bar',
67
- layout: 'default',
68
- name: "properties.html",
69
- path: "properties.html",
70
- permalink: '/properties/',
71
- published: nil,
72
- title: 'Properties Page',
73
- url: "/properties/"
74
- }
75
-
76
- attrs.each do |attr, val|
77
- attr_str = attr.to_s
78
- result = page[attr_str]
79
- assert_equal val, result, "For <page[\"#{attr_str}\"]>:"
80
- end
81
- end
82
-
83
- context "with pretty url style" do
84
- setup do
85
- @site.permalink_style = :pretty
86
- end
87
-
88
- should "return dir correctly" do
89
- @page = setup_page('contacts.html')
90
- assert_equal '/contacts/', @page.dir
91
- end
92
-
93
- should "return dir correctly for index page" do
94
- @page = setup_page('index.html')
95
- assert_equal '/', @page.dir
96
- end
97
-
98
- context "in a directory hierarchy" do
99
- should "create url based on filename" do
100
- @page = setup_page('/contacts', 'bar.html')
101
- assert_equal "/contacts/bar/", @page.url
102
- end
103
-
104
- should "create index url based on filename" do
105
- @page = setup_page('/contacts', 'index.html')
106
- assert_equal "/contacts/", @page.url
107
- end
108
-
109
- should "return dir correctly" do
110
- @page = setup_page('/contacts', 'bar.html')
111
- assert_equal '/contacts/bar/', @page.dir
112
- end
113
-
114
- should "return dir correctly for index page" do
115
- @page = setup_page('/contacts', 'index.html')
116
- assert_equal '/contacts/', @page.dir
117
- end
118
- end
119
- end
120
-
121
- context "with any other url style" do
122
- should "return dir correctly" do
123
- @site.permalink_style = nil
124
- @page = setup_page('contacts.html')
125
- assert_equal '/', @page.dir
126
- end
127
- end
128
-
129
- should "respect permalink in yaml front matter" do
130
- file = "about.html"
131
- @page = setup_page(file)
132
-
133
- assert_equal "/about/", @page.permalink
134
- assert_equal @page.permalink, @page.url
135
- assert_equal "/about/", @page.dir
136
- end
137
-
138
- should "not be writable outside of destination" do
139
- unexpected = File.expand_path("../../../baddie.html", dest_dir)
140
- File.delete unexpected if File.exist?(unexpected)
141
- page = setup_page("exploit.md")
142
- do_render(page)
143
- page.write(dest_dir)
144
-
145
- assert !File.exist?(unexpected)
146
- end
147
- end
148
-
149
- context "with specified layout of nil" do
150
- setup do
151
- @page = setup_page('sitemap.xml')
152
- end
153
-
154
- should "layout of nil is respected" do
155
- assert_equal "nil", @page.data["layout"]
156
- end
157
- end
158
-
159
- context "rendering" do
160
- setup do
161
- clear_dest
162
- end
163
-
164
- should "write properly" do
165
- page = setup_page('contacts.html')
166
- do_render(page)
167
- page.write(dest_dir)
168
-
169
- assert File.directory?(dest_dir)
170
- assert File.exist?(File.join(dest_dir, 'contacts.html'))
171
- end
172
-
173
- should "write even when the folder name is plus and permalink has +" do
174
- page = setup_page('+', 'foo.md')
175
- do_render(page)
176
- page.write(dest_dir)
177
-
178
- assert File.directory?(dest_dir)
179
- assert File.exist?(File.join(dest_dir, '+', 'plus+in+url'))
180
- end
181
-
182
- should "write even when permalink has '%# +'" do
183
- page = setup_page('+', '%# +.md')
184
- do_render(page)
185
- page.write(dest_dir)
186
-
187
- assert File.directory?(dest_dir)
188
- assert File.exist?(File.join(dest_dir, '+', '%# +.html'))
189
- end
190
-
191
- should "write properly without html extension" do
192
- page = setup_page('contacts.html')
193
- page.site.permalink_style = :pretty
194
- do_render(page)
195
- page.write(dest_dir)
196
-
197
- assert File.directory?(dest_dir)
198
- assert File.exist?(File.join(dest_dir, 'contacts', 'index.html'))
199
- end
200
-
201
- should "write properly with extension different from html" do
202
- page = setup_page("sitemap.xml")
203
- page.site.permalink_style = :pretty
204
- do_render(page)
205
- page.write(dest_dir)
206
-
207
- assert_equal("/sitemap.xml", page.url)
208
- assert_nil(page.url[/\.html$/])
209
- assert File.directory?(dest_dir)
210
- assert File.exist?(File.join(dest_dir,'sitemap.xml'))
211
- end
212
-
213
- should "write dotfiles properly" do
214
- page = setup_page('.htaccess')
215
- do_render(page)
216
- page.write(dest_dir)
217
-
218
- assert File.directory?(dest_dir)
219
- assert File.exist?(File.join(dest_dir, '.htaccess'))
220
- end
221
-
222
- context "in a directory hierarchy" do
223
- should "write properly the index" do
224
- page = setup_page('/contacts', 'index.html')
225
- do_render(page)
226
- page.write(dest_dir)
227
-
228
- assert File.directory?(dest_dir)
229
- assert File.exist?(File.join(dest_dir, 'contacts', 'index.html'))
230
- end
231
-
232
- should "write properly" do
233
- page = setup_page('/contacts', 'bar.html')
234
- do_render(page)
235
- page.write(dest_dir)
236
-
237
- assert File.directory?(dest_dir)
238
- assert File.exist?(File.join(dest_dir, 'contacts', 'bar.html'))
239
- end
240
-
241
- should "write properly without html extension" do
242
- page = setup_page('/contacts', 'bar.html')
243
- page.site.permalink_style = :pretty
244
- do_render(page)
245
- page.write(dest_dir)
246
-
247
- assert File.directory?(dest_dir)
248
- assert File.exist?(File.join(dest_dir, 'contacts', 'bar', 'index.html'))
249
- end
250
- end
251
- end
252
-
253
- end
254
- end