fagiani-jekyll 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/History.txt +284 -0
  2. data/LICENSE +21 -0
  3. data/README.textile +41 -0
  4. data/Rakefile +159 -0
  5. data/bin/jekyll +192 -0
  6. data/cucumber.yml +1 -0
  7. data/features/create_sites.feature +94 -0
  8. data/features/embed_filters.feature +60 -0
  9. data/features/markdown.feature +30 -0
  10. data/features/pagination.feature +27 -0
  11. data/features/permalinks.feature +65 -0
  12. data/features/post_data.feature +153 -0
  13. data/features/site_configuration.feature +126 -0
  14. data/features/site_data.feature +82 -0
  15. data/features/step_definitions/jekyll_steps.rb +145 -0
  16. data/features/support/env.rb +16 -0
  17. data/jekyll.gemspec +140 -0
  18. data/lib/jekyll.rb +125 -0
  19. data/lib/jekyll/albino.rb +120 -0
  20. data/lib/jekyll/converter.rb +50 -0
  21. data/lib/jekyll/converters/identity.rb +22 -0
  22. data/lib/jekyll/converters/markdown.rb +113 -0
  23. data/lib/jekyll/converters/textile.rb +33 -0
  24. data/lib/jekyll/convertible.rb +98 -0
  25. data/lib/jekyll/core_ext.rb +52 -0
  26. data/lib/jekyll/errors.rb +6 -0
  27. data/lib/jekyll/filters.rb +53 -0
  28. data/lib/jekyll/generator.rb +7 -0
  29. data/lib/jekyll/generators/pagination.rb +87 -0
  30. data/lib/jekyll/layout.rb +36 -0
  31. data/lib/jekyll/migrators/csv.rb +26 -0
  32. data/lib/jekyll/migrators/drupal.rb +86 -0
  33. data/lib/jekyll/migrators/marley.rb +53 -0
  34. data/lib/jekyll/migrators/mephisto.rb +79 -0
  35. data/lib/jekyll/migrators/mt.rb +77 -0
  36. data/lib/jekyll/migrators/textpattern.rb +50 -0
  37. data/lib/jekyll/migrators/typo.rb +49 -0
  38. data/lib/jekyll/migrators/wordpress.com.rb +38 -0
  39. data/lib/jekyll/migrators/wordpress.rb +56 -0
  40. data/lib/jekyll/page.rb +134 -0
  41. data/lib/jekyll/plugin.rb +76 -0
  42. data/lib/jekyll/post.rb +244 -0
  43. data/lib/jekyll/site.rb +273 -0
  44. data/lib/jekyll/static_file.rb +75 -0
  45. data/lib/jekyll/tags/highlight.rb +73 -0
  46. data/lib/jekyll/tags/include.rb +37 -0
  47. data/test/helper.rb +34 -0
  48. data/test/source/.htaccess +8 -0
  49. data/test/source/_includes/sig.markdown +3 -0
  50. data/test/source/_layouts/default.html +27 -0
  51. data/test/source/_layouts/simple.html +1 -0
  52. data/test/source/_posts/2008-02-02-not-published.textile +8 -0
  53. data/test/source/_posts/2008-02-02-published.textile +8 -0
  54. data/test/source/_posts/2008-10-18-foo-bar.textile +8 -0
  55. data/test/source/_posts/2008-11-21-complex.textile +8 -0
  56. data/test/source/_posts/2008-12-03-permalinked-post.textile +9 -0
  57. data/test/source/_posts/2008-12-13-include.markdown +8 -0
  58. data/test/source/_posts/2009-01-27-array-categories.textile +10 -0
  59. data/test/source/_posts/2009-01-27-categories.textile +7 -0
  60. data/test/source/_posts/2009-01-27-category.textile +7 -0
  61. data/test/source/_posts/2009-01-27-empty-categories.textile +7 -0
  62. data/test/source/_posts/2009-01-27-empty-category.textile +7 -0
  63. data/test/source/_posts/2009-03-12-hash-#1.markdown +6 -0
  64. data/test/source/_posts/2009-05-18-empty-tag.textile +6 -0
  65. data/test/source/_posts/2009-05-18-empty-tags.textile +6 -0
  66. data/test/source/_posts/2009-05-18-tag.textile +6 -0
  67. data/test/source/_posts/2009-05-18-tags.textile +9 -0
  68. data/test/source/_posts/2009-06-22-empty-yaml.textile +3 -0
  69. data/test/source/_posts/2009-06-22-no-yaml.textile +1 -0
  70. data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
  71. data/test/source/_posts/2010-01-09-date-override.textile +7 -0
  72. data/test/source/_posts/2010-01-09-time-override.textile +7 -0
  73. data/test/source/_posts/2010-01-09-timezone-override.textile +7 -0
  74. data/test/source/_posts/2010-01-16-override-data.textile +4 -0
  75. data/test/source/about.html +6 -0
  76. data/test/source/category/_posts/2008-9-23-categories.textile +6 -0
  77. data/test/source/contacts.html +5 -0
  78. data/test/source/css/screen.css +76 -0
  79. data/test/source/deal.with.dots.html +7 -0
  80. data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +8 -0
  81. data/test/source/index.html +22 -0
  82. data/test/source/sitemap.xml +32 -0
  83. data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +7 -0
  84. data/test/source/z_category/_posts/2008-9-23-categories.textile +6 -0
  85. data/test/suite.rb +9 -0
  86. data/test/test_configuration.rb +29 -0
  87. data/test/test_core_ext.rb +66 -0
  88. data/test/test_filters.rb +53 -0
  89. data/test/test_generated_site.rb +72 -0
  90. data/test/test_kramdown.rb +23 -0
  91. data/test/test_page.rb +117 -0
  92. data/test/test_pager.rb +113 -0
  93. data/test/test_post.rb +396 -0
  94. data/test/test_rdiscount.rb +18 -0
  95. data/test/test_site.rb +186 -0
  96. data/test/test_tags.rb +127 -0
  97. metadata +332 -0
@@ -0,0 +1,284 @@
1
+ == 0.10.1 / 2011-02-09
2
+ * Minor Enhancements
3
+ * Layouts get converted before parsed
4
+
5
+ == 0.10.0 / 2010-12-16
6
+ * Bug Fixes
7
+ * Add --no-server option.
8
+
9
+ == 0.9.0 / 2010-12-15
10
+ * Minor Enhancements
11
+ * Use OptionParser's [no-] functionality for better boolean parsing.
12
+ * Add Drupal migrator (#245)
13
+ * Complain about YAML and Liquid errors (#249)
14
+ * Remove orphaned files during regeneration (#247)
15
+ * Add Marley migrator (#28)
16
+
17
+ == 0.8.0 / 2010-11-22
18
+ * Minor Enhancements
19
+ * Add wordpress.com importer (#207)
20
+ * Add --limit-posts cli option (#212)
21
+ * Add uri_escape filter (#234)
22
+ * Add --base-url cli option (#235)
23
+ * Improve MT migrator (#238)
24
+ * Add kramdown support (#239)
25
+ * Bug Fixes
26
+ * Fixed filename basename generation (#208)
27
+ * Set mode to UTF8 on Sequel connections (#237)
28
+ * Prevent _includes dir from being a symlink
29
+
30
+ == 0.7.0 / 2010-08-24
31
+ * Minor Enhancements
32
+ * Add support for rdiscount extensions (#173)
33
+ * Bug Fixes
34
+ * Highlight should not be able to render local files
35
+ * The site configuration may not always provide a 'time' setting (#184)
36
+
37
+ == 0.6.2 / 2010-06-25
38
+ * Bug Fixes
39
+ * Fix Rakefile 'release' task (tag pushing was missing origin)
40
+ * Ensure that RedCloth is loaded when textilize filter is used (#183)
41
+ * Expand source, destination, and plugin paths (#180)
42
+ * Fix page.url to include full relative path (#181)
43
+
44
+ == 0.6.1 / 2010-06-24
45
+ * Bug Fixes
46
+ * Fix Markdown Pygments prefix and suffix (#178)
47
+
48
+ == 0.6.0 / 2010-06-23
49
+ * Major Enhancements
50
+ * Proper plugin system (#19, #100)
51
+ * Add safe mode so unsafe converters/generators can be added
52
+ * Maruku is now the only processor dependency installed by default.
53
+ Other processors will be lazy-loaded when necessary (and prompt the
54
+ user to install them when necessary) (#57)
55
+ * Minor Enhancements
56
+ * Inclusion/exclusion of future dated posts (#59)
57
+ * Generation for a specific time (#59)
58
+ * Allocate site.time on render not per site_payload invocation (#59)
59
+ * Pages now present in the site payload and can be used through the
60
+ site.pages and site.html_pages variables
61
+ * Generate phase added to site#process and pagination is now a generator
62
+ * Switch to RakeGem for build/test process
63
+ * Only regenerate static files when they have changed (#142)
64
+ * Allow arbitrary options to Pygments (#31)
65
+ * Allow URL to be set via command line option (#147)
66
+ * Bug Fixes
67
+ * Render highlighted code for non markdown/textile pages (#116)
68
+ * Fix highlighting on Ruby 1.9 (#65)
69
+ * Fix extension munging when pretty permalinks are enabled (#64)
70
+ * Stop sorting categories (#33)
71
+ * Preserve generated attributes over front matter (#119)
72
+ * Fix source directory binding using Dir.pwd (#75)
73
+
74
+ == 0.5.7 / 2010-01-12
75
+ * Minor Enhancements
76
+ * Allow overriding of post date in the front matter (#62, #38)
77
+ * Bug Fixes
78
+ * Categories isn't always an array (#73)
79
+ * Empty tags causes error in read_posts (#84)
80
+ * Fix pagination to adhere to read/render/write paradigm
81
+ * Test Enhancement
82
+ * cucumber features no longer use site.ports.first where a better
83
+ alternative is available
84
+
85
+ == 0.5.6 / 2010-01-08
86
+ * Bug Fixes
87
+ * Require redcloth >= 4.2.1 in tests (#92)
88
+ * Don't break on triple dashes in yaml frontmatter (#93)
89
+ * Minor Enhancements
90
+ * Allow .mkd as markdown extension
91
+ * Use $stdout/err instead of constants (#99)
92
+ * Properly wrap code blocks (#91)
93
+ * Add javascript mime type for webrick (#98)
94
+
95
+ == 0.5.5 / 2010-01-08
96
+ * Bug Fixes
97
+ * Fix pagination % 0 bug (#78)
98
+ * Ensure all posts are processed first (#71)
99
+
100
+ == NOTE
101
+ * After this point I will no longer be giving credit in the history;
102
+ that is what the commit log is for.
103
+
104
+ == 0.5.4 / 2009-08-23
105
+ * Bug Fixes
106
+ * Do not allow symlinks (security vulnerability)
107
+
108
+ == 0.5.3 / 2009-07-14
109
+ * Bug Fixes
110
+ * Solving the permalink bug where non-html files wouldn't work
111
+ [github.com/jeffrydegrande]
112
+
113
+ == 0.5.2 / 2009-06-24
114
+ * Enhancements
115
+ * Added --paginate option to the executable along with a paginator object
116
+ for the payload [github.com/calavera]
117
+ * Upgraded RedCloth to 4.2.1, which makes <notextile> tags work once
118
+ again.
119
+ * Configuration options set in config.yml are now available through the
120
+ site payload [github.com/vilcans]
121
+ * Posts can now have an empty YAML front matter or none at all
122
+ [github.com/bahuvrihi]
123
+ * Bug Fixes
124
+ * Fixing Ruby 1.9 issue that requires to_s on the err object
125
+ [github.com/Chrononaut]
126
+ * Fixes for pagination and ordering posts on the same day [github.com/ujh]
127
+ * Made pages respect permalinks style and permalinks in yml front matter
128
+ [github.com/eugenebolshakov]
129
+ * Index.html file should always have index.html permalink
130
+ [github.com/eugenebolshakov]
131
+ * Added trailing slash to pretty permalink style so Apache is happy
132
+ [github.com/eugenebolshakov]
133
+ * Bad markdown processor in config fails sooner and with better message
134
+ [github.com/gcnovus]
135
+ * Allow CRLFs in yaml frontmatter [github.com/juretta]
136
+ * Added Date#xmlschema for Ruby versions < 1.9
137
+
138
+ == 0.5.1 / 2009-05-06
139
+ * Major Enhancements
140
+ * Next/previous posts in site payload [github.com/pantulis,
141
+ github.com/tomo]
142
+ * Permalink templating system
143
+ * Moved most of the README out to the GitHub wiki
144
+ * Exclude option in configuration so specified files won't be brought over
145
+ with generated site [github.com/duritong]
146
+ * Bug Fixes
147
+ * Making sure config.yaml references are all gone, using only config.yml
148
+ * Fixed syntax highlighting breaking for UTF-8 code [github.com/henrik]
149
+ * Worked around RDiscount bug that prevents Markdown from getting parsed
150
+ after highlight [github.com/henrik]
151
+ * CGI escaped post titles [github.com/Chrononaut]
152
+
153
+ == 0.5.0 / 2009-04-07
154
+ * Minor Enhancements
155
+ * Ability to set post categories via YAML [github.com/qrush]
156
+ * Ability to set prevent a post from publishing via YAML
157
+ [github.com/qrush]
158
+ * Add textilize filter [github.com/willcodeforfoo]
159
+ * Add 'pretty' permalink style for wordpress-like urls
160
+ [github.com/dysinger]
161
+ * Made it possible to enter categories from YAML as an array
162
+ [github.com/Chrononaut]
163
+ * Ignore Emacs autosave files [github.com/Chrononaut]
164
+ * Bug Fixes
165
+ * Use block syntax of popen4 to ensure that subprocesses are properly
166
+ disposed [github.com/jqr]
167
+ * Close open4 streams to prevent zombies [github.com/rtomayko]
168
+ * Only query required fields from the WP Database [github.com/ariejan]
169
+ * Prevent _posts from being copied to the destination directory
170
+ [github.com/bdimcheff]
171
+ * Refactors
172
+ * Factored the filtering code into a method [github.com/Chrononaut]
173
+ * Fix tests and convert to Shoulda [github.com/qrush,
174
+ github.com/technicalpickles]
175
+ * Add Cucumber acceptance test suite [github.com/qrush,
176
+ github.com/technicalpickles]
177
+
178
+ == 0.4.1
179
+ * Minor Enhancements
180
+ * Changed date format on wordpress converter (zeropadding)
181
+ [github.com/dysinger]
182
+ * Bug Fixes
183
+ * Add jekyll binary as executable to gemspec [github.com/dysinger]
184
+
185
+ == 0.4.0 / 2009-02-03
186
+ * Major Enhancements
187
+ * Switch to Jeweler for packaging tasks
188
+ * Minor Enhancements
189
+ * Type importer [github.com/codeslinger]
190
+ * site.topics accessor [github.com/baz]
191
+ * Add array_to_sentence_string filter [github.com/mchung]
192
+ * Add a converter for textpattern [github.com/PerfectlyNormal]
193
+ * Add a working Mephisto / MySQL converter [github.com/ivey]
194
+ * Allowing .htaccess files to be copied over into the generated site
195
+ [github.com/briandoll]
196
+ * Add option to not put file date in permalink URL [github.com/mreid]
197
+ * Add line number capabilities to highlight blocks [github.com/jcon]
198
+ * Bug Fixes
199
+ * Fix permalink behavior [github.com/cavalle]
200
+ * Fixed an issue with pygments, markdown, and newlines
201
+ [github.com/zpinter]
202
+ * Ampersands need to be escaped [github.com/pufuwozu, github.com/ap]
203
+ * Test and fix the site.categories hash [github.com/zzot]
204
+ * Fix site payload available to files [github.com/matrix9180]
205
+
206
+ == 0.3.0 / 2008-12-24
207
+ * Major Enhancements
208
+ * Added --server option to start a simple WEBrick server on destination
209
+ directory [github.com/johnreilly and github.com/mchung]
210
+ * Minor Enhancements
211
+ * Added post categories based on directories containing _posts
212
+ [github.com/mreid]
213
+ * Added post topics based on directories underneath _posts
214
+ * Added new date filter that shows the full month name [github.com/mreid]
215
+ * Merge Post's YAML front matter into its to_liquid payload
216
+ [github.com/remi]
217
+ * Restrict includes to regular files underneath _includes
218
+ * Bug Fixes
219
+ * Change YAML delimiter matcher so as to not chew up 2nd level markdown
220
+ headers [github.com/mreid]
221
+ * Fix bug that meant page data (such as the date) was not available in
222
+ templates [github.com/mreid]
223
+ * Properly reject directories in _layouts
224
+
225
+ == 0.2.1 / 2008-12-15
226
+ * Major Changes
227
+ * Use Maruku (pure Ruby) for Markdown by default [github.com/mreid]
228
+ * Allow use of RDiscount with --rdiscount flag
229
+ * Minor Enhancements
230
+ * Don't load directory_watcher unless it's needed [github.com/pjhyett]
231
+
232
+ == 0.2.0 / 2008-12-14
233
+ * Major Changes
234
+ * related_posts is now found in site.related_posts
235
+
236
+ == 0.1.6 / 2008-12-13
237
+ * Major Features
238
+ * Include files in _includes with {% include x.textile %}
239
+
240
+ == 0.1.5 / 2008-12-12
241
+ * Major Features
242
+ * Code highlighting with Pygments if --pygments is specified
243
+ * Disable true LSI by default, enable with --lsi
244
+ * Minor Enhancements
245
+ * Output informative message if RDiscount is not available
246
+ [github.com/JackDanger]
247
+ * Bug Fixes
248
+ * Prevent Jekyll from picking up the output directory as a source
249
+ [github.com/JackDanger]
250
+ * Skip related_posts when there is only one post [github.com/JackDanger]
251
+
252
+ == 0.1.4 / 2008-12-08
253
+ * Bug Fixes
254
+ * DATA does not work properly with rubygems
255
+
256
+ == 0.1.3 / 2008-12-06
257
+ * Major Features
258
+ * Markdown support [github.com/vanpelt]
259
+ * Mephisto and CSV converters [github.com/vanpelt]
260
+ * Code hilighting [github.com/vanpelt]
261
+ * Autobuild
262
+ * Bug Fixes
263
+ * Accept both \r\n and \n in YAML header [github.com/vanpelt]
264
+
265
+ == 0.1.2 / 2008-11-22
266
+ * Major Features
267
+ * Add a real "related posts" implementation using Classifier
268
+ * Command Line Changes
269
+ * Allow cli to be called with 0, 1, or 2 args intuiting dir paths
270
+ if they are omitted
271
+
272
+ == 0.1.1 / 2008-11-22
273
+ * Minor Additions
274
+ * Posts now support introspectional data e.g. {{ page.url }}
275
+
276
+ == 0.1.0 / 2008-11-05
277
+ * First release
278
+ * Converts posts written in Textile
279
+ * Converts regular site pages
280
+ * Simple copy of binary files
281
+
282
+ == 0.0.0 / 2008-10-19
283
+ * Birthday!
284
+
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.
@@ -0,0 +1,41 @@
1
+ h1. Jekyll
2
+
3
+ By Tom Preston-Werner, Nick Quaranto, and many awesome contributors!
4
+
5
+ Jekyll is a simple, blog aware, static site generator. It takes a template directory (representing the raw form of a website), runs it through Textile or Markdown and Liquid converters, and spits out a complete, static website suitable for serving with Apache or your favorite web server. This is also the engine behind "GitHub Pages":http://pages.github.com, which you can use to host your project's page or blog right here from GitHub.
6
+
7
+ h2. Getting Started
8
+
9
+ * "Install":http://wiki.github.com/mojombo/jekyll/install the gem
10
+ * Read up about its "Usage":http://wiki.github.com/mojombo/jekyll/usage and "Configuration":http://wiki.github.com/mojombo/jekyll/configuration
11
+ * Take a gander at some existing "Sites":http://wiki.github.com/mojombo/jekyll/sites
12
+ * Fork and "Contribute":http://wiki.github.com/mojombo/jekyll/contribute your own modifications
13
+ * Have questions? Post them on the "Mailing List":http://groups.google.com/group/jekyll-rb
14
+
15
+ h2. Diving In
16
+
17
+ * "Migrate":http://wiki.github.com/mojombo/jekyll/blog-migrations from your previous system
18
+ * Learn how the "YAML Front Matter":http://wiki.github.com/mojombo/jekyll/yaml-front-matter works
19
+ * Put information on your site with "Template Data":http://wiki.github.com/mojombo/jekyll/template-data
20
+ * Customize the "Permalinks":http://wiki.github.com/mojombo/jekyll/permalinks your posts are generated with
21
+ * Use the built-in "Liquid Extensions":http://wiki.github.com/mojombo/jekyll/liquid-extensions to make your life easier
22
+
23
+ h2. Runtime Dependencies
24
+
25
+ * RedCloth: Textile support (Ruby)
26
+ * Liquid: Templating system (Ruby)
27
+ * Classifier: Generating related posts (Ruby)
28
+ * Maruku: Default markdown engine (Ruby)
29
+ * Directory Watcher: Auto-regeneration of sites (Ruby)
30
+ * Open4: Talking to pygments for syntax highlighting (Ruby)
31
+ * Pygments: Syntax highlighting (Python)
32
+
33
+ h2. Developer Dependencies
34
+
35
+ * Shoulda: Test framework (Ruby)
36
+ * RR: Mocking (Ruby)
37
+ * RedGreen: Nicer test output (Ruby)
38
+
39
+ h2. License
40
+
41
+ See LICENSE.
@@ -0,0 +1,159 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'date'
4
+
5
+ #############################################################################
6
+ #
7
+ # Helper functions
8
+ #
9
+ #############################################################################
10
+
11
+ def name
12
+ @name ||= Dir['*.gemspec'].first.split('.').first
13
+ end
14
+
15
+ def version
16
+ line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
17
+ line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
18
+ end
19
+
20
+ def date
21
+ Date.today.to_s
22
+ end
23
+
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)}'"}
38
+ end
39
+
40
+ #############################################################################
41
+ #
42
+ # Standard tasks
43
+ #
44
+ #############################################################################
45
+
46
+ task :default => [:test, :features]
47
+
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
70
+
71
+ desc "Open an irb session preloaded with this library"
72
+ task :console do
73
+ sh "irb -rubygems -r ./lib/#{name}.rb"
74
+ end
75
+
76
+ #############################################################################
77
+ #
78
+ # Custom tasks (add your own tasks here)
79
+ #
80
+ #############################################################################
81
+
82
+ namespace :migrate do
83
+ desc "Migrate from mephisto in the current directory"
84
+ task :mephisto do
85
+ sh %q(ruby -r './lib/jekyll/migrators/mephisto' -e 'Jekyll::Mephisto.postgres(:database => "#{ENV["DB"]}")')
86
+ end
87
+ desc "Migrate from Movable Type in the current directory"
88
+ task :mt do
89
+ sh %q(ruby -r './lib/jekyll/migrators/mt' -e 'Jekyll::MT.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
90
+ end
91
+ desc "Migrate from Typo in the current directory"
92
+ task :typo do
93
+ sh %q(ruby -r './lib/jekyll/migrators/typo' -e 'Jekyll::Typo.process("#{ENV["DB"]}", "#{ENV["USER"]}", "#{ENV["PASS"]}")')
94
+ end
95
+ end
96
+
97
+ begin
98
+ require 'cucumber/rake/task'
99
+ Cucumber::Rake::Task.new(:features) do |t|
100
+ t.cucumber_opts = "--format progress"
101
+ end
102
+ rescue LoadError
103
+ desc 'Cucumber rake task not available'
104
+ task :features do
105
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
106
+ end
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 origin 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