jekyll 0.6.2 → 0.7.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.

@@ -1,3 +1,10 @@
1
+ == 0.7.0 / 2010-08-24
2
+ * Minor Enhancements
3
+ * Add support for rdiscount extensions (#173)
4
+ * Bug Fixes
5
+ * Highlight should not be able to render local files
6
+ * The site configuration may not always provide a 'time' setting (#184)
7
+
1
8
  == 0.6.2 / 2010-06-25
2
9
  * Bug Fixes
3
10
  * Fix Rakefile 'release' task (tag pushing was missing origin)
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.5'
5
5
 
6
6
  s.name = 'jekyll'
7
- s.version = '0.6.2'
8
- s.date = '2010-06-25'
7
+ s.version = '0.7.0'
8
+ s.date = '2010-08-24'
9
9
  s.rubyforge_project = 'jekyll'
10
10
 
11
11
  s.summary = "A simple, blog aware, static site generator."
@@ -123,6 +123,7 @@ Gem::Specification.new do |s|
123
123
  test/test_page.rb
124
124
  test/test_pager.rb
125
125
  test/test_post.rb
126
+ test/test_rdiscount.rb
126
127
  test/test_site.rb
127
128
  test/test_tags.rb
128
129
  ]
@@ -45,7 +45,7 @@ require_all 'jekyll/generators'
45
45
  require_all 'jekyll/tags'
46
46
 
47
47
  module Jekyll
48
- VERSION = '0.6.2'
48
+ VERSION = '0.7.0'
49
49
 
50
50
  # Default options. Overriden by values in _config.yml or command-line opts.
51
51
  # (Strings rather symbols used for compatability with YAML).
@@ -71,6 +71,9 @@ module Jekyll
71
71
  'png_engine' => 'blahtex',
72
72
  'png_dir' => 'images/latex',
73
73
  'png_url' => '/images/latex'
74
+ },
75
+ 'rdiscount' => {
76
+ 'extensions' => []
74
77
  }
75
78
  }
76
79
 
@@ -54,7 +54,7 @@ class Albino
54
54
  end
55
55
 
56
56
  def initialize(target, lexer = :text, format = :html)
57
- @target = File.exists?(target) ? File.read(target) : target rescue target
57
+ @target = target
58
58
  @options = { :l => lexer, :f => format, :O => 'encoding=utf-8' }
59
59
  end
60
60
 
@@ -13,6 +13,9 @@ module Jekyll
13
13
  when 'rdiscount'
14
14
  begin
15
15
  require 'rdiscount'
16
+
17
+ # Load rdiscount extensions
18
+ @rdiscount_extensions = @config['rdiscount']['extensions'].map { |e| e.to_sym }
16
19
  rescue LoadError
17
20
  STDERR.puts 'You are missing a library required for Markdown. Please run:'
18
21
  STDERR.puts ' $ [sudo] gem install rdiscount'
@@ -67,7 +70,7 @@ module Jekyll
67
70
  setup
68
71
  case @config['markdown']
69
72
  when 'rdiscount'
70
- RDiscount.new(content).to_html
73
+ RDiscount.new(content, *@rdiscount_extensions).to_html
71
74
  when 'maruku'
72
75
  Maruku.new(content).to_html
73
76
  end
@@ -28,7 +28,11 @@ module Jekyll
28
28
  end
29
29
 
30
30
  def reset
31
- self.time = Time.parse(self.config['time'].to_s) || Time.now
31
+ self.time = if self.config['time']
32
+ Time.parse(self.config['time'].to_s)
33
+ else
34
+ Time.now
35
+ end
32
36
  self.layouts = {}
33
37
  self.posts = []
34
38
  self.pages = []
@@ -0,0 +1,18 @@
1
+ require File.dirname(__FILE__) + '/helper'
2
+
3
+ class TestRdiscount < Test::Unit::TestCase
4
+
5
+ context "rdiscount" do
6
+ setup do
7
+ config = {
8
+ 'rdiscount' => { 'extensions' => ['smart'] },
9
+ 'markdown' => 'rdiscount'
10
+ }
11
+ @markdown = MarkdownConverter.new config
12
+ end
13
+
14
+ should "pass rdiscount extensions" do
15
+ assert_equal "<p>&ldquo;smart&rdquo;</p>", @markdown.convert('"smart"').strip
16
+ end
17
+ end
18
+ end
@@ -24,9 +24,7 @@ title: This is a test
24
24
 
25
25
  This document results in a markdown error with maruku
26
26
 
27
- {% highlight text %}
28
- #{code}
29
- {% endhighlight %}
27
+ {% highlight text %}#{code}{% endhighlight %}
30
28
  CONTENT
31
29
  create_post(content, override)
32
30
  end
@@ -45,6 +43,16 @@ CONTENT
45
43
  end
46
44
  end
47
45
 
46
+ context "post content has highlight with file reference" do
47
+ setup do
48
+ fill_post("./jekyll.gemspec")
49
+ end
50
+
51
+ should "not embed the file" do
52
+ assert_match %{<pre><code class='text'>./jekyll.gemspec\n</code></pre>}, @result
53
+ end
54
+ end
55
+
48
56
  context "post content has highlight tag with UTF character" do
49
57
  setup do
50
58
  fill_post("Æ")
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 2
10
- version: 0.6.2
8
+ - 7
9
+ - 0
10
+ version: 0.7.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tom Preston-Werner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-25 00:00:00 -07:00
18
+ date: 2010-08-24 00:00:00 -07:00
19
19
  default_executable: jekyll
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -259,6 +259,7 @@ files:
259
259
  - test/test_page.rb
260
260
  - test/test_pager.rb
261
261
  - test/test_post.rb
262
+ - test/test_rdiscount.rb
262
263
  - test/test_site.rb
263
264
  - test/test_tags.rb
264
265
  has_rdoc: true
@@ -303,5 +304,6 @@ test_files:
303
304
  - test/test_page.rb
304
305
  - test/test_pager.rb
305
306
  - test/test_post.rb
307
+ - test/test_rdiscount.rb
306
308
  - test/test_site.rb
307
309
  - test/test_tags.rb