cypher-jekyll 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/History.txt +0 -12
- data/README.textile +630 -22
- data/Rakefile +2 -2
- data/TODO +3 -0
- data/VERSION.yml +1 -1
- data/features/create_sites.feature +46 -0
- data/features/embed_filters.feature +60 -0
- data/features/permalinks.feature +54 -0
- data/features/post_data.feature +155 -0
- data/features/site_configuration.feature +40 -0
- data/features/site_data.feature +51 -0
- data/features/step_definitions/jekyll_steps.rb +118 -0
- data/features/support/env.rb +18 -0
- data/jekyll.gemspec +120 -0
- data/lib/jekyll/filters.rb +1 -5
- data/lib/jekyll/post.rb +2 -3
- data/lib/jekyll/site.rb +9 -6
- data/test/helper.rb +0 -3
- data/test/test_filters.rb +0 -8
- data/test/test_post.rb +0 -7
- data/test/test_site.rb +0 -8
- data/test/test_tags.rb +7 -72
- metadata +18 -7
- data/test/source/_posts/2009-03-12-hash-#1.markdown +0 -6
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'rr'
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
World do
|
6
|
+
include Test::Unit::Assertions
|
7
|
+
end
|
8
|
+
|
9
|
+
TEST_DIR = File.join('/', 'tmp', 'jekyll')
|
10
|
+
JEKYLL_PATH = File.join(ENV['PWD'], 'bin', 'jekyll')
|
11
|
+
|
12
|
+
def run_jekyll(opts = {})
|
13
|
+
if opts[:bg]
|
14
|
+
bg = '&'
|
15
|
+
end
|
16
|
+
|
17
|
+
system "#{JEKYLL_PATH} >> /dev/null"
|
18
|
+
end
|
data/jekyll.gemspec
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{jekyll}
|
5
|
+
s.version = "0.5.3"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Tom Preston-Werner", "Henrik Nyh", "Markus Prinz"]
|
9
|
+
s.date = %q{2009-07-11}
|
10
|
+
s.default_executable = %q{jekyll}
|
11
|
+
s.description = %q{Jekyll is a simple, blog aware, static site generator.}
|
12
|
+
s.email = %q{tom@mojombo.com}
|
13
|
+
s.executables = ["jekyll"]
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"README.textile"
|
16
|
+
]
|
17
|
+
s.files = [
|
18
|
+
".gitignore",
|
19
|
+
"History.txt",
|
20
|
+
"README.textile",
|
21
|
+
"Rakefile",
|
22
|
+
"TODO",
|
23
|
+
"VERSION.yml",
|
24
|
+
"bin/jekyll",
|
25
|
+
"features/create_sites.feature",
|
26
|
+
"features/embed_filters.feature",
|
27
|
+
"features/permalinks.feature",
|
28
|
+
"features/post_data.feature",
|
29
|
+
"features/site_configuration.feature",
|
30
|
+
"features/site_data.feature",
|
31
|
+
"features/step_definitions/jekyll_steps.rb",
|
32
|
+
"features/support/env.rb",
|
33
|
+
"jekyll.gemspec",
|
34
|
+
"lib/jekyll.rb",
|
35
|
+
"lib/jekyll/albino.rb",
|
36
|
+
"lib/jekyll/converters/csv.rb",
|
37
|
+
"lib/jekyll/converters/mephisto.rb",
|
38
|
+
"lib/jekyll/converters/mt.rb",
|
39
|
+
"lib/jekyll/converters/textpattern.rb",
|
40
|
+
"lib/jekyll/converters/typo.rb",
|
41
|
+
"lib/jekyll/converters/wordpress.rb",
|
42
|
+
"lib/jekyll/convertible.rb",
|
43
|
+
"lib/jekyll/core_ext.rb",
|
44
|
+
"lib/jekyll/filters.rb",
|
45
|
+
"lib/jekyll/haml_helpers.rb",
|
46
|
+
"lib/jekyll/layout.rb",
|
47
|
+
"lib/jekyll/page.rb",
|
48
|
+
"lib/jekyll/post.rb",
|
49
|
+
"lib/jekyll/site.rb",
|
50
|
+
"lib/jekyll/tags/highlight.rb",
|
51
|
+
"lib/jekyll/tags/include.rb",
|
52
|
+
"test/helper.rb",
|
53
|
+
"test/source/_includes/sig.markdown",
|
54
|
+
"test/source/_layouts/default.html",
|
55
|
+
"test/source/_layouts/simple.html",
|
56
|
+
"test/source/_posts/2008-02-02-not-published.textile",
|
57
|
+
"test/source/_posts/2008-02-02-published.textile",
|
58
|
+
"test/source/_posts/2008-10-18-foo-bar.textile",
|
59
|
+
"test/source/_posts/2008-11-21-complex.textile",
|
60
|
+
"test/source/_posts/2008-12-03-permalinked-post.textile",
|
61
|
+
"test/source/_posts/2008-12-13-include.markdown",
|
62
|
+
"test/source/_posts/2009-01-27-array-categories.textile",
|
63
|
+
"test/source/_posts/2009-01-27-categories.textile",
|
64
|
+
"test/source/_posts/2009-01-27-category.textile",
|
65
|
+
"test/source/category/_posts/2008-9-23-categories.textile",
|
66
|
+
"test/source/css/screen.css",
|
67
|
+
"test/source/foo/_posts/bar/2008-12-12-topical-post.textile",
|
68
|
+
"test/source/index.html",
|
69
|
+
"test/source/z_category/_posts/2008-9-23-categories.textile",
|
70
|
+
"test/suite.rb",
|
71
|
+
"test/test_filters.rb",
|
72
|
+
"test/test_generated_site.rb",
|
73
|
+
"test/test_post.rb",
|
74
|
+
"test/test_site.rb",
|
75
|
+
"test/test_tags.rb"
|
76
|
+
]
|
77
|
+
s.homepage = %q{http://github.com/mojombo/jekyll}
|
78
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
79
|
+
s.require_paths = ["lib"]
|
80
|
+
s.rubyforge_project = %q{jekyll}
|
81
|
+
s.rubygems_version = %q{1.3.4}
|
82
|
+
s.summary = %q{Jekyll is a simple, blog aware, static site generator.}
|
83
|
+
s.test_files = [
|
84
|
+
"test/helper.rb",
|
85
|
+
"test/suite.rb",
|
86
|
+
"test/test_filters.rb",
|
87
|
+
"test/test_generated_site.rb",
|
88
|
+
"test/test_post.rb",
|
89
|
+
"test/test_site.rb",
|
90
|
+
"test/test_tags.rb"
|
91
|
+
]
|
92
|
+
|
93
|
+
if s.respond_to? :specification_version then
|
94
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
95
|
+
s.specification_version = 3
|
96
|
+
|
97
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
98
|
+
s.add_runtime_dependency(%q<RedCloth>, [">= 4.0.4"])
|
99
|
+
s.add_runtime_dependency(%q<liquid>, [">= 1.9.0"])
|
100
|
+
s.add_runtime_dependency(%q<classifier>, [">= 1.3.1"])
|
101
|
+
s.add_runtime_dependency(%q<maruku>, [">= 0.5.9"])
|
102
|
+
s.add_runtime_dependency(%q<directory_watcher>, [">= 1.1.1"])
|
103
|
+
s.add_runtime_dependency(%q<open4>, [">= 0.9.6"])
|
104
|
+
else
|
105
|
+
s.add_dependency(%q<RedCloth>, [">= 4.0.4"])
|
106
|
+
s.add_dependency(%q<liquid>, [">= 1.9.0"])
|
107
|
+
s.add_dependency(%q<classifier>, [">= 1.3.1"])
|
108
|
+
s.add_dependency(%q<maruku>, [">= 0.5.9"])
|
109
|
+
s.add_dependency(%q<directory_watcher>, [">= 1.1.1"])
|
110
|
+
s.add_dependency(%q<open4>, [">= 0.9.6"])
|
111
|
+
end
|
112
|
+
else
|
113
|
+
s.add_dependency(%q<RedCloth>, [">= 4.0.4"])
|
114
|
+
s.add_dependency(%q<liquid>, [">= 1.9.0"])
|
115
|
+
s.add_dependency(%q<classifier>, [">= 1.3.1"])
|
116
|
+
s.add_dependency(%q<maruku>, [">= 0.5.9"])
|
117
|
+
s.add_dependency(%q<directory_watcher>, [">= 1.1.1"])
|
118
|
+
s.add_dependency(%q<open4>, [">= 0.9.6"])
|
119
|
+
end
|
120
|
+
end
|
data/lib/jekyll/filters.rb
CHANGED
data/lib/jekyll/post.rb
CHANGED
@@ -136,7 +136,7 @@ module Jekyll
|
|
136
136
|
"year" => date.strftime("%Y"),
|
137
137
|
"month" => date.strftime("%m"),
|
138
138
|
"day" => date.strftime("%d"),
|
139
|
-
"title" =>
|
139
|
+
"title" => slug,
|
140
140
|
"categories" => categories.sort.join('/')
|
141
141
|
}.inject(template) { |result, token|
|
142
142
|
result.gsub(/:#{token.first}/, token.last)
|
@@ -233,8 +233,7 @@ module Jekyll
|
|
233
233
|
def write(dest)
|
234
234
|
FileUtils.mkdir_p(File.join(dest, dir))
|
235
235
|
|
236
|
-
|
237
|
-
path = File.join(dest, CGI.unescape(self.url))
|
236
|
+
path = File.join(dest, self.generated_path)
|
238
237
|
|
239
238
|
if template[/\.html$/].nil?
|
240
239
|
FileUtils.mkdir_p(path)
|
data/lib/jekyll/site.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Jekyll
|
2
2
|
|
3
3
|
class Site
|
4
|
-
attr_accessor :config, :layouts, :posts, :
|
5
|
-
attr_accessor :source, :dest, :lsi, :pygments, :
|
4
|
+
attr_accessor :config, :layouts, :posts, :collated_posts, :categories, :tags
|
5
|
+
attr_accessor :source, :dest, :lsi, :pygments, :pygments_cache, :permalink_style,
|
6
6
|
:sass, :post_defaults
|
7
7
|
|
8
8
|
# Initialize the site
|
@@ -18,7 +18,6 @@ module Jekyll
|
|
18
18
|
self.pygments = config['pygments']
|
19
19
|
self.pygments_cache = config['pygments_cache']
|
20
20
|
self.permalink_style = config['permalink'].to_sym
|
21
|
-
self.exclude = config['exclude'] || []
|
22
21
|
self.post_defaults = config['post_defaults'] || {}
|
23
22
|
|
24
23
|
self.reset
|
@@ -51,12 +50,13 @@ module Jekyll
|
|
51
50
|
begin
|
52
51
|
require 'haml'
|
53
52
|
require 'jekyll/haml_helpers'
|
54
|
-
helpers = File.join(source, '_helpers.rb')
|
55
|
-
require helpers if File.exist?(helpers)
|
56
53
|
puts 'Enabled Haml'
|
57
54
|
rescue LoadError
|
58
55
|
puts 'You must have the haml gem installed first'
|
59
56
|
end
|
57
|
+
# Load helpers if available
|
58
|
+
helpers = File.join(source, '_helpers.rb')
|
59
|
+
require helpers if File.exist?(helpers)
|
60
60
|
end
|
61
61
|
|
62
62
|
if self.pygments_cache
|
@@ -75,6 +75,7 @@ module Jekyll
|
|
75
75
|
RDiscount.new(content).to_html
|
76
76
|
end
|
77
77
|
|
78
|
+
puts 'Using rdiscount for Markdown'
|
78
79
|
rescue LoadError
|
79
80
|
puts 'You must have the rdiscount gem installed first'
|
80
81
|
end
|
@@ -290,9 +291,11 @@ module Jekyll
|
|
290
291
|
def filter_entries(entries)
|
291
292
|
entries = entries.reject do |e|
|
292
293
|
unless ['_posts', '.htaccess'].include?(e)
|
293
|
-
|
294
|
+
# Reject backup/hidden
|
295
|
+
['.', '_', '#'].include?(e[0..0]) or e[-1..-1] == '~'
|
294
296
|
end
|
295
297
|
end
|
296
298
|
end
|
299
|
+
|
297
300
|
end
|
298
301
|
end
|
data/test/helper.rb
CHANGED
data/test/test_filters.rb
CHANGED
@@ -37,13 +37,5 @@ class TestFilters < Test::Unit::TestCase
|
|
37
37
|
assert_equal "AT&T", @filter.xml_escape("AT&T")
|
38
38
|
assert_equal "<code>command &lt;filename&gt;</code>", @filter.xml_escape("<code>command <filename></code>")
|
39
39
|
end
|
40
|
-
|
41
|
-
should "escape space as plus" do
|
42
|
-
assert_equal "my+things", @filter.cgi_escape("my things")
|
43
|
-
end
|
44
|
-
|
45
|
-
should "escape special characters" do
|
46
|
-
assert_equal "hey%21", @filter.cgi_escape("hey!")
|
47
|
-
end
|
48
40
|
end
|
49
41
|
end
|
data/test/test_post.rb
CHANGED
@@ -52,13 +52,6 @@ class TestPost < Test::Unit::TestCase
|
|
52
52
|
assert_equal "/2008/10/19/foo-bar.html", @post.url
|
53
53
|
end
|
54
54
|
|
55
|
-
should "CGI escape urls" do
|
56
|
-
@post.categories = []
|
57
|
-
@post.process("2009-03-12-hash-#1.markdown")
|
58
|
-
assert_equal "/2009/03/12/hash-%231.html", @post.url
|
59
|
-
assert_equal "/2009/03/12/hash-#1", @post.id
|
60
|
-
end
|
61
|
-
|
62
55
|
should "respect permalink in yaml front matter" do
|
63
56
|
file = "2008-12-03-permalinked-post.textile"
|
64
57
|
@post.process(file)
|
data/test/test_site.rb
CHANGED
@@ -53,13 +53,5 @@ class TestSite < Test::Unit::TestCase
|
|
53
53
|
assert_equal %w[foo.markdown bar.markdown baz.markdown], @site.filter_entries(ent1)
|
54
54
|
assert_equal ent2, @site.filter_entries(ent2)
|
55
55
|
end
|
56
|
-
|
57
|
-
should "filter entries with exclude" do
|
58
|
-
excludes = %w[README TODO]
|
59
|
-
includes = %w[index.html site.css]
|
60
|
-
|
61
|
-
@site.exclude = excludes
|
62
|
-
assert_equal includes, @site.filter_entries(excludes + includes)
|
63
|
-
end
|
64
56
|
end
|
65
57
|
end
|
data/test/test_tags.rb
CHANGED
@@ -2,29 +2,13 @@ require File.dirname(__FILE__) + '/helper'
|
|
2
2
|
|
3
3
|
class TestTags < Test::Unit::TestCase
|
4
4
|
|
5
|
-
def create_post(
|
5
|
+
def create_post(code)
|
6
6
|
stub(Jekyll).configuration do
|
7
|
-
Jekyll::DEFAULTS.merge({'pygments' => true})
|
7
|
+
Jekyll::DEFAULTS.merge({'pygments' => true})
|
8
8
|
end
|
9
9
|
site = Site.new(Jekyll.configuration)
|
10
10
|
info = { :filters => [Jekyll::Filters], :registers => { :site => site } }
|
11
11
|
|
12
|
-
if markdown
|
13
|
-
payload = {"content_type" => "markdown"}
|
14
|
-
else
|
15
|
-
payload = {"content_type" => "textile"}
|
16
|
-
end
|
17
|
-
|
18
|
-
@result = Liquid::Template.parse(content).render(payload, info)
|
19
|
-
|
20
|
-
if markdown
|
21
|
-
@result = site.markdown(@result)
|
22
|
-
else
|
23
|
-
@result = site.textile(@result)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def fill_post(code, override = {})
|
28
12
|
content = <<CONTENT
|
29
13
|
---
|
30
14
|
title: This is a test
|
@@ -36,12 +20,14 @@ This document results in a markdown error with maruku
|
|
36
20
|
#{code}
|
37
21
|
{% endhighlight %}
|
38
22
|
CONTENT
|
39
|
-
|
23
|
+
|
24
|
+
@result = Liquid::Template.parse(content).render({}, info)
|
25
|
+
@result = site.markdown(@result)
|
40
26
|
end
|
41
27
|
|
42
28
|
context "post content has highlight tag" do
|
43
29
|
setup do
|
44
|
-
|
30
|
+
create_post("test")
|
45
31
|
end
|
46
32
|
|
47
33
|
should "not cause a markdown error" do
|
@@ -55,62 +41,11 @@ CONTENT
|
|
55
41
|
|
56
42
|
context "post content has highlight tag with UTF character" do
|
57
43
|
setup do
|
58
|
-
|
44
|
+
create_post("Æ")
|
59
45
|
end
|
60
46
|
|
61
47
|
should "render markdown with pygments line handling" do
|
62
48
|
assert_match %{<pre>Æ\n</pre>}, @result
|
63
49
|
end
|
64
50
|
end
|
65
|
-
|
66
|
-
context "simple post with markdown and pre tags" do
|
67
|
-
setup do
|
68
|
-
@content = <<CONTENT
|
69
|
-
---
|
70
|
-
title: Maruku vs. RDiscount
|
71
|
-
---
|
72
|
-
|
73
|
-
_FIGHT!_
|
74
|
-
|
75
|
-
{% highlight ruby %}
|
76
|
-
puts "3..2..1.."
|
77
|
-
{% endhighlight %}
|
78
|
-
|
79
|
-
*FINISH HIM*
|
80
|
-
CONTENT
|
81
|
-
end
|
82
|
-
|
83
|
-
context "using Textile" do
|
84
|
-
setup do
|
85
|
-
create_post(@content, {}, false)
|
86
|
-
end
|
87
|
-
|
88
|
-
# Broken in RedCloth 4.1.9
|
89
|
-
should "not textilize highlight block" do
|
90
|
-
assert_no_match %r{3\.\.2\.\.1\.\."</span><br />}, @result
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
context "using Maruku" do
|
95
|
-
setup do
|
96
|
-
create_post(@content)
|
97
|
-
end
|
98
|
-
|
99
|
-
should "parse correctly" do
|
100
|
-
assert_match %r{<em>FIGHT!</em>}, @result
|
101
|
-
assert_match %r{<em>FINISH HIM</em>}, @result
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
context "using RDiscount" do
|
106
|
-
setup do
|
107
|
-
create_post(@content, 'markdown' => 'rdiscount')
|
108
|
-
end
|
109
|
-
|
110
|
-
should "parse correctly" do
|
111
|
-
assert_match %r{<em>FIGHT!</em>}, @result
|
112
|
-
assert_match %r{<em>FINISH HIM</em>}, @result
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
51
|
end
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cypher-jekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
8
8
|
- Henrik Nyh
|
9
|
+
- Markus Prinz
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
13
|
|
13
|
-
date: 2009-
|
14
|
+
date: 2009-07-11 00:00:00 -07:00
|
14
15
|
default_executable: jekyll
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
@@ -19,9 +20,9 @@ dependencies:
|
|
19
20
|
version_requirement:
|
20
21
|
version_requirements: !ruby/object:Gem::Requirement
|
21
22
|
requirements:
|
22
|
-
- - "
|
23
|
+
- - ">="
|
23
24
|
- !ruby/object:Gem::Version
|
24
|
-
version: 4.
|
25
|
+
version: 4.0.4
|
25
26
|
version:
|
26
27
|
- !ruby/object:Gem::Dependency
|
27
28
|
name: liquid
|
@@ -82,11 +83,22 @@ extensions: []
|
|
82
83
|
extra_rdoc_files:
|
83
84
|
- README.textile
|
84
85
|
files:
|
86
|
+
- .gitignore
|
85
87
|
- History.txt
|
86
88
|
- README.textile
|
87
89
|
- Rakefile
|
90
|
+
- TODO
|
88
91
|
- VERSION.yml
|
89
92
|
- bin/jekyll
|
93
|
+
- features/create_sites.feature
|
94
|
+
- features/embed_filters.feature
|
95
|
+
- features/permalinks.feature
|
96
|
+
- features/post_data.feature
|
97
|
+
- features/site_configuration.feature
|
98
|
+
- features/site_data.feature
|
99
|
+
- features/step_definitions/jekyll_steps.rb
|
100
|
+
- features/support/env.rb
|
101
|
+
- jekyll.gemspec
|
90
102
|
- lib/jekyll.rb
|
91
103
|
- lib/jekyll/albino.rb
|
92
104
|
- lib/jekyll/converters/csv.rb
|
@@ -118,7 +130,6 @@ files:
|
|
118
130
|
- test/source/_posts/2009-01-27-array-categories.textile
|
119
131
|
- test/source/_posts/2009-01-27-categories.textile
|
120
132
|
- test/source/_posts/2009-01-27-category.textile
|
121
|
-
- test/source/_posts/2009-03-12-hash-#1.markdown
|
122
133
|
- test/source/category/_posts/2008-9-23-categories.textile
|
123
134
|
- test/source/css/screen.css
|
124
135
|
- test/source/foo/_posts/bar/2008-12-12-topical-post.textile
|
@@ -130,7 +141,7 @@ files:
|
|
130
141
|
- test/test_post.rb
|
131
142
|
- test/test_site.rb
|
132
143
|
- test/test_tags.rb
|
133
|
-
has_rdoc:
|
144
|
+
has_rdoc: false
|
134
145
|
homepage: http://github.com/mojombo/jekyll
|
135
146
|
post_install_message:
|
136
147
|
rdoc_options:
|
@@ -154,7 +165,7 @@ requirements: []
|
|
154
165
|
rubyforge_project: jekyll
|
155
166
|
rubygems_version: 1.2.0
|
156
167
|
signing_key:
|
157
|
-
specification_version:
|
168
|
+
specification_version: 3
|
158
169
|
summary: Jekyll is a simple, blog aware, static site generator.
|
159
170
|
test_files:
|
160
171
|
- test/helper.rb
|