spinto-jekyll 0.11.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/Gemfile +2 -0
  2. data/History.txt +321 -0
  3. data/LICENSE +21 -0
  4. data/README.textile +41 -0
  5. data/Rakefile +166 -0
  6. data/bin/jekyll +289 -0
  7. data/cucumber.yml +1 -0
  8. data/features/create_sites.feature +112 -0
  9. data/features/embed_filters.feature +60 -0
  10. data/features/markdown.feature +30 -0
  11. data/features/pagination.feature +27 -0
  12. data/features/permalinks.feature +65 -0
  13. data/features/post_data.feature +153 -0
  14. data/features/site_configuration.feature +145 -0
  15. data/features/site_data.feature +82 -0
  16. data/features/step_definitions/jekyll_steps.rb +145 -0
  17. data/features/support/env.rb +19 -0
  18. data/lib/jekyll.rb +136 -0
  19. data/lib/jekyll/converter.rb +50 -0
  20. data/lib/jekyll/converters/identity.rb +22 -0
  21. data/lib/jekyll/converters/markdown.rb +125 -0
  22. data/lib/jekyll/converters/textile.rb +50 -0
  23. data/lib/jekyll/convertible.rb +112 -0
  24. data/lib/jekyll/core_ext.rb +52 -0
  25. data/lib/jekyll/errors.rb +6 -0
  26. data/lib/jekyll/filters.rb +118 -0
  27. data/lib/jekyll/generator.rb +7 -0
  28. data/lib/jekyll/generators/pagination.rb +113 -0
  29. data/lib/jekyll/layout.rb +44 -0
  30. data/lib/jekyll/migrators/csv.rb +26 -0
  31. data/lib/jekyll/migrators/drupal.rb +103 -0
  32. data/lib/jekyll/migrators/enki.rb +49 -0
  33. data/lib/jekyll/migrators/joomla.rb +53 -0
  34. data/lib/jekyll/migrators/marley.rb +52 -0
  35. data/lib/jekyll/migrators/mephisto.rb +84 -0
  36. data/lib/jekyll/migrators/mt.rb +86 -0
  37. data/lib/jekyll/migrators/posterous.rb +67 -0
  38. data/lib/jekyll/migrators/rss.rb +47 -0
  39. data/lib/jekyll/migrators/textpattern.rb +58 -0
  40. data/lib/jekyll/migrators/tumblr.rb +195 -0
  41. data/lib/jekyll/migrators/typo.rb +51 -0
  42. data/lib/jekyll/migrators/wordpress.rb +294 -0
  43. data/lib/jekyll/migrators/wordpressdotcom.rb +70 -0
  44. data/lib/jekyll/page.rb +155 -0
  45. data/lib/jekyll/plugin.rb +77 -0
  46. data/lib/jekyll/post.rb +257 -0
  47. data/lib/jekyll/site.rb +337 -0
  48. data/lib/jekyll/static_file.rb +72 -0
  49. data/lib/jekyll/tags/highlight.rb +76 -0
  50. data/lib/jekyll/tags/include.rb +37 -0
  51. data/lib/jekyll/tags/post_url.rb +38 -0
  52. data/lib/spinto-jekyll.rb +3 -0
  53. data/spinto-jekyll.gemspec +155 -0
  54. data/test/helper.rb +34 -0
  55. data/test/source/.htaccess +8 -0
  56. data/test/source/_includes/sig.markdown +3 -0
  57. data/test/source/_layouts/default.html +27 -0
  58. data/test/source/_layouts/simple.html +1 -0
  59. data/test/source/_posts/2008-02-02-not-published.textile +8 -0
  60. data/test/source/_posts/2008-02-02-published.textile +8 -0
  61. data/test/source/_posts/2008-10-18-foo-bar.textile +8 -0
  62. data/test/source/_posts/2008-11-21-complex.textile +8 -0
  63. data/test/source/_posts/2008-12-03-permalinked-post.textile +9 -0
  64. data/test/source/_posts/2008-12-13-include.markdown +8 -0
  65. data/test/source/_posts/2009-01-27-array-categories.textile +10 -0
  66. data/test/source/_posts/2009-01-27-categories.textile +7 -0
  67. data/test/source/_posts/2009-01-27-category.textile +7 -0
  68. data/test/source/_posts/2009-01-27-empty-categories.textile +7 -0
  69. data/test/source/_posts/2009-01-27-empty-category.textile +7 -0
  70. data/test/source/_posts/2009-03-12-hash-#1.markdown +6 -0
  71. data/test/source/_posts/2009-05-18-empty-tag.textile +6 -0
  72. data/test/source/_posts/2009-05-18-empty-tags.textile +6 -0
  73. data/test/source/_posts/2009-05-18-tag.textile +6 -0
  74. data/test/source/_posts/2009-05-18-tags.textile +9 -0
  75. data/test/source/_posts/2009-06-22-empty-yaml.textile +3 -0
  76. data/test/source/_posts/2009-06-22-no-yaml.textile +1 -0
  77. data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
  78. data/test/source/_posts/2010-01-09-date-override.textile +7 -0
  79. data/test/source/_posts/2010-01-09-time-override.textile +7 -0
  80. data/test/source/_posts/2010-01-09-timezone-override.textile +7 -0
  81. data/test/source/_posts/2010-01-16-override-data.textile +4 -0
  82. data/test/source/_posts/2011-04-12-md-extension.md +7 -0
  83. data/test/source/_posts/2011-04-12-text-extension.text +0 -0
  84. data/test/source/about.html +6 -0
  85. data/test/source/category/_posts/2008-9-23-categories.textile +6 -0
  86. data/test/source/contacts.html +5 -0
  87. data/test/source/css/screen.css +76 -0
  88. data/test/source/deal.with.dots.html +7 -0
  89. data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +8 -0
  90. data/test/source/index.html +22 -0
  91. data/test/source/sitemap.xml +32 -0
  92. data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +7 -0
  93. data/test/source/z_category/_posts/2008-9-23-categories.textile +6 -0
  94. data/test/suite.rb +11 -0
  95. data/test/test_configuration.rb +29 -0
  96. data/test/test_core_ext.rb +66 -0
  97. data/test/test_filters.rb +62 -0
  98. data/test/test_generated_site.rb +72 -0
  99. data/test/test_kramdown.rb +23 -0
  100. data/test/test_page.rb +117 -0
  101. data/test/test_pager.rb +113 -0
  102. data/test/test_post.rb +456 -0
  103. data/test/test_rdiscount.rb +18 -0
  104. data/test/test_redcarpet.rb +21 -0
  105. data/test/test_redcloth.rb +86 -0
  106. data/test/test_site.rb +220 -0
  107. data/test/test_tags.rb +201 -0
  108. metadata +336 -0
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: Some Tags
3
+ tags:
4
+ ---
5
+
6
+ Awesome!
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: A Tag
3
+ tag: code
4
+ ---
5
+
6
+ Whoa.
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Some Tags
3
+ tags:
4
+ - food
5
+ - cooking
6
+ - pizza
7
+ ---
8
+
9
+ Awesome!
@@ -0,0 +1,3 @@
1
+ ---
2
+ ---
3
+ Empty YAML.
@@ -0,0 +1 @@
1
+ No YAML.
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Foo --- Bar
3
+ ---
4
+
5
+ Triple the fun!
@@ -0,0 +1,7 @@
1
+ ---
2
+ date: 2010-01-10
3
+ ---
4
+
5
+ Post with a front matter date
6
+
7
+ {{ page.date | date_to_string }}
@@ -0,0 +1,7 @@
1
+ ---
2
+ date: 2010-01-10 13:07:09
3
+ ---
4
+
5
+ Post with a front matter time
6
+
7
+ {{ page.date | date_to_string }}
@@ -0,0 +1,7 @@
1
+ ---
2
+ date: 2010-01-10 13:07:09 +00:00
3
+ ---
4
+
5
+ Post with a front matter time with timezone
6
+
7
+ {{ page.date | date_to_string }}
@@ -0,0 +1,4 @@
1
+ ---
2
+ date: 2010-01-10 13:07:09
3
+ tags: A string
4
+ ---
@@ -0,0 +1,7 @@
1
+ ---
2
+ date: 2011-04-12 13:07:09
3
+ ---
4
+
5
+ under default configuration, this post should get processed by the identity converter. By changing
6
+ textile extension or markdown extension configuration parameters, you should be able to associate
7
+ it with either of those converters
File without changes
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: About
3
+ permalink: /about/
4
+ ---
5
+
6
+ About the site
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: default
3
+ title: Categories
4
+ ---
5
+
6
+ Categories _should_ work
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Contact Information
3
+ ---
4
+
5
+ Contact Information
@@ -0,0 +1,76 @@
1
+ /*****************************************************************************/
2
+ /*
3
+ /* Common
4
+ /*
5
+ /*****************************************************************************/
6
+
7
+ /* Global Reset */
8
+
9
+ * {
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+
14
+ html, body {
15
+ height: 100%;
16
+ }
17
+
18
+ body {
19
+ background-color: white;
20
+ font: 13.34px helvetica, arial, clean, sans-serif;
21
+ *font-size: small;
22
+ text-align: center;
23
+ }
24
+
25
+ h1, h2, h3, h4, h5, h6 {
26
+ font-size: 100%;
27
+ }
28
+
29
+ h1 {
30
+ margin-bottom: 1em;
31
+ }
32
+
33
+ p {
34
+ margin: 1em 0;
35
+ }
36
+
37
+ a {
38
+ color: #00a;
39
+ }
40
+
41
+ a:hover {
42
+ color: black;
43
+ }
44
+
45
+ a:visited {
46
+ color: #a0a;
47
+ }
48
+
49
+ table {
50
+ font-size: inherit;
51
+ font: 100%;
52
+ }
53
+
54
+ /*****************************************************************************/
55
+ /*
56
+ /* Site
57
+ /*
58
+ /*****************************************************************************/
59
+
60
+ .site {
61
+ font-size: 110%;
62
+ text-align: justify;
63
+ width: 40em;
64
+ margin: 3em auto 2em auto;
65
+ line-height: 1.5em;
66
+ }
67
+
68
+ .title {
69
+ color: #a00;
70
+ font-weight: bold;
71
+ margin-bottom: 2em;
72
+ }
73
+
74
+ .site .meta {
75
+ color: #aaa;
76
+ }
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Deal with dots
3
+ permalink: /deal.with.dots/
4
+ ---
5
+
6
+ Let's test if jekyll deals properly with dots.
7
+
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: Topical Post
4
+ ---
5
+
6
+ h1. {{ page.title }}
7
+
8
+ This post has a topic.
@@ -0,0 +1,22 @@
1
+ ---
2
+ layout: default
3
+ title: Tom Preston-Werner
4
+ ---
5
+
6
+ h1. Welcome to my site
7
+
8
+ h2. Please read our {{ site.posts | size }} Posts
9
+
10
+ <ul>
11
+ {% for post in site.posts %}
12
+ <li>{{ post.date }} <a href="{{ post.url }}">{{ post.title }}</a></li>
13
+ {% endfor %}
14
+ </ul>
15
+
16
+ {% assign first_post = site.posts.first %}
17
+ <div id="first_post">
18
+ <h1>{{ first_post.title }}</h1>
19
+ <div>
20
+ {{ first_post.content }}
21
+ </div>
22
+ </div>
@@ -0,0 +1,32 @@
1
+ ---
2
+ layout: nil
3
+ ---
4
+ <?xml version="1.0" encoding="UTF-8"?>
5
+ <urlset
6
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
7
+
8
+ <url>
9
+ <loc>http://example.com</loc>
10
+ <lastmod>{{ site.time | date: "%Y-%m-%d" }}</lastmod>
11
+ <changefreq>daily</changefreq>
12
+ <priority>1.0</priority>
13
+ </url>
14
+
15
+ {% for post in site.posts %}
16
+ <url>
17
+ <loc>http://example.com{{ post.url }}/</loc>
18
+ <lastmod>{{ post.date | date: "%Y-%m-%d" }}</lastmod>
19
+ <changefreq>monthly</changefreq>
20
+ <priority>0.2</priority>
21
+ </url>
22
+ {% endfor %}
23
+
24
+ {% for page in site.html_pages %}
25
+ <url>
26
+ <loc>http://example.com{{ page.url }}</loc>
27
+ <lastmod>{{ site.time | date: "%Y-%m-%d" }}</lastmod>
28
+ {% if page.changefreq %}<changefreq>{{ page.changefreq }}</changefreq>{% endif %}
29
+ {% if page.priority %}<priority>{{ page.priority }}</priority>{% endif %}
30
+ </url>
31
+ {% endfor %}
32
+ </urlset>
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: post
3
+ title: "Test title"
4
+ tag: "Ruby"
5
+ ---
6
+
7
+ This is the content
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: default
3
+ title: Categories
4
+ ---
5
+
6
+ Categories _should_ work. Even if ordered after index.
data/test/suite.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ gem 'test-unit'
3
+ require 'test/unit'
4
+
5
+ # for some reason these tests fail when run via TextMate
6
+ # but succeed when run on the command line.
7
+
8
+ tests = Dir[File.expand_path("#{File.dirname(__FILE__)}/test_*.rb")]
9
+ tests.each do |file|
10
+ require file
11
+ end
@@ -0,0 +1,29 @@
1
+ require 'helper'
2
+
3
+ class TestConfiguration < Test::Unit::TestCase
4
+ context "loading configuration" do
5
+ setup do
6
+ @path = File.join(Dir.pwd, '_config.yml')
7
+ end
8
+
9
+ should "fire warning with no _config.yml" do
10
+ mock(YAML).load_file(@path) { raise "No such file or directory - #{@path}" }
11
+ mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
12
+ mock($stderr).puts("\tNo such file or directory - #{@path}")
13
+ assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
14
+ end
15
+
16
+ should "load configuration as hash" do
17
+ mock(YAML).load_file(@path) { Hash.new }
18
+ mock($stdout).puts("Configuration from #{@path}")
19
+ assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
20
+ end
21
+
22
+ should "fire warning with bad config" do
23
+ mock(YAML).load_file(@path) { Array.new }
24
+ mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
25
+ mock($stderr).puts("\tInvalid configuration - #{@path}")
26
+ assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,66 @@
1
+ require 'helper'
2
+
3
+ class TestCoreExt < Test::Unit::TestCase
4
+ context "hash" do
5
+
6
+ context "pluralized_array" do
7
+
8
+ should "return empty array with no values" do
9
+ data = {}
10
+ assert_equal [], data.pluralized_array('tag', 'tags')
11
+ end
12
+
13
+ should "return empty array with no matching values" do
14
+ data = { 'foo' => 'bar' }
15
+ assert_equal [], data.pluralized_array('tag', 'tags')
16
+ end
17
+
18
+ should "return empty array with matching nil singular" do
19
+ data = { 'foo' => 'bar', 'tag' => nil, 'tags' => ['dog', 'cat'] }
20
+ assert_equal [], data.pluralized_array('tag', 'tags')
21
+ end
22
+
23
+ should "return single value array with matching singular" do
24
+ data = { 'foo' => 'bar', 'tag' => 'dog', 'tags' => ['dog', 'cat'] }
25
+ assert_equal ['dog'], data.pluralized_array('tag', 'tags')
26
+ end
27
+
28
+ should "return single value array with matching singular with spaces" do
29
+ data = { 'foo' => 'bar', 'tag' => 'dog cat', 'tags' => ['dog', 'cat'] }
30
+ assert_equal ['dog cat'], data.pluralized_array('tag', 'tags')
31
+ end
32
+
33
+ should "return empty array with matching nil plural" do
34
+ data = { 'foo' => 'bar', 'tags' => nil }
35
+ assert_equal [], data.pluralized_array('tag', 'tags')
36
+ end
37
+
38
+ should "return empty array with matching empty array" do
39
+ data = { 'foo' => 'bar', 'tags' => [] }
40
+ assert_equal [], data.pluralized_array('tag', 'tags')
41
+ end
42
+
43
+ should "return single value array with matching plural with single string value" do
44
+ data = { 'foo' => 'bar', 'tags' => 'dog' }
45
+ assert_equal ['dog'], data.pluralized_array('tag', 'tags')
46
+ end
47
+
48
+ should "return multiple value array with matching plural with single string value with spaces" do
49
+ data = { 'foo' => 'bar', 'tags' => 'dog cat' }
50
+ assert_equal ['dog', 'cat'], data.pluralized_array('tag', 'tags')
51
+ end
52
+
53
+ should "return single value array with matching plural with single value array" do
54
+ data = { 'foo' => 'bar', 'tags' => ['dog'] }
55
+ assert_equal ['dog'], data.pluralized_array('tag', 'tags')
56
+ end
57
+
58
+ should "return multiple value array with matching plural with multiple value array" do
59
+ data = { 'foo' => 'bar', 'tags' => ['dog', 'cat'] }
60
+ assert_equal ['dog', 'cat'], data.pluralized_array('tag', 'tags')
61
+ end
62
+
63
+ end
64
+
65
+ end
66
+ end
@@ -0,0 +1,62 @@
1
+ require 'helper'
2
+
3
+ class TestFilters < Test::Unit::TestCase
4
+ class JekyllFilter
5
+ include Jekyll::Filters
6
+
7
+ def initialize
8
+ site = Jekyll::Site.new(Jekyll.configuration({}))
9
+ @context = Liquid::Context.new({}, {}, { :site => site })
10
+ end
11
+ end
12
+
13
+ context "filters" do
14
+ setup do
15
+ @filter = JekyllFilter.new
16
+ end
17
+
18
+ should "textilize with simple string" do
19
+ assert_equal "<p>something <strong>really</strong> simple</p>", @filter.textilize("something *really* simple")
20
+ end
21
+
22
+ should "markdownify with simple string" do
23
+ assert_equal "<p>something <strong>really</strong> simple</p>", @filter.markdownify("something **really** simple")
24
+ end
25
+
26
+ should "convert array to sentence string with no args" do
27
+ assert_equal "", @filter.array_to_sentence_string([])
28
+ end
29
+
30
+ should "convert array to sentence string with one arg" do
31
+ assert_equal "1", @filter.array_to_sentence_string([1])
32
+ assert_equal "chunky", @filter.array_to_sentence_string(["chunky"])
33
+ end
34
+
35
+ should "convert array to sentence string with two args" do
36
+ assert_equal "1 and 2", @filter.array_to_sentence_string([1, 2])
37
+ assert_equal "chunky and bacon", @filter.array_to_sentence_string(["chunky", "bacon"])
38
+ end
39
+
40
+ should "convert array to sentence string with multiple args" do
41
+ assert_equal "1, 2, 3, and 4", @filter.array_to_sentence_string([1, 2, 3, 4])
42
+ assert_equal "chunky, bacon, bits, and pieces", @filter.array_to_sentence_string(["chunky", "bacon", "bits", "pieces"])
43
+ end
44
+
45
+ should "escape xml with ampersands" do
46
+ assert_equal "AT&amp;T", @filter.xml_escape("AT&T")
47
+ assert_equal "&lt;code&gt;command &amp;lt;filename&amp;gt;&lt;/code&gt;", @filter.xml_escape("<code>command &lt;filename&gt;</code>")
48
+ end
49
+
50
+ should "escape space as plus" do
51
+ assert_equal "my+things", @filter.cgi_escape("my things")
52
+ end
53
+
54
+ should "escape special characters" do
55
+ assert_equal "hey%21", @filter.cgi_escape("hey!")
56
+ end
57
+
58
+ should "escape space as %20" do
59
+ assert_equal "my%20things", @filter.uri_escape("my things")
60
+ end
61
+ end
62
+ end