mojombo-jekyll 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,22 @@
1
+ == 0.4.0 / 2009-02-03
2
+ * Major Enhancements
3
+ * Switch to Jeweler for packaging tasks
4
+ * Minor Enhancements
5
+ * Type importer [github.com/codeslinger]
6
+ * site.topics accessor [github.com/baz]
7
+ * Add array_to_sentence_string filter [github.com/mchung]
8
+ * Add a converter for textpattern [github.com/PerfectlyNormal]
9
+ * Add a working Mephisto / MySQL converter [github.com/ivey]
10
+ * Allowing .htaccess files to be copied over into the generated site [github.com/briandoll]
11
+ * Add option to not put file date in permalink URL [github.com/mreid]
12
+ * Add line number capabilities to highlight blocks [github.com/jcon]
13
+ * Bug Fixes
14
+ * Fix permalink behavior [github.com/cavalle]
15
+ * Fixed an issue with pygments, markdown, and newlines [github.com/zpinter]
16
+ * Ampersands need to be escaped [github.com/pufuwozu, github.com/ap]
17
+ * Test and fix the site.categories hash [github.com/zzot]
18
+ * Fix site payload available to files [github.com/matrix9180]
19
+
1
20
  == 0.3.0 / 2008-12-24
2
21
  * Major Enhancements
3
22
  * Added --server option to start a simple WEBrick server on destination directory [github.com/johnreilly and github.com/mchung]
@@ -34,7 +34,7 @@ fields such as <code>title</code> and <code>date</code>.
34
34
  Jekyll gets the list of blog posts by parsing the files in any
35
35
  "_posts":http://github.com/mojombo/tpw/tree/master/_posts directory found in
36
36
  subdirectories below the root.
37
- Each post's filename contains the publishing date and slug (what shows up in the
37
+ Each post's filename contains (by default) the publishing date and slug (what shows up in the
38
38
  URL) that the final HTML file should have. Open up the file corresponding to a
39
39
  blog post:
40
40
  "2008-11-17-blogging-like-a-hacker.textile":http://github.com/mojombo/tpw/tree/master/_posts/2008-11-17-blogging-like-a-hacker.textile.
@@ -145,6 +145,17 @@ Default port is 4000:
145
145
 
146
146
  $ jekyll --server [PORT]
147
147
 
148
+ By default, the permalink for each post begins with its date in 'YYYY/MM/DD'
149
+ format. If you do not wish to have the date appear in the URL of each post,
150
+ you can change the permalink style to 'none' so that only the 'slug' part of
151
+ the filename is used. For example, with the permalink style set to 'none' the
152
+ file '2009-01-01-happy-new-year.markdown' will have a permalink like
153
+ 'http://yoursite.com/happy-new-year.html'. The date of the post will still be
154
+ read from the filename (and is required!) to be used elsewhere in Jekyll.
155
+ Example usage:
156
+
157
+ $ jekyll --permalink none
158
+
148
159
  h2. Data
149
160
 
150
161
  Jekyll traverses your site looking for files to process. Any files with YAML
@@ -286,6 +297,16 @@ becomes
286
297
 
287
298
  1337
288
299
 
300
+ h3. Array to Sentence String
301
+
302
+ Convert an array into a sentence.
303
+
304
+ {{ page.tags | array_to_sentence_string }}
305
+
306
+ becomes
307
+
308
+ foo, bar, and baz
309
+
289
310
  h3. Include (Tag)
290
311
 
291
312
  If you have small page fragments that you wish to include in multiple places
@@ -321,17 +342,33 @@ The argument to <code>highlight</code> is the language identifier. To find the
321
342
  appropriate identifier to use for your favorite language, look for the "short
322
343
  name" on the "Lexers":http://pygments.org/docs/lexers/ page.
323
344
 
345
+ There is a second argument to <code>highlight</code> called
346
+ <code>linenos</code> that is optional. Including the <code>linenos</code>
347
+ argument will force the highlighted code to include line numbers. For
348
+ instance, the following code block would include line numbers next to each
349
+ line:
350
+
351
+ <pre>
352
+ {% highlight ruby linenos %}
353
+ def foo
354
+ puts 'foo'
355
+ end
356
+ {% endhighlight %}
357
+ </pre>
358
+
324
359
  In order for the highlighting to show up, you'll need to include a
325
360
  highlighting stylesheet. For an example stylesheet you can look at
326
361
  "syntax.css":http://github.com/mojombo/tpw/tree/master/css/syntax.css. These
327
362
  are the same styles as used by GitHub and you are free to use them for your
328
- own site.
363
+ own site. If you use linenos, you might want to include an additional CSS
364
+ class definition for <code>lineno</code> in syntax.css to distinguish the line
365
+ numbers from the highlighted code.
329
366
 
330
367
  h2. Categories
331
368
 
332
- Posts are placed into categories based on the directory structure they are found
333
- within (see above for an example). The categories can be accessed from within
334
- a Liquid template as follows:
369
+ Posts are placed into categories based on the directory structure they are
370
+ found within (see above for an example). The categories can be accessed from
371
+ within a Liquid template as follows:
335
372
 
336
373
  <pre>
337
374
  {% for post in site.categories.foo %}
@@ -343,24 +380,6 @@ This would list all the posts in the category 'foo' by date and title.
343
380
 
344
381
  The posts within each category are sorted in reverse chronological order.
345
382
 
346
- h2. Contribute
347
-
348
- If you'd like to hack on Jekyll, grab the source from GitHub. To get
349
- all of the dependencies, install the gem first.
350
-
351
- $ git clone git://github.com/mojombo/jekyll
352
-
353
- The best way to get your changes merged back into core is as follows:
354
-
355
- # Fork mojombo/jekyll on GitHub
356
- # Clone down your fork
357
- # Create a topic branch to contain your change
358
- # Hack away
359
- # Do not change the version number, I will do that on my end
360
- # If necessary, rebase your commits into logical chunks, without errors
361
- # Push the branch up to GitHub
362
- # Send me (mojombo) a pull request for your branch
363
-
364
383
  h2. Blog migrations
365
384
 
366
385
  h3. Movable Type
@@ -379,6 +398,57 @@ You may need to adjust the SQL query used to retrieve MT entries. Left alone,
379
398
  it will attempt to pull all entries across all blogs regardless of status.
380
399
  Please check the results and verify the posts before publishing.
381
400
 
401
+ h3. Typo 4+
402
+
403
+ To migrate your Typo blog into Jekyll, you'll need read access to the MySQL
404
+ database. The lib/jekyll/converters/typo.rb module provides a simple convert
405
+ to create .html, .textile, or .markdown files in a _posts directory based on
406
+ the entries contained therein.
407
+
408
+ $ export DB=my_typo_db
409
+ $ export USER=dbuser
410
+ $ export PASS=dbpass
411
+ $ ruby -r './lib/jekyll/converters/typo' -e 'Jekyll::Typo.process( \
412
+ "#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")'
413
+
414
+ You may need to adjust the code used to filter Typo entries. Left alone,
415
+ it will attempt to pull all entries across all blogs that were published.
416
+ This code also has only been tested with Typo version 4+. Previous versions
417
+ of Typo may not convert correctly. Please check the results and verify the
418
+ posts before publishing.
419
+
420
+ h3. TextPattern 4
421
+
422
+ To migrate your TextPattern blog into Jekyll, you'll need read access to the MySQL
423
+ database. The lib/jekyll/converters/textpattern.rb module provides a simple convert to create .textile files in a _posts directory based on
424
+ the entries contained therein.
425
+
426
+ $ ruby -r './lib/jekyll/converters/textpattern' -e 'Jekyll::TextPattern.process( \
427
+ "database_name", "username", "password", "hostname")'
428
+
429
+ The hostname defaults to _localhost_, all other variables are needed
430
+ You may need to adjust the code used to filter entries. Left alone,
431
+ it will attempt to pull all entries that are live or sticky.
432
+
433
+ h2. Contribute
434
+
435
+ If you'd like to hack on Jekyll, start by forking my repo on GitHub:
436
+
437
+ http://github.com/mojombo/jekyll
438
+
439
+ To get all of the dependencies, install the gem first. The best way to get
440
+ your changes merged back into core is as follows:
441
+
442
+ # Clone down your fork
443
+ # Create a topic branch to contain your change
444
+ # Hack away
445
+ # Add tests and make sure everything still passes by running `rake`
446
+ # If you are adding new functionality, document it in README.textile
447
+ # Do not change the version number, I will do that on my end
448
+ # If necessary, rebase your commits into logical chunks, without errors
449
+ # Push the branch up to GitHub
450
+ # Send me (mojombo) a pull request for your branch
451
+
382
452
  h2. License
383
453
 
384
454
  (The MIT License)
@@ -0,0 +1,4 @@
1
+ ---
2
+ :minor: 4
3
+ :patch: 0
4
+ :major: 0
data/bin/jekyll CHANGED
@@ -47,6 +47,11 @@ opts = OptionParser.new do |opts|
47
47
  puts 'You must have the rdiscount gem installed first'
48
48
  end
49
49
  end
50
+
51
+ opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
52
+ Jekyll.permalink_style = (style || 'date').to_sym
53
+ end
54
+
50
55
  end
51
56
 
52
57
  opts.parse!
@@ -46,12 +46,13 @@ module Jekyll
46
46
  VERSION = '0.3.0'
47
47
 
48
48
  class << self
49
- attr_accessor :source, :dest, :lsi, :pygments, :markdown_proc
49
+ attr_accessor :source, :dest, :lsi, :pygments, :markdown_proc, :content_type, :permalink_style
50
50
  end
51
51
 
52
52
  Jekyll.lsi = false
53
53
  Jekyll.pygments = false
54
54
  Jekyll.markdown_proc = Proc.new { |x| Maruku.new(x).to_html }
55
+ Jekyll.permalink_style = :date
55
56
 
56
57
  def self.process(source, dest)
57
58
  require 'classifier' if Jekyll.lsi
@@ -1,7 +1,19 @@
1
+ # Quickly hacked together my Michael Ivey
2
+ # Based on mt.rb by Nick Gerakines, open source and publically
3
+ # available under the MIT license. Use this module at your own risk.
4
+
1
5
  require 'rubygems'
6
+ require 'sequel'
2
7
  require 'fastercsv'
3
8
  require 'fileutils'
4
9
  require File.join(File.dirname(__FILE__),"csv.rb")
10
+
11
+ # NOTE: This converter requires Sequel and the MySQL gems.
12
+ # The MySQL gem can be difficult to install on OS X. Once you have MySQL
13
+ # installed, running the following commands should work:
14
+ # $ sudo gem install sequel
15
+ # $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
16
+
5
17
  module Jekyll
6
18
  module Mephisto
7
19
  #Accepts a hash with database config variables, exports mephisto posts into a csv
@@ -20,5 +32,48 @@ module Jekyll
20
32
  `#{command}`
21
33
  CSV.process
22
34
  end
35
+
36
+ # This query will pull blog posts from all entries across all blogs. If
37
+ # you've got unpublished, deleted or otherwise hidden posts please sift
38
+ # through the created posts to make sure nothing is accidently published.
39
+
40
+ QUERY = "SELECT id, permalink, body, published_at, title FROM contents WHERE user_id = 1 AND type = 'Article' AND published_at IS NOT NULL ORDER BY published_at"
41
+
42
+ def self.process(dbname, user, pass, host = 'localhost')
43
+ db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
44
+
45
+ FileUtils.mkdir_p "_posts"
46
+
47
+ db[QUERY].each do |post|
48
+ title = post[:title]
49
+ slug = post[:permalink]
50
+ date = post[:published_at]
51
+ content = post[:body]
52
+ # more_content = ''
53
+
54
+ # Be sure to include the body and extended body.
55
+ # if more_content != nil
56
+ # content = content + " \n" + more_content
57
+ # end
58
+
59
+ # Ideally, this script would determine the post format (markdown, html
60
+ # , etc) and create files with proper extensions. At this point it
61
+ # just assumes that markdown will be acceptable.
62
+ name = [date.year, date.month, date.day, slug].join('-') + ".markdown"
63
+
64
+ data = {
65
+ 'layout' => 'post',
66
+ 'title' => title.to_s,
67
+ 'mt_id' => post[:entry_id],
68
+ }.delete_if { |k,v| v.nil? || v == ''}.to_yaml
69
+
70
+ File.open("_posts/#{name}", "w") do |f|
71
+ f.puts data
72
+ f.puts "---"
73
+ f.puts content
74
+ end
75
+ end
76
+
77
+ end
23
78
  end
24
- end
79
+ end
@@ -33,7 +33,7 @@ module Jekyll
33
33
 
34
34
  # Be sure to include the body and extended body.
35
35
  if more_content != nil
36
- conent = content + " \n" + more_content
36
+ content = content + " \n" + more_content
37
37
  end
38
38
 
39
39
  # Ideally, this script would determine the post format (markdown, html
@@ -0,0 +1,50 @@
1
+ require 'rubygems'
2
+ require 'sequel'
3
+ require 'fileutils'
4
+
5
+ # NOTE: This converter requires Sequel and the MySQL gems.
6
+ # The MySQL gem can be difficult to install on OS X. Once you have MySQL
7
+ # installed, running the following commands should work:
8
+ # $ sudo gem install sequel
9
+ # $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
10
+
11
+ module Jekyll
12
+ module TextPattern
13
+ # Reads a MySQL database via Sequel and creates a post file for each post.
14
+ # The only posts selected are those with a status of 4 or 5, which means "live"
15
+ # and "sticky" respectively.
16
+ # Other statuses is 1 => draft, 2 => hidden and 3 => pending
17
+ QUERY = "select Title, url_title, Posted, Body, Keywords from textpattern where Status = '4' or Status = '5'"
18
+
19
+ def self.process(dbname, user, pass, host = 'localhost')
20
+ db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
21
+
22
+ FileUtils.mkdir_p "_posts"
23
+
24
+ db[QUERY].each do |post|
25
+ # Get required fields and construct Jekyll compatible name
26
+ title = post[:Title]
27
+ slug = post[:url_title]
28
+ date = post[:Posted]
29
+ content = post[:Body]
30
+
31
+ name = [date.strftime("%Y-%m-%d"), slug].join('-') + ".textile"
32
+
33
+ # Get the relevant fields as a hash, delete empty fields and convert
34
+ # to YAML for the header
35
+ data = {
36
+ 'layout' => 'post',
37
+ 'title' => title.to_s,
38
+ 'tags' => post[:Keywords].split(',')
39
+ }.delete_if { |k,v| v.nil? || v == ''}.to_yaml
40
+
41
+ # Write out the data and content to file
42
+ File.open("_posts/#{name}", "w") do |f|
43
+ f.puts data
44
+ f.puts "---"
45
+ f.puts content
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,49 @@
1
+ # Author: Toby DiPasquale <toby@cbcg.net>
2
+ require 'fileutils'
3
+ require 'rubygems'
4
+ require 'sequel'
5
+
6
+ module Jekyll
7
+ module Typo
8
+ # this SQL *should* work for both MySQL and PostgreSQL, but I haven't
9
+ # tested PostgreSQL yet (as of 2008-12-16)
10
+ SQL = <<-EOS
11
+ SELECT c.id id,
12
+ c.title title,
13
+ c.permalink slug,
14
+ c.body body,
15
+ c.published_at date,
16
+ c.state state,
17
+ COALESCE(tf.name, 'html') filter
18
+ FROM contents c
19
+ LEFT OUTER JOIN text_filters tf
20
+ ON c.text_filter_id = tf.id
21
+ EOS
22
+
23
+ def self.process dbname, user, pass, host='localhost'
24
+ FileUtils.mkdir_p '_posts'
25
+ db = Sequel.mysql dbname, :user => user, :password => pass, :host => host
26
+ db[SQL].each do |post|
27
+ next unless post[:state] =~ /Published/
28
+
29
+ name = [ sprintf("%.04d", post[:date].year),
30
+ sprintf("%.02d", post[:date].month),
31
+ sprintf("%.02d", post[:date].day),
32
+ post[:slug].strip ].join('-')
33
+ # Can have more than one text filter in this field, but we just want
34
+ # the first one for this
35
+ name += '.' + post[:filter].split(' ')[0]
36
+
37
+ File.open("_posts/#{name}", 'w') do |f|
38
+ f.puts({ 'layout' => 'post',
39
+ 'title' => post[:title].to_s,
40
+ 'typo_id' => post[:id]
41
+ }.delete_if { |k, v| v.nil? || v == '' }.to_yaml)
42
+ f.puts '---'
43
+ f.puts post[:body].delete("\r")
44
+ end
45
+ end
46
+ end
47
+
48
+ end # module Typo
49
+ end # module Jekyll
@@ -24,16 +24,26 @@ module Jekyll
24
24
  #
25
25
  # Returns nothing
26
26
  def transform
27
- case self.ext
28
- when ".textile":
27
+ case Jekyll.content_type
28
+ when :textile
29
29
  self.ext = ".html"
30
30
  self.content = RedCloth.new(self.content).to_html
31
- when ".markdown":
31
+ when :markdown
32
32
  self.ext = ".html"
33
33
  self.content = Jekyll.markdown_proc.call(self.content)
34
34
  end
35
35
  end
36
36
 
37
+ def determine_content_type
38
+ case self.ext[1..-1]
39
+ when /textile/i
40
+ return :textile
41
+ when /markdown/i, /mkdn/i, /md/i
42
+ return :markdown
43
+ end
44
+ return :unknown
45
+ end
46
+
37
47
  # Add any necessary layouts to this convertible document
38
48
  # +layouts+ is a Hash of {"name" => "layout"}
39
49
  # +site_payload+ is the site payload hash
@@ -41,6 +51,7 @@ module Jekyll
41
51
  # Returns nothing
42
52
  def do_layout(payload, layouts)
43
53
  # render and transform content (this becomes the final content of the object)
54
+ Jekyll.content_type = self.determine_content_type
44
55
  self.content = Liquid::Template.parse(self.content).render(payload, [Jekyll::Filters])
45
56
  self.transform
46
57
 
@@ -14,11 +14,26 @@ module Jekyll
14
14
  end
15
15
 
16
16
  def xml_escape(input)
17
- input.gsub("<", "&lt;").gsub(">", "&gt;")
17
+ input.gsub("&", "&amp;").gsub("<", "&lt;").gsub(">", "&gt;")
18
18
  end
19
19
 
20
20
  def number_of_words(input)
21
21
  input.split.length
22
- end
22
+ end
23
+
24
+ def array_to_sentence_string(array)
25
+ connector = "and"
26
+ case array.length
27
+ when 0
28
+ ""
29
+ when 1
30
+ array[0].to_s
31
+ when 2
32
+ "#{array[0]} #{connector} #{array[1]}"
33
+ else
34
+ "#{array[0...-1].join(', ')}, #{connector} #{array[-1]}"
35
+ end
36
+ end
37
+
23
38
  end
24
- end
39
+ end
@@ -61,15 +61,19 @@ module Jekyll
61
61
  # The generated directory into which the post will be placed
62
62
  # upon generation. This is derived from the permalink or, if
63
63
  # permalink is absent, set to the default date
64
- # e.g. "/2008/11/05/"
64
+ # e.g. "/2008/11/05/" if the permalink style is :date, otherwise nothing
65
65
  #
66
66
  # Returns <String>
67
67
  def dir
68
68
  if permalink
69
- permalink.to_s.split("/")[0..-2].join("/")
69
+ permalink.to_s.split("/")[0..-2].join("/") + '/'
70
70
  else
71
71
  prefix = self.categories.empty? ? '' : '/' + self.categories.join('/')
72
- prefix + date.strftime("/%Y/%m/%d/")
72
+ if Jekyll.permalink_style == :date
73
+ prefix + date.strftime("/%Y/%m/%d/")
74
+ else
75
+ prefix + '/'
76
+ end
73
77
  end
74
78
  end
75
79
 
@@ -87,7 +91,7 @@ module Jekyll
87
91
  #
88
92
  # Returns <String>
89
93
  def url
90
- self.dir + self.slug + ".html"
94
+ permalink || self.dir + self.slug + ".html"
91
95
  end
92
96
 
93
97
  # The UID for this post (useful in feeds)
@@ -154,7 +158,7 @@ module Jekyll
154
158
  #
155
159
  # Returns <Hash>
156
160
  def to_liquid
157
- { "title" => self.data["title"] || "",
161
+ { "title" => self.data["title"] || self.slug.split('-').select {|w| w.capitalize! || w }.join(' '),
158
162
  "url" => self.url,
159
163
  "date" => self.date,
160
164
  "id" => self.id,
@@ -2,7 +2,7 @@ module Jekyll
2
2
 
3
3
  class Site
4
4
  attr_accessor :source, :dest
5
- attr_accessor :layouts, :posts
5
+ attr_accessor :layouts, :posts, :categories
6
6
 
7
7
  # Initialize the site
8
8
  # +source+ is String path to the source directory containing
@@ -16,6 +16,7 @@ module Jekyll
16
16
  self.dest = dest
17
17
  self.layouts = {}
18
18
  self.posts = []
19
+ self.categories = Hash.new { |hash, key| hash[key] = Array.new }
19
20
  end
20
21
 
21
22
  # Do the actual work of processing the site and generating the
@@ -63,6 +64,7 @@ module Jekyll
63
64
  if Post.valid?(f)
64
65
  post = Post.new(self.source, dir, f)
65
66
  self.posts << post
67
+ post.categories.each { |c| self.categories[c] << post }
66
68
  end
67
69
  end
68
70
 
@@ -72,6 +74,7 @@ module Jekyll
72
74
  end
73
75
 
74
76
  self.posts.sort!
77
+ self.categories.values.map { |cats| cats.sort! { |a, b| b <=> a} }
75
78
  rescue Errno::ENOENT => e
76
79
  # ignore missing layout dir
77
80
  end
@@ -88,7 +91,8 @@ module Jekyll
88
91
  # Copy all regular files from <source> to <dest>/ ignoring
89
92
  # any files/directories that are hidden or backup files (start
90
93
  # with "." or end with "~") or contain site content (start with "_")
91
- # unless they are "_posts" directories
94
+ # unless they are "_posts" directories or web server files such as
95
+ # '.htaccess'
92
96
  # The +dir+ String is a relative path used to call this method
93
97
  # recursively as it descends through directories
94
98
  #
@@ -98,8 +102,10 @@ module Jekyll
98
102
  entries = Dir.entries(base)
99
103
  entries = entries.reject { |e| e[-1..-1] == '~' }
100
104
  entries = entries.reject do |e|
101
- (e != '_posts') and ['.', '_'].include?(e[0..0])
105
+ (e != '_posts') and ['.', '_'].include?(e[0..0]) unless ['.htaccess'].include?(e)
102
106
  end
107
+ directories = entries.select { |e| File.directory?(File.join(base, e)) }
108
+ files = entries.reject { |e| File.directory?(File.join(base, e)) }
103
109
 
104
110
  # we need to make sure to process _posts *first* otherwise they
105
111
  # might not be available yet to other templates as {{ site.posts }}
@@ -107,42 +113,53 @@ module Jekyll
107
113
  entries.delete('_posts')
108
114
  read_posts(dir)
109
115
  end
110
-
111
- entries.each do |f|
112
- if File.directory?(File.join(base, f))
113
- next if self.dest.sub(/\/$/, '') == File.join(base, f)
114
- transform_pages(File.join(dir, f))
115
- else
116
- first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
117
-
118
- if first3 == "---"
119
- # file appears to have a YAML header so process it as a page
120
- page = Page.new(self.source, dir, f)
121
- page.render(self.layouts, site_payload)
122
- page.write(self.dest)
116
+ [directories, files].each do |entries|
117
+ entries.each do |f|
118
+ if File.directory?(File.join(base, f))
119
+ next if self.dest.sub(/\/$/, '') == File.join(base, f)
120
+ transform_pages(File.join(dir, f))
123
121
  else
124
- # otherwise copy the file without transforming it
125
- FileUtils.mkdir_p(File.join(self.dest, dir))
126
- FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))
122
+ first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
123
+
124
+ if first3 == "---"
125
+ # file appears to have a YAML header so process it as a page
126
+ page = Page.new(self.source, dir, f)
127
+ page.render(self.layouts, site_payload)
128
+ page.write(self.dest)
129
+ else
130
+ # otherwise copy the file without transforming it
131
+ FileUtils.mkdir_p(File.join(self.dest, dir))
132
+ FileUtils.cp(File.join(self.source, dir, f), File.join(self.dest, dir, f))
133
+ end
127
134
  end
128
135
  end
129
136
  end
130
137
  end
131
-
138
+
139
+ # Constructs a hash map of Posts indexed by the specified Post attribute
140
+ #
141
+ # Returns {post_attr => [<Post>]}
142
+ def post_attr_hash(post_attr)
143
+ # Build a hash map based on the specified post attribute ( post attr => array of posts )
144
+ # then sort each array in reverse order
145
+ hash = Hash.new { |hash, key| hash[key] = Array.new }
146
+ self.posts.each { |p| p.send(post_attr.to_sym).each { |t| hash[t] << p } }
147
+ hash.values.map { |sortme| sortme.sort! { |a, b| b <=> a} }
148
+ return hash
149
+ end
150
+
132
151
  # The Hash payload containing site-wide data
133
152
  #
134
- # Returns {"site" => {"time" => <Time>, "posts" => [<Post>]}}
153
+ # Returns {"site" => {"time" => <Time>,
154
+ # "posts" => [<Post>],
155
+ # "categories" => [<Post>],
156
+ # "topics" => [<Post>] }}
135
157
  def site_payload
136
- # Build the category hash map of category ( names => arrays of posts )
137
- # then sort each array in reverse order
138
- categories = Hash.new { |hash, key| hash[key] = Array.new }
139
- self.posts.each { |p| p.categories.each { |c| categories[c] << p } }
140
- categories.values.map { |cats| cats.sort! { |a, b| b <=> a} }
141
-
142
158
  {"site" => {
143
159
  "time" => Time.now,
144
160
  "posts" => self.posts.sort { |a,b| b <=> a },
145
- "categories" => categories
161
+ "categories" => post_attr_hash('categories'),
162
+ "topics" => post_attr_hash('topics')
146
163
  }}
147
164
  end
148
165
  end
@@ -2,10 +2,22 @@ module Jekyll
2
2
 
3
3
  class HighlightBlock < Liquid::Block
4
4
  include Liquid::StandardFilters
5
+ # we need a language, but the linenos argument is optional.
6
+ SYNTAX = /(\w+)\s?(:?linenos)?\s?/
5
7
 
6
- def initialize(tag_name, lang, tokens)
8
+ def initialize(tag_name, markup, tokens)
7
9
  super
8
- @lang = lang.strip
10
+ if markup =~ SYNTAX
11
+ @lang = $1
12
+ if defined? $2
13
+ # additional options to pass to Albino.
14
+ @options = { 'O' => 'linenos=inline' }
15
+ else
16
+ @options = {}
17
+ end
18
+ else
19
+ raise SyntaxError.new("Syntax Error in 'highlight' - Valid syntax: highlight <lang> [linenos]")
20
+ end
9
21
  end
10
22
 
11
23
  def render(context)
@@ -17,7 +29,11 @@ module Jekyll
17
29
  end
18
30
 
19
31
  def render_pygments(context, code)
20
- "<notextile>" + Albino.new(code, @lang).to_s + "</notextile>"
32
+ if Jekyll.content_type == :markdown
33
+ return "\n" + Albino.new(code, @lang).to_s(@options) + "\n"
34
+ else
35
+ "<notextile>" + Albino.new(code, @lang).to_s(@options) + "</notextile>"
36
+ end
21
37
  end
22
38
 
23
39
  def render_codehighlighter(context, code)
@@ -34,4 +50,4 @@ module Jekyll
34
50
 
35
51
  end
36
52
 
37
- Liquid::Template.register_tag('highlight', Jekyll::HighlightBlock)
53
+ Liquid::Template.register_tag('highlight', Jekyll::HighlightBlock)
@@ -14,7 +14,11 @@ module Jekyll
14
14
  Dir.chdir(File.join(Jekyll.source, '_includes')) do
15
15
  choices = Dir['**/*'].reject { |x| File.symlink?(x) }
16
16
  if choices.include?(@file)
17
- File.read(@file)
17
+ source = File.read(@file)
18
+ partial = Liquid::Template.parse(source)
19
+ context.stack do
20
+ partial.render(context)
21
+ end
18
22
  else
19
23
  "Included file '#{@file}' not found in _includes directory"
20
24
  end
@@ -24,4 +28,4 @@ module Jekyll
24
28
 
25
29
  end
26
30
 
27
- Liquid::Template.register_tag('include', Jekyll::IncludeTag)
31
+ Liquid::Template.register_tag('include', Jekyll::IncludeTag)
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: default
3
+ title: Categories
4
+ ---
5
+
6
+ Categories _should_ work
@@ -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,6 @@
1
+ ---
2
+ layout: default
3
+ title: Categories
4
+ ---
5
+
6
+ Categories _should_ work. Even if ordered after index.
@@ -0,0 +1,37 @@
1
+ require File.dirname(__FILE__) + '/helper'
2
+
3
+ class TestFilters < Test::Unit::TestCase
4
+
5
+ class JekyllFilter
6
+ include Jekyll::Filters
7
+ end
8
+
9
+ def setup
10
+ @filter = JekyllFilter.new
11
+ end
12
+
13
+ def test_array_to_sentence_string_with_no_args
14
+ assert_equal "", @filter.array_to_sentence_string([])
15
+ end
16
+
17
+ def test_array_to_sentence_string_with_one_arg
18
+ assert_equal "1", @filter.array_to_sentence_string([1])
19
+ assert_equal "chunky", @filter.array_to_sentence_string(["chunky"])
20
+ end
21
+
22
+ def test_array_to_sentence_string_with_two_args
23
+ assert_equal "1 and 2", @filter.array_to_sentence_string([1, 2])
24
+ assert_equal "chunky and bacon", @filter.array_to_sentence_string(["chunky", "bacon"])
25
+ end
26
+
27
+ def test_array_to_sentence_string_with_multiple_args
28
+ assert_equal "1, 2, 3, and 4", @filter.array_to_sentence_string([1, 2, 3, 4])
29
+ assert_equal "chunky, bacon, bits, and pieces", @filter.array_to_sentence_string(["chunky", "bacon", "bits", "pieces"])
30
+ end
31
+
32
+ def test_xml_escape_with_ampersands
33
+ assert_equal "AT&amp;T", @filter.xml_escape("AT&T")
34
+ assert_equal "&lt;code&gt;command &amp;lt;filename&amp;gt;&lt;/code&gt;", @filter.xml_escape("<code>command &lt;filename&gt;</code>")
35
+ end
36
+
37
+ end
@@ -11,6 +11,7 @@ class TestGeneratedSite < Test::Unit::TestCase
11
11
 
12
12
  def test_site_posts_in_index
13
13
  # confirm that {{ site.posts }} is working
14
+ puts @s.posts.size
14
15
  assert @index.include?("#{@s.posts.size} Posts")
15
16
  end
16
17
 
@@ -43,7 +43,15 @@ class TestPost < Test::Unit::TestCase
43
43
  p.process("2008-12-03-permalinked-post.textile")
44
44
  p.read_yaml(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-12-03-permalinked-post.textile")
45
45
 
46
- assert_equal "my_category", p.dir
46
+ assert_equal "my_category/", p.dir
47
+ end
48
+
49
+ def test_url_respects_permalink
50
+ p = Post.allocate
51
+ p.process("2008-12-03-permalinked-post.textile")
52
+ p.read_yaml(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-12-03-permalinked-post.textile")
53
+
54
+ assert_equal "my_category/permalinked-post", p.url
47
55
  end
48
56
 
49
57
  def test_read_yaml
@@ -88,6 +96,12 @@ class TestPost < Test::Unit::TestCase
88
96
  assert_equal "<<< <p>url: /2008/11/21/complex.html<br />\ndate: #{Time.parse("2008-11-21")}<br />\nid: /2008/11/21/complex</p> >>>", p.output
89
97
  end
90
98
 
99
+ def test_categories_and_topics
100
+ p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), 'foo', 'bar/2008-12-12-topical-post.textile')
101
+ assert_equal ['foo'], p.categories
102
+ assert_equal ['bar'], p.topics
103
+ end
104
+
91
105
  def test_include
92
106
  Jekyll.source = File.join(File.dirname(__FILE__), *%w[source])
93
107
  p = Post.new(File.join(File.dirname(__FILE__), *%w[source]), '', "2008-12-13-include.markdown")
@@ -22,9 +22,12 @@ class TestSite < Test::Unit::TestCase
22
22
  assert_equal 4, @s.posts.size
23
23
  end
24
24
 
25
- def test_write_posts
25
+ def test_site_payload
26
26
  clear_dest
27
-
28
27
  @s.process
28
+
29
+ assert_equal 7, @s.posts.length
30
+ assert_equal ["category", "foo", "z_category"].sort, @s.categories.keys.sort
31
+ assert_equal 1, @s.categories['foo'].length
29
32
  end
30
33
  end
@@ -0,0 +1,31 @@
1
+ require File.dirname(__FILE__) + '/helper'
2
+
3
+ class TestTags < Test::Unit::TestCase
4
+
5
+ def setup
6
+ @content = <<CONTENT
7
+ ---
8
+ layout: post
9
+ title: This is a test
10
+
11
+ ---
12
+ This document results in a markdown error with maruku
13
+ {% highlight ruby %}
14
+ puts "hi"
15
+
16
+ puts "bye"
17
+ {% endhighlight %}
18
+
19
+ CONTENT
20
+ end
21
+
22
+ def test_markdown_with_pygments_line_handling
23
+ Jekyll.pygments = true
24
+ Jekyll.content_type = :markdown
25
+
26
+ result = Liquid::Template.parse(@content).render({}, [Jekyll::Filters])
27
+ result = Jekyll.markdown_proc.call(result)
28
+ assert_no_match(/markdown\-html\-error/,result)
29
+ end
30
+
31
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mojombo-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,8 +9,8 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-24 00:00:00 -08:00
13
- default_executable: jekyll
12
+ date: 2009-02-03 00:00:00 -08:00
13
+ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: RedCloth
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: "0"
22
+ version: 4.0.4
23
23
  version:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: liquid
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: "0"
31
+ version: 1.9.0
32
32
  version:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: classifier
@@ -37,7 +37,7 @@ dependencies:
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: "0"
40
+ version: 1.3.1
41
41
  version:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: maruku
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: "0"
49
+ version: 0.5.9
50
50
  version:
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: directory_watcher
@@ -55,7 +55,7 @@ dependencies:
55
55
  requirements:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
- version: "0"
58
+ version: 1.1.1
59
59
  version:
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: open4
@@ -64,39 +64,29 @@ dependencies:
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: "0"
67
+ version: 0.9.6
68
68
  version:
69
- - !ruby/object:Gem::Dependency
70
- name: hoe
71
- version_requirement:
72
- version_requirements: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: 1.8.0
77
- version:
78
- description:
79
- email:
80
- - tom@mojombo.com
81
- executables:
82
- - jekyll
69
+ description: Jekyll is a simple, blog aware, static site generator.
70
+ email: tom@mojombo.com
71
+ executables: []
72
+
83
73
  extensions: []
84
74
 
85
- extra_rdoc_files:
86
- - History.txt
87
- - Manifest.txt
75
+ extra_rdoc_files: []
76
+
88
77
  files:
89
78
  - History.txt
90
- - Manifest.txt
91
79
  - README.textile
92
- - Rakefile
80
+ - VERSION.yml
93
81
  - bin/jekyll
94
- - jekyll.gemspec
95
- - lib/jekyll.rb
82
+ - lib/jekyll
96
83
  - lib/jekyll/albino.rb
84
+ - lib/jekyll/converters
97
85
  - lib/jekyll/converters/csv.rb
98
86
  - lib/jekyll/converters/mephisto.rb
99
87
  - lib/jekyll/converters/mt.rb
88
+ - lib/jekyll/converters/textpattern.rb
89
+ - lib/jekyll/converters/typo.rb
100
90
  - lib/jekyll/converters/wordpress.rb
101
91
  - lib/jekyll/convertible.rb
102
92
  - lib/jekyll/core_ext.rb
@@ -105,29 +95,91 @@ files:
105
95
  - lib/jekyll/page.rb
106
96
  - lib/jekyll/post.rb
107
97
  - lib/jekyll/site.rb
98
+ - lib/jekyll/tags
108
99
  - lib/jekyll/tags/highlight.rb
109
100
  - lib/jekyll/tags/include.rb
101
+ - lib/jekyll.rb
102
+ - test/dest
103
+ - test/dest/2008
104
+ - test/dest/2008/10
105
+ - test/dest/2008/10/18
106
+ - test/dest/2008/10/18/foo-bar.html
107
+ - test/dest/2008/11
108
+ - test/dest/2008/11/21
109
+ - test/dest/2008/11/21/complex.html
110
+ - test/dest/2008/12
111
+ - test/dest/2008/12/13
112
+ - test/dest/2008/12/13/include.html
113
+ - test/dest/_posts
114
+ - test/dest/_posts/2008-10-18-foo-bar.html
115
+ - test/dest/_posts/2008-11-21-complex.html
116
+ - test/dest/_posts/2008-12-03-permalinked-post.html
117
+ - test/dest/_posts/2008-12-13-include.html
118
+ - test/dest/category
119
+ - test/dest/category/2008
120
+ - test/dest/category/2008/09
121
+ - test/dest/category/2008/09/23
122
+ - test/dest/category/2008/09/23/categories.html
123
+ - test/dest/category/_posts
124
+ - test/dest/category/_posts/2008-9-23-categories.html
125
+ - test/dest/css
126
+ - test/dest/css/screen.css
127
+ - test/dest/foo
128
+ - test/dest/foo/2008
129
+ - test/dest/foo/2008/12
130
+ - test/dest/foo/2008/12/12
131
+ - test/dest/foo/2008/12/12/topical-post.html
132
+ - test/dest/foo/_posts
133
+ - test/dest/foo/_posts/bar
134
+ - test/dest/foo/_posts/bar/2008-12-12-topical-post.html
135
+ - test/dest/index.html
136
+ - test/dest/my_category
137
+ - test/dest/my_category/permalinked-post
138
+ - test/dest/z_category
139
+ - test/dest/z_category/2008
140
+ - test/dest/z_category/2008/09
141
+ - test/dest/z_category/2008/09/23
142
+ - test/dest/z_category/2008/09/23/categories.html
143
+ - test/dest/z_category/_posts
144
+ - test/dest/z_category/_posts/2008-9-23-categories.html
110
145
  - test/helper.rb
146
+ - test/source
147
+ - test/source/_includes
111
148
  - test/source/_includes/sig.markdown
149
+ - test/source/_layouts
112
150
  - test/source/_layouts/default.html
113
151
  - test/source/_layouts/simple.html
152
+ - test/source/_posts
114
153
  - test/source/_posts/2008-10-18-foo-bar.textile
115
154
  - test/source/_posts/2008-11-21-complex.textile
116
155
  - test/source/_posts/2008-12-03-permalinked-post.textile
117
156
  - test/source/_posts/2008-12-13-include.markdown
157
+ - test/source/category
158
+ - test/source/category/_posts
159
+ - test/source/category/_posts/2008-9-23-categories.textile
160
+ - test/source/css
118
161
  - test/source/css/screen.css
162
+ - test/source/foo
163
+ - test/source/foo/_posts
164
+ - test/source/foo/_posts/bar
165
+ - test/source/foo/_posts/bar/2008-12-12-topical-post.textile
119
166
  - test/source/index.html
167
+ - test/source/z_category
168
+ - test/source/z_category/_posts
169
+ - test/source/z_category/_posts/2008-9-23-categories.textile
120
170
  - test/suite.rb
171
+ - test/test_filters.rb
121
172
  - test/test_generated_site.rb
122
173
  - test/test_jekyll.rb
123
174
  - test/test_post.rb
124
175
  - test/test_site.rb
176
+ - test/test_tags.rb
125
177
  has_rdoc: true
126
- homepage:
178
+ homepage: http://github.com/mojombo/jekyll
127
179
  post_install_message:
128
180
  rdoc_options:
129
- - --main
130
- - README.txt
181
+ - --inline-source
182
+ - --charset=UTF-8
131
183
  require_paths:
132
184
  - lib
133
185
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -149,8 +201,5 @@ rubygems_version: 1.2.0
149
201
  signing_key:
150
202
  specification_version: 2
151
203
  summary: Jekyll is a simple, blog aware, static site generator.
152
- test_files:
153
- - test/test_generated_site.rb
154
- - test/test_jekyll.rb
155
- - test/test_post.rb
156
- - test/test_site.rb
204
+ test_files: []
205
+
@@ -1,36 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.textile
4
- Rakefile
5
- bin/jekyll
6
- jekyll.gemspec
7
- lib/jekyll.rb
8
- lib/jekyll/albino.rb
9
- lib/jekyll/converters/csv.rb
10
- lib/jekyll/converters/mephisto.rb
11
- lib/jekyll/converters/mt.rb
12
- lib/jekyll/converters/wordpress.rb
13
- lib/jekyll/convertible.rb
14
- lib/jekyll/core_ext.rb
15
- lib/jekyll/filters.rb
16
- lib/jekyll/layout.rb
17
- lib/jekyll/page.rb
18
- lib/jekyll/post.rb
19
- lib/jekyll/site.rb
20
- lib/jekyll/tags/highlight.rb
21
- lib/jekyll/tags/include.rb
22
- test/helper.rb
23
- test/source/_includes/sig.markdown
24
- test/source/_layouts/default.html
25
- test/source/_layouts/simple.html
26
- test/source/_posts/2008-10-18-foo-bar.textile
27
- test/source/_posts/2008-11-21-complex.textile
28
- test/source/_posts/2008-12-03-permalinked-post.textile
29
- test/source/_posts/2008-12-13-include.markdown
30
- test/source/css/screen.css
31
- test/source/index.html
32
- test/suite.rb
33
- test/test_generated_site.rb
34
- test/test_jekyll.rb
35
- test/test_post.rb
36
- test/test_site.rb
data/Rakefile DELETED
@@ -1,24 +0,0 @@
1
- require 'rubygems'
2
- require 'hoe'
3
- require 'lib/jekyll'
4
-
5
- Hoe.new('jekyll', Jekyll::VERSION) do |p|
6
- p.developer('Tom Preston-Werner', 'tom@mojombo.com')
7
- p.summary = "Jekyll is a simple, blog aware, static site generator."
8
- p.extra_deps = ['RedCloth', 'liquid', 'classifier', 'maruku', 'directory_watcher', 'open4']
9
- end
10
-
11
- desc "Open an irb session preloaded with this library"
12
- task :console do
13
- sh "irb -rubygems -r ./lib/jekyll.rb"
14
- end
15
-
16
- namespace :convert do
17
- desc "Migrate from mephisto in the current directory"
18
- task :mephisto do
19
- sh %q(ruby -r './lib/jekyll/converters/mephisto' -e 'Jekyll::Mephisto.postgres(:database => "#{ENV["DB"]}")')
20
- end
21
- task :mt do
22
- sh %q(ruby -r './lib/jekyll/converters/mt' -e 'Jekyll::MT.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
23
- end
24
- end
@@ -1,51 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = %q{jekyll}
3
- s.version = "0.3.0"
4
-
5
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
- s.authors = ["Tom Preston-Werner"]
7
- s.date = %q{2008-12-24}
8
- s.default_executable = %q{jekyll}
9
- s.email = ["tom@mojombo.com"]
10
- s.executables = ["jekyll"]
11
- s.extra_rdoc_files = ["History.txt", "Manifest.txt"]
12
- s.files = ["History.txt", "Manifest.txt", "README.textile", "Rakefile", "bin/jekyll", "jekyll.gemspec", "lib/jekyll.rb", "lib/jekyll/albino.rb", "lib/jekyll/converters/csv.rb", "lib/jekyll/converters/mephisto.rb", "lib/jekyll/converters/mt.rb", "lib/jekyll/converters/wordpress.rb", "lib/jekyll/convertible.rb", "lib/jekyll/core_ext.rb", "lib/jekyll/filters.rb", "lib/jekyll/layout.rb", "lib/jekyll/page.rb", "lib/jekyll/post.rb", "lib/jekyll/site.rb", "lib/jekyll/tags/highlight.rb", "lib/jekyll/tags/include.rb", "test/helper.rb", "test/source/_includes/sig.markdown", "test/source/_layouts/default.html", "test/source/_layouts/simple.html", "test/source/_posts/2008-10-18-foo-bar.textile", "test/source/_posts/2008-11-21-complex.textile", "test/source/_posts/2008-12-03-permalinked-post.textile", "test/source/_posts/2008-12-13-include.markdown", "test/source/css/screen.css", "test/source/index.html", "test/suite.rb", "test/test_generated_site.rb", "test/test_jekyll.rb", "test/test_post.rb", "test/test_site.rb"]
13
- s.has_rdoc = true
14
- s.rdoc_options = ["--main", "README.txt"]
15
- s.require_paths = ["lib"]
16
- s.rubyforge_project = %q{jekyll}
17
- s.rubygems_version = %q{1.3.0}
18
- s.summary = %q{Jekyll is a simple, blog aware, static site generator.}
19
- s.test_files = ["test/test_generated_site.rb", "test/test_jekyll.rb", "test/test_post.rb", "test/test_site.rb"]
20
-
21
- if s.respond_to? :specification_version then
22
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
- s.specification_version = 2
24
-
25
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
27
- s.add_runtime_dependency(%q<liquid>, [">= 0"])
28
- s.add_runtime_dependency(%q<classifier>, [">= 0"])
29
- s.add_runtime_dependency(%q<maruku>, [">= 0"])
30
- s.add_runtime_dependency(%q<directory_watcher>, [">= 0"])
31
- s.add_runtime_dependency(%q<open4>, [">= 0"])
32
- s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
33
- else
34
- s.add_dependency(%q<RedCloth>, [">= 0"])
35
- s.add_dependency(%q<liquid>, [">= 0"])
36
- s.add_dependency(%q<classifier>, [">= 0"])
37
- s.add_dependency(%q<maruku>, [">= 0"])
38
- s.add_dependency(%q<directory_watcher>, [">= 0"])
39
- s.add_dependency(%q<open4>, [">= 0"])
40
- s.add_dependency(%q<hoe>, [">= 1.8.0"])
41
- end
42
- else
43
- s.add_dependency(%q<RedCloth>, [">= 0"])
44
- s.add_dependency(%q<liquid>, [">= 0"])
45
- s.add_dependency(%q<classifier>, [">= 0"])
46
- s.add_dependency(%q<maruku>, [">= 0"])
47
- s.add_dependency(%q<directory_watcher>, [">= 0"])
48
- s.add_dependency(%q<open4>, [">= 0"])
49
- s.add_dependency(%q<hoe>, [">= 1.8.0"])
50
- end
51
- end