jekyll 0.5.7 → 0.6.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.

Files changed (48) hide show
  1. data/History.txt +88 -31
  2. data/LICENSE +21 -0
  3. data/README.textile +1 -9
  4. data/Rakefile +119 -51
  5. data/bin/jekyll +26 -2
  6. data/cucumber.yml +1 -0
  7. data/features/create_sites.feature +28 -10
  8. data/features/post_data.feature +7 -7
  9. data/features/site_configuration.feature +41 -1
  10. data/features/step_definitions/jekyll_steps.rb +13 -4
  11. data/jekyll.gemspec +125 -143
  12. data/lib/jekyll.rb +40 -20
  13. data/lib/jekyll/albino.rb +5 -7
  14. data/lib/jekyll/converter.rb +50 -0
  15. data/lib/jekyll/converters/identity.rb +22 -0
  16. data/lib/jekyll/converters/markdown.rb +77 -0
  17. data/lib/jekyll/converters/textile.rb +33 -0
  18. data/lib/jekyll/convertible.rb +18 -24
  19. data/lib/jekyll/errors.rb +6 -0
  20. data/lib/jekyll/generator.rb +7 -0
  21. data/lib/jekyll/generators/pagination.rb +87 -0
  22. data/lib/jekyll/{converters → migrators}/csv.rb +0 -0
  23. data/lib/jekyll/{converters → migrators}/mephisto.rb +0 -0
  24. data/lib/jekyll/{converters → migrators}/mt.rb +0 -0
  25. data/lib/jekyll/{converters → migrators}/textpattern.rb +0 -0
  26. data/lib/jekyll/{converters → migrators}/typo.rb +0 -0
  27. data/lib/jekyll/{converters → migrators}/wordpress.rb +1 -0
  28. data/lib/jekyll/page.rb +28 -11
  29. data/lib/jekyll/plugin.rb +76 -0
  30. data/lib/jekyll/post.rb +10 -8
  31. data/lib/jekyll/site.rb +40 -88
  32. data/lib/jekyll/static_file.rb +52 -4
  33. data/lib/jekyll/tags/highlight.rb +20 -9
  34. data/test/helper.rb +6 -0
  35. data/test/source/_posts/2010-01-09-date-override.textile +2 -0
  36. data/test/source/_posts/2010-01-09-time-override.textile +2 -0
  37. data/test/source/_posts/2010-01-09-timezone-override.textile +7 -0
  38. data/test/source/_posts/2010-01-16-override-data.textile +4 -0
  39. data/test/source/sitemap.xml +27 -18
  40. data/test/test_configuration.rb +1 -1
  41. data/test/test_generated_site.rb +1 -1
  42. data/test/test_post.rb +63 -12
  43. data/test/test_site.rb +69 -7
  44. data/test/test_tags.rb +6 -14
  45. metadata +156 -52
  46. data/.gitignore +0 -6
  47. data/VERSION.yml +0 -5
  48. data/lib/jekyll/pager.rb +0 -45
@@ -1,3 +1,29 @@
1
+ == 0.6.0
2
+ * Major Enhancements
3
+ * Proper plugin system (#19, #100)
4
+ * Add safe mode so unsafe converters/generators can be added
5
+ * Maruku is now the only processor dependency installed by default.
6
+ Other processors will be lazy-loaded when necessary (and prompt the
7
+ user to install them when necessary) (#57)
8
+ * Minor Enhancements
9
+ * Inclusion/exclusion of future dated posts (#59)
10
+ * Generation for a specific time (#59)
11
+ * Allocate site.time on render not per site_payload invocation (#59)
12
+ * Pages now present in the site payload and can be used through the
13
+ site.pages and site.html_pages variables
14
+ * Generate phase added to site#process and pagination is now a generator
15
+ * Switch to RakeGem for build/test process
16
+ * Only regenerate static files when they have changed (#142)
17
+ * Allow arbitrary options to Pygments (#31)
18
+ * Allow URL to be set via command line option (#147)
19
+ * Bug Fixes
20
+ * Render highlighted code for non markdown/textile pages (#116)
21
+ * Fix highlighting on Ruby 1.9 (#65)
22
+ * Fix extension munging when pretty permalinks are enabled (#64)
23
+ * Stop sorting categories (#33)
24
+ * Preserve generated attributes over front matter (#119)
25
+ * Fix source directory binding using Dir.pwd (#75)
26
+
1
27
  == 0.5.7 / 2010-01-12
2
28
  * Minor Enhancements
3
29
  * Allow overriding of post date in the front matter (#62, #38)
@@ -6,7 +32,8 @@
6
32
  * Empty tags causes error in read_posts (#84)
7
33
  * Fix pagination to adhere to read/render/write paradigm
8
34
  * Test Enhancement
9
- * cucumber features no longer use site.ports.first where a better alternative is available
35
+ * cucumber features no longer use site.ports.first where a better
36
+ alternative is available
10
37
 
11
38
  == 0.5.6 / 2010-01-08
12
39
  * Bug Fixes
@@ -33,57 +60,78 @@
33
60
 
34
61
  == 0.5.3 / 2009-07-14
35
62
  * Bug Fixes
36
- * Solving the permalink bug where non-html files wouldn't work [github.com/jeffrydegrande]
63
+ * Solving the permalink bug where non-html files wouldn't work
64
+ [github.com/jeffrydegrande]
37
65
 
38
66
  == 0.5.2 / 2009-06-24
39
67
  * Enhancements
40
- * Added --paginate option to the executable along with a paginator object for the payload [github.com/calavera]
41
- * Upgraded RedCloth to 4.2.1, which makes <notextile> tags work once again.
42
- * Configuration options set in config.yml are now available through the site payload [github.com/vilcans]
43
- * Posts can now have an empty YAML front matter or none at all [github.com/bahuvrihi]
68
+ * Added --paginate option to the executable along with a paginator object
69
+ for the payload [github.com/calavera]
70
+ * Upgraded RedCloth to 4.2.1, which makes <notextile> tags work once
71
+ again.
72
+ * Configuration options set in config.yml are now available through the
73
+ site payload [github.com/vilcans]
74
+ * Posts can now have an empty YAML front matter or none at all
75
+ [github.com/bahuvrihi]
44
76
  * Bug Fixes
45
- * Fixing Ruby 1.9 issue that requires to_s on the err object [github.com/Chrononaut]
77
+ * Fixing Ruby 1.9 issue that requires to_s on the err object
78
+ [github.com/Chrononaut]
46
79
  * Fixes for pagination and ordering posts on the same day [github.com/ujh]
47
- * Made pages respect permalinks style and permalinks in yml front matter [github.com/eugenebolshakov]
48
- * Index.html file should always have index.html permalink [github.com/eugenebolshakov]
49
- * Added trailing slash to pretty permalink style so Apache is happy [github.com/eugenebolshakov]
50
- * Bad markdown processor in config fails sooner and with better message [github.com/gcnovus]
80
+ * Made pages respect permalinks style and permalinks in yml front matter
81
+ [github.com/eugenebolshakov]
82
+ * Index.html file should always have index.html permalink
83
+ [github.com/eugenebolshakov]
84
+ * Added trailing slash to pretty permalink style so Apache is happy
85
+ [github.com/eugenebolshakov]
86
+ * Bad markdown processor in config fails sooner and with better message
87
+ [github.com/gcnovus]
51
88
  * Allow CRLFs in yaml frontmatter [github.com/juretta]
52
89
  * Added Date#xmlschema for Ruby versions < 1.9
53
90
 
54
91
  == 0.5.1 / 2009-05-06
55
92
  * Major Enhancements
56
- * Next/previous posts in site payload [github.com/pantulis, github.com/tomo]
93
+ * Next/previous posts in site payload [github.com/pantulis,
94
+ github.com/tomo]
57
95
  * Permalink templating system
58
96
  * Moved most of the README out to the GitHub wiki
59
- * Exclude option in configuration so specified files won't be brought over with generated site [github.com/duritong]
97
+ * Exclude option in configuration so specified files won't be brought over
98
+ with generated site [github.com/duritong]
60
99
  * Bug Fixes
61
100
  * Making sure config.yaml references are all gone, using only config.yml
62
101
  * Fixed syntax highlighting breaking for UTF-8 code [github.com/henrik]
63
- * Worked around RDiscount bug that prevents Markdown from getting parsed after highlight [github.com/henrik]
102
+ * Worked around RDiscount bug that prevents Markdown from getting parsed
103
+ after highlight [github.com/henrik]
64
104
  * CGI escaped post titles [github.com/Chrononaut]
65
105
 
66
106
  == 0.5.0 / 2009-04-07
67
107
  * Minor Enhancements
68
108
  * Ability to set post categories via YAML [github.com/qrush]
69
- * Ability to set prevent a post from publishing via YAML [github.com/qrush]
109
+ * Ability to set prevent a post from publishing via YAML
110
+ [github.com/qrush]
70
111
  * Add textilize filter [github.com/willcodeforfoo]
71
- * Add 'pretty' permalink style for wordpress-like urls [github.com/dysinger]
72
- * Made it possible to enter categories from YAML as an array [github.com/Chrononaut]
112
+ * Add 'pretty' permalink style for wordpress-like urls
113
+ [github.com/dysinger]
114
+ * Made it possible to enter categories from YAML as an array
115
+ [github.com/Chrononaut]
73
116
  * Ignore Emacs autosave files [github.com/Chrononaut]
74
117
  * Bug Fixes
75
- * Use block syntax of popen4 to ensure that subprocesses are properly disposed [github.com/jqr]
118
+ * Use block syntax of popen4 to ensure that subprocesses are properly
119
+ disposed [github.com/jqr]
76
120
  * Close open4 streams to prevent zombies [github.com/rtomayko]
77
121
  * Only query required fields from the WP Database [github.com/ariejan]
78
- * Prevent _posts from being copied to the destination directory [github.com/bdimcheff]
122
+ * Prevent _posts from being copied to the destination directory
123
+ [github.com/bdimcheff]
79
124
  * Refactors
80
125
  * Factored the filtering code into a method [github.com/Chrononaut]
81
- * Fix tests and convert to Shoulda [github.com/qrush, github.com/technicalpickles]
82
- * Add Cucumber acceptance test suite [github.com/qrush, github.com/technicalpickles]
126
+ * Fix tests and convert to Shoulda [github.com/qrush,
127
+ github.com/technicalpickles]
128
+ * Add Cucumber acceptance test suite [github.com/qrush,
129
+ github.com/technicalpickles]
83
130
 
84
131
  == 0.4.1
85
132
  * Minor Enhancements
86
- * Changed date format on wordpress converter (zeropadding) [github.com/dysinger]
133
+ * Changed date format on wordpress converter (zeropadding)
134
+ [github.com/dysinger]
87
135
  * Bug Fixes
88
136
  * Add jekyll binary as executable to gemspec [github.com/dysinger]
89
137
 
@@ -96,28 +144,35 @@
96
144
  * Add array_to_sentence_string filter [github.com/mchung]
97
145
  * Add a converter for textpattern [github.com/PerfectlyNormal]
98
146
  * Add a working Mephisto / MySQL converter [github.com/ivey]
99
- * Allowing .htaccess files to be copied over into the generated site [github.com/briandoll]
147
+ * Allowing .htaccess files to be copied over into the generated site
148
+ [github.com/briandoll]
100
149
  * Add option to not put file date in permalink URL [github.com/mreid]
101
150
  * Add line number capabilities to highlight blocks [github.com/jcon]
102
151
  * Bug Fixes
103
152
  * Fix permalink behavior [github.com/cavalle]
104
- * Fixed an issue with pygments, markdown, and newlines [github.com/zpinter]
153
+ * Fixed an issue with pygments, markdown, and newlines
154
+ [github.com/zpinter]
105
155
  * Ampersands need to be escaped [github.com/pufuwozu, github.com/ap]
106
156
  * Test and fix the site.categories hash [github.com/zzot]
107
157
  * Fix site payload available to files [github.com/matrix9180]
108
158
 
109
159
  == 0.3.0 / 2008-12-24
110
160
  * Major Enhancements
111
- * Added --server option to start a simple WEBrick server on destination directory [github.com/johnreilly and github.com/mchung]
161
+ * Added --server option to start a simple WEBrick server on destination
162
+ directory [github.com/johnreilly and github.com/mchung]
112
163
  * Minor Enhancements
113
- * Added post categories based on directories containing _posts [github.com/mreid]
164
+ * Added post categories based on directories containing _posts
165
+ [github.com/mreid]
114
166
  * Added post topics based on directories underneath _posts
115
167
  * Added new date filter that shows the full month name [github.com/mreid]
116
- * Merge Post's YAML front matter into its to_liquid payload [github.com/remi]
168
+ * Merge Post's YAML front matter into its to_liquid payload
169
+ [github.com/remi]
117
170
  * Restrict includes to regular files underneath _includes
118
171
  * Bug Fixes
119
- * Change YAML delimiter matcher so as to not chew up 2nd level markdown headers [github.com/mreid]
120
- * Fix bug that meant page data (such as the date) was not available in templates [github.com/mreid]
172
+ * Change YAML delimiter matcher so as to not chew up 2nd level markdown
173
+ headers [github.com/mreid]
174
+ * Fix bug that meant page data (such as the date) was not available in
175
+ templates [github.com/mreid]
121
176
  * Properly reject directories in _layouts
122
177
 
123
178
  == 0.2.1 / 2008-12-15
@@ -140,9 +195,11 @@
140
195
  * Code highlighting with Pygments if --pygments is specified
141
196
  * Disable true LSI by default, enable with --lsi
142
197
  * Minor Enhancements
143
- * Output informative message if RDiscount is not available [github.com/JackDanger]
198
+ * Output informative message if RDiscount is not available
199
+ [github.com/JackDanger]
144
200
  * Bug Fixes
145
- * Prevent Jekyll from picking up the output directory as a source [github.com/JackDanger]
201
+ * Prevent Jekyll from picking up the output directory as a source
202
+ [github.com/JackDanger]
146
203
  * Skip related_posts when there is only one post [github.com/JackDanger]
147
204
 
148
205
  == 0.1.4 / 2008-12-08
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2008 Tom Preston-Werner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the 'Software'), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -38,12 +38,4 @@ h2. Developer Dependencies
38
38
 
39
39
  h2. License
40
40
 
41
- (The MIT License)
42
-
43
- Copyright (c) 2008 Tom Preston-Werner
44
-
45
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
46
-
47
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
48
-
49
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
+ See LICENSE.
data/Rakefile CHANGED
@@ -1,85 +1,101 @@
1
+ require 'rubygems'
1
2
  require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'date'
4
4
 
5
- begin
6
- gem 'jeweler', '>= 0.11.0'
7
- require 'jeweler'
8
- Jeweler::Tasks.new do |s|
9
- s.name = "jekyll"
10
- s.summary = %Q{Jekyll is a simple, blog aware, static site generator.}
11
- s.email = "tom@mojombo.com"
12
- s.homepage = "http://github.com/mojombo/jekyll"
13
- s.description = "Jekyll is a simple, blog aware, static site generator."
14
- s.authors = ["Tom Preston-Werner"]
15
- s.rubyforge_project = "jekyll"
16
- s.files.exclude 'test/dest'
17
- s.test_files.exclude 'test/dest'
18
- s.add_dependency('RedCloth', '>= 4.2.1')
19
- s.add_dependency('liquid', '>= 1.9.0')
20
- s.add_dependency('classifier', '>= 1.3.1')
21
- s.add_dependency('maruku', '>= 0.5.9')
22
- s.add_dependency('directory_watcher', '>= 1.1.1')
23
- s.add_dependency('open4', '>= 0.9.6')
24
- end
25
- rescue LoadError
26
- puts "Jeweler not available. Install it with: sudo gem install jeweler --version '>= 0.11.0'"
27
- exit(1)
5
+ #############################################################################
6
+ #
7
+ # Helper functions
8
+ #
9
+ #############################################################################
10
+
11
+ def name
12
+ @name ||= Dir['*.gemspec'].first.split('.').first
28
13
  end
29
14
 
30
- Rake::TestTask.new do |t|
31
- t.libs << 'lib'
32
- t.pattern = 'test/**/test_*.rb'
33
- t.verbose = false
15
+ def version
16
+ line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
17
+ line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
34
18
  end
35
19
 
36
- Rake::RDocTask.new do |rdoc|
37
- rdoc.rdoc_dir = 'rdoc'
38
- rdoc.title = 'jekyll'
39
- rdoc.options << '--line-numbers' << '--inline-source'
40
- rdoc.rdoc_files.include('README*')
41
- rdoc.rdoc_files.include('lib/**/*.rb')
20
+ def date
21
+ Date.today.to_s
42
22
  end
43
23
 
44
- begin
45
- require 'rcov/rcovtask'
46
- Rcov::RcovTask.new do |t|
47
- t.libs << 'test'
48
- t.test_files = FileList['test/**/test_*.rb']
49
- t.verbose = true
50
- end
51
- rescue LoadError
24
+ def rubyforge_project
25
+ name
26
+ end
27
+
28
+ def gemspec_file
29
+ "#{name}.gemspec"
30
+ end
31
+
32
+ def gem_file
33
+ "#{name}-#{version}.gem"
34
+ end
35
+
36
+ def replace_header(head, header_name)
37
+ head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
52
38
  end
53
39
 
40
+ #############################################################################
41
+ #
42
+ # Standard tasks
43
+ #
44
+ #############################################################################
45
+
54
46
  task :default => [:test, :features]
55
47
 
56
- # console
48
+ require 'rake/testtask'
49
+ Rake::TestTask.new(:test) do |test|
50
+ test.libs << 'lib' << 'test'
51
+ test.pattern = 'test/**/test_*.rb'
52
+ test.verbose = true
53
+ end
54
+
55
+ desc "Generate RCov test coverage and open in your browser"
56
+ task :coverage do
57
+ require 'rcov'
58
+ sh "rm -fr coverage"
59
+ sh "rcov test/test_*.rb"
60
+ sh "open coverage/index.html"
61
+ end
62
+
63
+ require 'rake/rdoctask'
64
+ Rake::RDocTask.new do |rdoc|
65
+ rdoc.rdoc_dir = 'rdoc'
66
+ rdoc.title = "#{name} #{version}"
67
+ rdoc.rdoc_files.include('README*')
68
+ rdoc.rdoc_files.include('lib/**/*.rb')
69
+ end
57
70
 
58
71
  desc "Open an irb session preloaded with this library"
59
72
  task :console do
60
- sh "irb -rubygems -I lib -r jekyll.rb"
73
+ sh "irb -rubygems -r ./lib/#{name}.rb"
61
74
  end
62
75
 
63
- # converters
76
+ #############################################################################
77
+ #
78
+ # Custom tasks (add your own tasks here)
79
+ #
80
+ #############################################################################
64
81
 
65
- namespace :convert do
82
+ namespace :migrate do
66
83
  desc "Migrate from mephisto in the current directory"
67
84
  task :mephisto do
68
- sh %q(ruby -r './lib/jekyll/converters/mephisto' -e 'Jekyll::Mephisto.postgres(:database => "#{ENV["DB"]}")')
85
+ sh %q(ruby -r './lib/jekyll/migrators/mephisto' -e 'Jekyll::Mephisto.postgres(:database => "#{ENV["DB"]}")')
69
86
  end
70
87
  desc "Migrate from Movable Type in the current directory"
71
88
  task :mt do
72
- sh %q(ruby -r './lib/jekyll/converters/mt' -e 'Jekyll::MT.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
89
+ sh %q(ruby -r './lib/jekyll/migrators/mt' -e 'Jekyll::MT.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
73
90
  end
74
91
  desc "Migrate from Typo in the current directory"
75
92
  task :typo do
76
- sh %q(ruby -r './lib/jekyll/converters/typo' -e 'Jekyll::Typo.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
93
+ sh %q(ruby -r './lib/jekyll/migrators/typo' -e 'Jekyll::Typo.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
77
94
  end
78
95
  end
79
96
 
80
97
  begin
81
98
  require 'cucumber/rake/task'
82
-
83
99
  Cucumber::Rake::Task.new(:features) do |t|
84
100
  t.cucumber_opts = "--format progress"
85
101
  end
@@ -89,3 +105,55 @@ rescue LoadError
89
105
  abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
90
106
  end
91
107
  end
108
+
109
+ #############################################################################
110
+ #
111
+ # Packaging tasks
112
+ #
113
+ #############################################################################
114
+
115
+ task :release => :build do
116
+ unless `git branch` =~ /^\* master$/
117
+ puts "You must be on the master branch to release!"
118
+ exit!
119
+ end
120
+ sh "git commit --allow-empty -a -m 'Release #{version}'"
121
+ sh "git tag v#{version}"
122
+ sh "git push origin master"
123
+ sh "git push v#{version}"
124
+ sh "gem push pkg/#{name}-#{version}.gem"
125
+ end
126
+
127
+ task :build => :gemspec do
128
+ sh "mkdir -p pkg"
129
+ sh "gem build #{gemspec_file}"
130
+ sh "mv #{gem_file} pkg"
131
+ end
132
+
133
+ task :gemspec do
134
+ # read spec file and split out manifest section
135
+ spec = File.read(gemspec_file)
136
+ head, manifest, tail = spec.split(" # = MANIFEST =\n")
137
+
138
+ # replace name version and date
139
+ replace_header(head, :name)
140
+ replace_header(head, :version)
141
+ replace_header(head, :date)
142
+ #comment this out if your rubyforge_project has a different name
143
+ replace_header(head, :rubyforge_project)
144
+
145
+ # determine file list from git ls-files
146
+ files = `git ls-files`.
147
+ split("\n").
148
+ sort.
149
+ reject { |file| file =~ /^\./ }.
150
+ reject { |file| file =~ /^(rdoc|pkg|coverage)/ }.
151
+ map { |file| " #{file}" }.
152
+ join("\n")
153
+
154
+ # piece file back together and write
155
+ manifest = " s.files = %w[\n#{files}\n ]\n"
156
+ spec = [head, manifest, tail].join(" # = MANIFEST =\n")
157
+ File.open(gemspec_file, 'w') { |io| io.write(spec) }
158
+ puts "Updated #{gemspec_file}"
159
+ end
data/bin/jekyll CHANGED
@@ -23,6 +23,10 @@ options = {}
23
23
  opts = OptionParser.new do |opts|
24
24
  opts.banner = help
25
25
 
26
+ opts.on("--safe", "Safe mode (default unsafe)") do
27
+ options['safe'] = true
28
+ end
29
+
26
30
  opts.on("--auto", "Auto-regenerate") do
27
31
  options['auto'] = true
28
32
  end
@@ -48,6 +52,18 @@ opts = OptionParser.new do |opts|
48
52
  options['markdown'] = 'rdiscount'
49
53
  end
50
54
 
55
+ opts.on("--time [TIME]", "Time to generate the site for") do |time|
56
+ options['time'] = Time.parse(time)
57
+ end
58
+
59
+ opts.on("--future", "Render future dated posts") do
60
+ options['future'] = true
61
+ end
62
+
63
+ opts.on("--no-future", "Do not render future dated posts") do
64
+ options['future'] = false
65
+ end
66
+
51
67
  opts.on("--permalink [TYPE]", "Use 'date' (default) for YYYY/MM/DD") do |style|
52
68
  options['permalink'] = style unless style.nil?
53
69
  end
@@ -62,8 +78,12 @@ opts = OptionParser.new do |opts|
62
78
  end
63
79
  end
64
80
 
81
+ opts.on("--url [URL]", "Set custom site.url") do |url|
82
+ options['url'] = url
83
+ end
84
+
65
85
  opts.on("--version", "Display current version") do
66
- puts "Jekyll " + Jekyll.version
86
+ puts "Jekyll " + Jekyll::VERSION
67
87
  exit 0
68
88
  end
69
89
  end
@@ -126,7 +146,11 @@ if options['auto']
126
146
  end
127
147
  else
128
148
  puts "Building site: #{source} -> #{destination}"
129
- site.process
149
+ begin
150
+ site.process
151
+ rescue Jekyll::FatalException
152
+ exit(1)
153
+ end
130
154
  puts "Successfully generated site: #{source} -> #{destination}"
131
155
  end
132
156