spinto-jekyll 0.11.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,37 @@
1
+ module Jekyll
2
+
3
+ class IncludeTag < Liquid::Tag
4
+ def initialize(tag_name, file, tokens)
5
+ super
6
+ @file = file.strip
7
+ end
8
+
9
+ def render(context)
10
+ includes_dir = File.join(context.registers[:site].source, '_includes')
11
+
12
+ if File.symlink?(includes_dir)
13
+ return "Includes directory '#{includes_dir}' cannot be a symlink"
14
+ end
15
+
16
+ if @file !~ /^[a-zA-Z0-9_\/\.-]+$/ || @file =~ /\.\// || @file =~ /\/\./
17
+ return "Include file '#{@file}' contains invalid characters or sequences"
18
+ end
19
+
20
+ Dir.chdir(includes_dir) do
21
+ choices = Dir['**/*'].reject { |x| File.symlink?(x) }
22
+ if choices.include?(@file)
23
+ source = File.read(@file)
24
+ partial = Liquid::Template.parse(source)
25
+ context.stack do
26
+ partial.render(context)
27
+ end
28
+ else
29
+ "Included file '#{@file}' not found in _includes directory"
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+ end
36
+
37
+ Liquid::Template.register_tag('include', Jekyll::IncludeTag)
@@ -0,0 +1,38 @@
1
+ module Jekyll
2
+
3
+ class PostComparer
4
+ MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)$/
5
+
6
+ attr_accessor :date, :slug
7
+
8
+ def initialize(name)
9
+ who, cares, date, slug = *name.match(MATCHER)
10
+ @slug = slug
11
+ @date = Time.parse(date)
12
+ end
13
+ end
14
+
15
+ class PostUrl < Liquid::Tag
16
+ def initialize(tag_name, post, tokens)
17
+ super
18
+ @orig_post = post.strip
19
+ @post = PostComparer.new(@orig_post)
20
+ end
21
+
22
+ def render(context)
23
+ site = context.registers[:site]
24
+
25
+ site.posts.each do |p|
26
+ if p == @post
27
+ return p.url
28
+ end
29
+ end
30
+
31
+ puts "ERROR: post_url: \"#{@orig_post}\" could not be found"
32
+
33
+ return "#"
34
+ end
35
+ end
36
+ end
37
+
38
+ Liquid::Template.register_tag('post_url', Jekyll::PostUrl)
@@ -0,0 +1,3 @@
1
+ module SpintoJekyll
2
+ VERSION = '0.11.2.1'
3
+ end
@@ -0,0 +1,155 @@
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 = 'spinto-jekyll'
7
+ s.version = '0.11.2.1'
8
+ s.date = '2012-02-23'
9
+ s.rubyforge_project = 'spinto-jekyll'
10
+
11
+ s.summary = "A simple, blog aware, static site generator."
12
+ s.description = "Jekyll is a simple, blog aware, static site generator."
13
+
14
+ s.authors = ["Matthew Beale", "Tom Preston-Werner"]
15
+ s.email = 'matt.beale@madhatted.com'
16
+ s.homepage = 'http://github.com/mixonic/jekyll'
17
+
18
+ s.require_paths = %w[lib]
19
+
20
+ s.executables = []
21
+
22
+ s.rdoc_options = ["--charset=UTF-8"]
23
+ s.extra_rdoc_files = %w[README.textile 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.1")
28
+ s.add_runtime_dependency('maruku', "~> 0.5")
29
+ s.add_runtime_dependency('kramdown', "~> 0.13")
30
+ s.add_runtime_dependency('albino', "~> 1.3")
31
+
32
+ s.add_development_dependency('rake', "~> 0.9")
33
+ s.add_development_dependency('rdoc', "~> 3.11")
34
+ s.add_development_dependency('redgreen', "~> 1.2")
35
+ s.add_development_dependency('shoulda', "~> 2.11")
36
+ s.add_development_dependency('rr', "~> 1.0")
37
+ s.add_development_dependency('cucumber', "1.1")
38
+ s.add_development_dependency('RedCloth', "~> 4.2")
39
+ s.add_development_dependency('rdiscount', "~> 1.6")
40
+ s.add_development_dependency('redcarpet', "~> 1.9")
41
+
42
+ # = MANIFEST =
43
+ s.files = %w[
44
+ Gemfile
45
+ History.txt
46
+ LICENSE
47
+ README.textile
48
+ Rakefile
49
+ bin/jekyll
50
+ cucumber.yml
51
+ features/create_sites.feature
52
+ features/embed_filters.feature
53
+ features/markdown.feature
54
+ features/pagination.feature
55
+ features/permalinks.feature
56
+ features/post_data.feature
57
+ features/site_configuration.feature
58
+ features/site_data.feature
59
+ features/step_definitions/jekyll_steps.rb
60
+ features/support/env.rb
61
+ lib/jekyll.rb
62
+ lib/jekyll/converter.rb
63
+ lib/jekyll/converters/identity.rb
64
+ lib/jekyll/converters/markdown.rb
65
+ lib/jekyll/converters/textile.rb
66
+ lib/jekyll/convertible.rb
67
+ lib/jekyll/core_ext.rb
68
+ lib/jekyll/errors.rb
69
+ lib/jekyll/filters.rb
70
+ lib/jekyll/generator.rb
71
+ lib/jekyll/generators/pagination.rb
72
+ lib/jekyll/layout.rb
73
+ lib/jekyll/migrators/csv.rb
74
+ lib/jekyll/migrators/drupal.rb
75
+ lib/jekyll/migrators/enki.rb
76
+ lib/jekyll/migrators/joomla.rb
77
+ lib/jekyll/migrators/marley.rb
78
+ lib/jekyll/migrators/mephisto.rb
79
+ lib/jekyll/migrators/mt.rb
80
+ lib/jekyll/migrators/posterous.rb
81
+ lib/jekyll/migrators/rss.rb
82
+ lib/jekyll/migrators/textpattern.rb
83
+ lib/jekyll/migrators/tumblr.rb
84
+ lib/jekyll/migrators/typo.rb
85
+ lib/jekyll/migrators/wordpress.rb
86
+ lib/jekyll/migrators/wordpressdotcom.rb
87
+ lib/jekyll/page.rb
88
+ lib/jekyll/plugin.rb
89
+ lib/jekyll/post.rb
90
+ lib/jekyll/site.rb
91
+ lib/jekyll/static_file.rb
92
+ lib/jekyll/tags/highlight.rb
93
+ lib/jekyll/tags/include.rb
94
+ lib/jekyll/tags/post_url.rb
95
+ lib/spinto-jekyll.rb
96
+ spinto-jekyll.gemspec
97
+ test/helper.rb
98
+ test/source/.htaccess
99
+ test/source/_includes/sig.markdown
100
+ test/source/_layouts/default.html
101
+ test/source/_layouts/simple.html
102
+ test/source/_posts/2008-02-02-not-published.textile
103
+ test/source/_posts/2008-02-02-published.textile
104
+ test/source/_posts/2008-10-18-foo-bar.textile
105
+ test/source/_posts/2008-11-21-complex.textile
106
+ test/source/_posts/2008-12-03-permalinked-post.textile
107
+ test/source/_posts/2008-12-13-include.markdown
108
+ test/source/_posts/2009-01-27-array-categories.textile
109
+ test/source/_posts/2009-01-27-categories.textile
110
+ test/source/_posts/2009-01-27-category.textile
111
+ test/source/_posts/2009-01-27-empty-categories.textile
112
+ test/source/_posts/2009-01-27-empty-category.textile
113
+ test/source/_posts/2009-03-12-hash-#1.markdown
114
+ test/source/_posts/2009-05-18-empty-tag.textile
115
+ test/source/_posts/2009-05-18-empty-tags.textile
116
+ test/source/_posts/2009-05-18-tag.textile
117
+ test/source/_posts/2009-05-18-tags.textile
118
+ test/source/_posts/2009-06-22-empty-yaml.textile
119
+ test/source/_posts/2009-06-22-no-yaml.textile
120
+ test/source/_posts/2010-01-08-triple-dash.markdown
121
+ test/source/_posts/2010-01-09-date-override.textile
122
+ test/source/_posts/2010-01-09-time-override.textile
123
+ test/source/_posts/2010-01-09-timezone-override.textile
124
+ test/source/_posts/2010-01-16-override-data.textile
125
+ test/source/_posts/2011-04-12-md-extension.md
126
+ test/source/_posts/2011-04-12-text-extension.text
127
+ test/source/about.html
128
+ test/source/category/_posts/2008-9-23-categories.textile
129
+ test/source/contacts.html
130
+ test/source/css/screen.css
131
+ test/source/deal.with.dots.html
132
+ test/source/foo/_posts/bar/2008-12-12-topical-post.textile
133
+ test/source/index.html
134
+ test/source/sitemap.xml
135
+ test/source/win/_posts/2009-05-24-yaml-linebreak.markdown
136
+ test/source/z_category/_posts/2008-9-23-categories.textile
137
+ test/suite.rb
138
+ test/test_configuration.rb
139
+ test/test_core_ext.rb
140
+ test/test_filters.rb
141
+ test/test_generated_site.rb
142
+ test/test_kramdown.rb
143
+ test/test_page.rb
144
+ test/test_pager.rb
145
+ test/test_post.rb
146
+ test/test_rdiscount.rb
147
+ test/test_redcarpet.rb
148
+ test/test_redcloth.rb
149
+ test/test_site.rb
150
+ test/test_tags.rb
151
+ ]
152
+ # = MANIFEST =
153
+
154
+ s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
155
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+ gem 'RedCloth', '>= 4.2.1'
3
+
4
+ require 'jekyll'
5
+
6
+ require 'RedCloth'
7
+ require 'rdiscount'
8
+ require 'kramdown'
9
+ require 'redcarpet'
10
+
11
+ require 'redgreen' if RUBY_VERSION < '1.9'
12
+ require 'shoulda'
13
+ require 'rr'
14
+
15
+ include Jekyll
16
+
17
+ # Send STDERR into the void to suppress program output messages
18
+ STDERR.reopen(test(?e, '/dev/null') ? '/dev/null' : 'NUL:')
19
+
20
+ class Test::Unit::TestCase
21
+ include RR::Adapters::TestUnit
22
+
23
+ def dest_dir(*subdirs)
24
+ File.join(File.dirname(__FILE__), 'dest', *subdirs)
25
+ end
26
+
27
+ def source_dir(*subdirs)
28
+ File.join(File.dirname(__FILE__), 'source', *subdirs)
29
+ end
30
+
31
+ def clear_dest
32
+ FileUtils.rm_rf(dest_dir)
33
+ end
34
+ 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
+ ---
2
+ layout: default
3
+ title: Not published!
4
+ published: false
5
+ category: publish_test
6
+ ---
7
+
8
+ This should *not* be published!
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: Publish
4
+ category: publish_test
5
+ ---
6
+
7
+ This should be published.
8
+
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: Foo Bar
4
+ ---
5
+
6
+ h1. {{ page.title }}
7
+
8
+ Best *post* ever
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: Complex
4
+ ---
5
+
6
+ url: {{ page.url }}
7
+ date: {{ page.date }}
8
+ id: {{ page.id }}
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Post with Permalink
3
+ permalink: my_category/permalinked-post
4
+ ---
5
+
6
+ h1. {{ page.title }}
7
+
8
+
9
+ <p>Best <strong>post</strong> ever</p>
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: Include
4
+ ---
5
+
6
+ {% include sig.markdown %}
7
+
8
+ This _is_ cool
@@ -0,0 +1,10 @@
1
+ ---
2
+ layout: default
3
+ title: Array categories in YAML
4
+ categories:
5
+ - foo
6
+ - bar
7
+ - baz
8
+ ---
9
+
10
+ Best *post* ever
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: default
3
+ title: Categories in YAML
4
+ categories: foo bar baz
5
+ ---
6
+
7
+ Best *post* ever
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: default
3
+ title: Category in YAML
4
+ category: foo
5
+ ---
6
+
7
+ Best *post* ever
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: default
3
+ title: Category in YAML
4
+ categories:
5
+ ---
6
+
7
+ Best *post* ever
@@ -0,0 +1,7 @@
1
+ ---
2
+ layout: default
3
+ title: Category in YAML
4
+ category:
5
+ ---
6
+
7
+ Best *post* ever
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: default
3
+ title: Hash #1
4
+ ---
5
+
6
+ Hashes are nice
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: A Tag
3
+ tag:
4
+ ---
5
+
6
+ Whoa.