sixones-jekyll 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/.gitignore +6 -0
  2. data/History.txt +28 -0
  3. data/README.textile +25 -529
  4. data/Rakefile +2 -2
  5. data/VERSION.yml +1 -1
  6. data/bin/jekyll +12 -2
  7. data/features/create_sites.feature +46 -0
  8. data/features/embed_filters.feature +60 -0
  9. data/features/pagination.feature +40 -0
  10. data/features/permalinks.feature +63 -0
  11. data/features/post_data.feature +153 -0
  12. data/features/site_configuration.feature +63 -0
  13. data/features/site_data.feature +82 -0
  14. data/features/step_definitions/jekyll_steps.rb +136 -0
  15. data/features/support/env.rb +16 -0
  16. data/jekyll.gemspec +134 -0
  17. data/lib/jekyll/albino.rb +4 -2
  18. data/lib/jekyll/convertible.rb +6 -4
  19. data/lib/jekyll/core_ext.rb +9 -1
  20. data/lib/jekyll/filters.rb +5 -1
  21. data/lib/jekyll/page.rb +58 -13
  22. data/lib/jekyll/pager.rb +45 -0
  23. data/lib/jekyll/post.rb +76 -30
  24. data/lib/jekyll/site.rb +44 -16
  25. data/lib/jekyll/tags/highlight.rb +2 -2
  26. data/lib/jekyll.rb +8 -6
  27. data/test/helper.rb +3 -0
  28. data/test/source/_posts/2009-03-12-hash-#1.markdown +6 -0
  29. data/test/source/_posts/2009-05-18-tag.textile +6 -0
  30. data/test/source/_posts/2009-05-18-tags.textile +9 -0
  31. data/test/source/_posts/2009-06-22-empty-yaml.textile +3 -0
  32. data/test/source/_posts/2009-06-22-no-yaml.textile +1 -0
  33. data/test/source/about.html +6 -0
  34. data/test/source/contacts.html +5 -0
  35. data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +7 -0
  36. data/test/test_configuration.rb +29 -0
  37. data/test/test_filters.rb +8 -0
  38. data/test/test_generated_site.rb +7 -5
  39. data/test/test_page.rb +87 -0
  40. data/test/test_pager.rb +47 -0
  41. data/test/test_post.rb +160 -3
  42. data/test/test_site.rb +29 -1
  43. data/test/test_tags.rb +97 -16
  44. metadata +31 -6
  45. data/lib/jekyll/custom_filters.rb +0 -25
data/test/test_tags.rb CHANGED
@@ -1,35 +1,116 @@
1
1
  require File.dirname(__FILE__) + '/helper'
2
2
 
3
3
  class TestTags < Test::Unit::TestCase
4
- context "tagging" do
5
- setup do
6
- @content = <<CONTENT
4
+
5
+ def create_post(content, override = {}, markdown = true)
6
+ stub(Jekyll).configuration do
7
+ Jekyll::DEFAULTS.merge({'pygments' => true}).merge(override)
8
+ end
9
+ site = Site.new(Jekyll.configuration)
10
+ info = { :filters => [Jekyll::Filters], :registers => { :site => site } }
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
+ content = <<CONTENT
7
29
  ---
8
- layout: post
9
30
  title: This is a test
10
-
11
31
  ---
32
+
12
33
  This document results in a markdown error with maruku
13
34
 
14
- {% highlight ruby %}
15
- puts "hi"
35
+ {% highlight text %}
36
+ #{code}
37
+ {% endhighlight %}
38
+ CONTENT
39
+ create_post(content, override)
40
+ end
41
+
42
+ context "post content has highlight tag" do
43
+ setup do
44
+ fill_post("test")
45
+ end
46
+
47
+ should "not cause a markdown error" do
48
+ assert_no_match /markdown\-html\-error/, @result
49
+ end
50
+
51
+ should "render markdown with pygments line handling" do
52
+ assert_match %{<pre>test\n</pre>}, @result
53
+ end
54
+ end
16
55
 
17
- puts "bye"
56
+ context "post content has highlight tag with UTF character" do
57
+ setup do
58
+ fill_post("Æ")
59
+ end
60
+
61
+ should "render markdown with pygments line handling" do
62
+ assert_match %{<pre>Æ\n</pre>}, @result
63
+ end
64
+ 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.."
18
77
  {% endhighlight %}
19
78
 
79
+ *FINISH HIM*
20
80
  CONTENT
21
81
  end
22
82
 
23
- should "render markdown with pygments line handling" do
24
- stub(Jekyll).configuration do
25
- Jekyll::DEFAULTS.merge({'pygments' => true})
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\.\.&quot;</span><br />}, @result
91
+ end
92
+ end
93
+
94
+ context "using Maruku" do
95
+ setup do
96
+ create_post(@content)
26
97
  end
27
- site = Site.new(Jekyll.configuration)
28
- info = { :filters => [Jekyll::Filters], :registers => { :site => site } }
29
98
 
30
- result = Liquid::Template.parse(@content).render({}, info)
31
- result = site.markdown(result)
32
- assert_no_match(/markdown\-html\-error/,result)
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
33
114
  end
34
115
  end
35
116
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sixones-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-07 00:00:00 -07:00
12
+ date: 2009-06-24 00:00:00 -07:00
13
13
  default_executable: jekyll
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 4.0.4
23
+ version: 4.2.1
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: liquid
@@ -81,11 +81,22 @@ extensions: []
81
81
  extra_rdoc_files:
82
82
  - README.textile
83
83
  files:
84
+ - .gitignore
84
85
  - History.txt
85
86
  - README.textile
86
87
  - Rakefile
87
88
  - VERSION.yml
88
89
  - bin/jekyll
90
+ - features/create_sites.feature
91
+ - features/embed_filters.feature
92
+ - features/pagination.feature
93
+ - features/permalinks.feature
94
+ - features/post_data.feature
95
+ - features/site_configuration.feature
96
+ - features/site_data.feature
97
+ - features/step_definitions/jekyll_steps.rb
98
+ - features/support/env.rb
99
+ - jekyll.gemspec
89
100
  - lib/jekyll.rb
90
101
  - lib/jekyll/albino.rb
91
102
  - lib/jekyll/converters/csv.rb
@@ -96,10 +107,10 @@ files:
96
107
  - lib/jekyll/converters/wordpress.rb
97
108
  - lib/jekyll/convertible.rb
98
109
  - lib/jekyll/core_ext.rb
99
- - lib/jekyll/custom_filters.rb
100
110
  - lib/jekyll/filters.rb
101
111
  - lib/jekyll/layout.rb
102
112
  - lib/jekyll/page.rb
113
+ - lib/jekyll/pager.rb
103
114
  - lib/jekyll/post.rb
104
115
  - lib/jekyll/site.rb
105
116
  - lib/jekyll/tags/highlight.rb
@@ -117,18 +128,29 @@ files:
117
128
  - test/source/_posts/2009-01-27-array-categories.textile
118
129
  - test/source/_posts/2009-01-27-categories.textile
119
130
  - test/source/_posts/2009-01-27-category.textile
131
+ - test/source/_posts/2009-03-12-hash-#1.markdown
132
+ - test/source/_posts/2009-05-18-tag.textile
133
+ - test/source/_posts/2009-05-18-tags.textile
134
+ - test/source/_posts/2009-06-22-empty-yaml.textile
135
+ - test/source/_posts/2009-06-22-no-yaml.textile
136
+ - test/source/about.html
120
137
  - test/source/category/_posts/2008-9-23-categories.textile
138
+ - test/source/contacts.html
121
139
  - test/source/css/screen.css
122
140
  - test/source/foo/_posts/bar/2008-12-12-topical-post.textile
123
141
  - test/source/index.html
142
+ - test/source/win/_posts/2009-05-24-yaml-linebreak.markdown
124
143
  - test/source/z_category/_posts/2008-9-23-categories.textile
125
144
  - test/suite.rb
145
+ - test/test_configuration.rb
126
146
  - test/test_filters.rb
127
147
  - test/test_generated_site.rb
148
+ - test/test_page.rb
149
+ - test/test_pager.rb
128
150
  - test/test_post.rb
129
151
  - test/test_site.rb
130
152
  - test/test_tags.rb
131
- has_rdoc: true
153
+ has_rdoc: false
132
154
  homepage: http://github.com/mojombo/jekyll
133
155
  post_install_message:
134
156
  rdoc_options:
@@ -152,13 +174,16 @@ requirements: []
152
174
  rubyforge_project: jekyll
153
175
  rubygems_version: 1.2.0
154
176
  signing_key:
155
- specification_version: 2
177
+ specification_version: 3
156
178
  summary: Jekyll is a simple, blog aware, static site generator.
157
179
  test_files:
158
180
  - test/helper.rb
159
181
  - test/suite.rb
182
+ - test/test_configuration.rb
160
183
  - test/test_filters.rb
161
184
  - test/test_generated_site.rb
185
+ - test/test_page.rb
186
+ - test/test_pager.rb
162
187
  - test/test_post.rb
163
188
  - test/test_site.rb
164
189
  - test/test_tags.rb
@@ -1,25 +0,0 @@
1
- module Jekyll
2
- module Filters
3
- module Custom
4
- def self.extensions; @@extensions; end
5
-
6
- @@extensions = [ ]
7
-
8
- def self.included(base)
9
- @@extensions << base
10
- end
11
-
12
- def self.invoke_filter(name, params)
13
- self.send(name, params)
14
- end
15
- end
16
-
17
- module Basic
18
- include Jekyll::Filters::Custom
19
-
20
- def hello_world(input)
21
- "Hello World!"
22
- end
23
- end
24
- end
25
- end