realityforge-jekyll 0.7.1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +255 -0
- data/LICENSE +21 -0
- data/README.textile +41 -0
- data/Rakefile +159 -0
- data/bin/jekyll +178 -0
- data/cucumber.yml +1 -0
- data/features/create_sites.feature +94 -0
- data/features/embed_filters.feature +60 -0
- data/features/markdown.feature +30 -0
- data/features/pagination.feature +27 -0
- data/features/permalinks.feature +65 -0
- data/features/post_data.feature +153 -0
- data/features/site_configuration.feature +103 -0
- data/features/site_data.feature +82 -0
- data/features/step_definitions/jekyll_steps.rb +145 -0
- data/features/support/env.rb +16 -0
- data/jekyll.gemspec +135 -0
- data/lib/jekyll.rb +109 -0
- data/lib/jekyll/albino.rb +120 -0
- data/lib/jekyll/converter.rb +50 -0
- data/lib/jekyll/converters/identity.rb +22 -0
- data/lib/jekyll/converters/markdown.rb +80 -0
- data/lib/jekyll/converters/textile.rb +33 -0
- data/lib/jekyll/convertible.rb +82 -0
- data/lib/jekyll/core_ext.rb +52 -0
- data/lib/jekyll/errors.rb +6 -0
- data/lib/jekyll/filters.rb +47 -0
- data/lib/jekyll/generator.rb +7 -0
- data/lib/jekyll/generators/pagination.rb +87 -0
- data/lib/jekyll/layout.rb +36 -0
- data/lib/jekyll/migrators/csv.rb +26 -0
- data/lib/jekyll/migrators/mephisto.rb +79 -0
- data/lib/jekyll/migrators/mt.rb +59 -0
- data/lib/jekyll/migrators/textpattern.rb +50 -0
- data/lib/jekyll/migrators/typo.rb +49 -0
- data/lib/jekyll/migrators/wordpress.rb +55 -0
- data/lib/jekyll/page.rb +133 -0
- data/lib/jekyll/plugin.rb +76 -0
- data/lib/jekyll/post.rb +242 -0
- data/lib/jekyll/site.rb +235 -0
- data/lib/jekyll/static_file.rb +76 -0
- data/lib/jekyll/tags/highlight.rb +73 -0
- data/lib/jekyll/tags/include.rb +31 -0
- data/test/helper.rb +33 -0
- data/test/source/_includes/sig.markdown +3 -0
- data/test/source/_layouts/default.html +27 -0
- data/test/source/_layouts/simple.html +1 -0
- data/test/source/_posts/2008-02-02-not-published.textile +8 -0
- data/test/source/_posts/2008-02-02-published.textile +8 -0
- data/test/source/_posts/2008-10-18-foo-bar.textile +8 -0
- data/test/source/_posts/2008-11-21-complex.textile +8 -0
- data/test/source/_posts/2008-12-03-permalinked-post.textile +9 -0
- data/test/source/_posts/2008-12-13-include.markdown +8 -0
- data/test/source/_posts/2009-01-27-array-categories.textile +10 -0
- data/test/source/_posts/2009-01-27-categories.textile +7 -0
- data/test/source/_posts/2009-01-27-category.textile +7 -0
- data/test/source/_posts/2009-01-27-empty-categories.textile +7 -0
- data/test/source/_posts/2009-01-27-empty-category.textile +7 -0
- data/test/source/_posts/2009-03-12-hash-#1.markdown +6 -0
- data/test/source/_posts/2009-05-18-empty-tag.textile +6 -0
- data/test/source/_posts/2009-05-18-empty-tags.textile +6 -0
- data/test/source/_posts/2009-05-18-tag.textile +6 -0
- data/test/source/_posts/2009-05-18-tags.textile +9 -0
- data/test/source/_posts/2009-06-22-empty-yaml.textile +3 -0
- data/test/source/_posts/2009-06-22-no-yaml.textile +1 -0
- data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
- data/test/source/_posts/2010-01-09-date-override.textile +7 -0
- data/test/source/_posts/2010-01-09-time-override.textile +7 -0
- data/test/source/_posts/2010-01-09-timezone-override.textile +7 -0
- data/test/source/_posts/2010-01-16-override-data.textile +4 -0
- data/test/source/about.html +6 -0
- data/test/source/category/_posts/2008-9-23-categories.textile +6 -0
- data/test/source/contacts.html +5 -0
- data/test/source/css/screen.css +76 -0
- data/test/source/foo/_posts/bar/2008-12-12-topical-post.textile +8 -0
- data/test/source/index.html +22 -0
- data/test/source/sitemap.xml +32 -0
- data/test/source/win/_posts/2009-05-24-yaml-linebreak.markdown +7 -0
- data/test/source/z_category/_posts/2008-9-23-categories.textile +6 -0
- data/test/suite.rb +9 -0
- data/test/test_configuration.rb +29 -0
- data/test/test_core_ext.rb +66 -0
- data/test/test_filters.rb +49 -0
- data/test/test_generated_site.rb +44 -0
- data/test/test_page.rb +98 -0
- data/test/test_pager.rb +113 -0
- data/test/test_post.rb +396 -0
- data/test/test_rdiscount.rb +18 -0
- data/test/test_site.rb +153 -0
- data/test/test_tags.rb +116 -0
- metadata +282 -0
data/History.txt
ADDED
@@ -0,0 +1,255 @@
|
|
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
|
+
|
8
|
+
== 0.6.2 / 2010-06-25
|
9
|
+
* Bug Fixes
|
10
|
+
* Fix Rakefile 'release' task (tag pushing was missing origin)
|
11
|
+
* Ensure that RedCloth is loaded when textilize filter is used (#183)
|
12
|
+
* Expand source, destination, and plugin paths (#180)
|
13
|
+
* Fix page.url to include full relative path (#181)
|
14
|
+
|
15
|
+
== 0.6.1 / 2010-06-24
|
16
|
+
* Bug Fixes
|
17
|
+
* Fix Markdown Pygments prefix and suffix (#178)
|
18
|
+
|
19
|
+
== 0.6.0 / 2010-06-23
|
20
|
+
* Major Enhancements
|
21
|
+
* Proper plugin system (#19, #100)
|
22
|
+
* Add safe mode so unsafe converters/generators can be added
|
23
|
+
* Maruku is now the only processor dependency installed by default.
|
24
|
+
Other processors will be lazy-loaded when necessary (and prompt the
|
25
|
+
user to install them when necessary) (#57)
|
26
|
+
* Minor Enhancements
|
27
|
+
* Inclusion/exclusion of future dated posts (#59)
|
28
|
+
* Generation for a specific time (#59)
|
29
|
+
* Allocate site.time on render not per site_payload invocation (#59)
|
30
|
+
* Pages now present in the site payload and can be used through the
|
31
|
+
site.pages and site.html_pages variables
|
32
|
+
* Generate phase added to site#process and pagination is now a generator
|
33
|
+
* Switch to RakeGem for build/test process
|
34
|
+
* Only regenerate static files when they have changed (#142)
|
35
|
+
* Allow arbitrary options to Pygments (#31)
|
36
|
+
* Allow URL to be set via command line option (#147)
|
37
|
+
* Bug Fixes
|
38
|
+
* Render highlighted code for non markdown/textile pages (#116)
|
39
|
+
* Fix highlighting on Ruby 1.9 (#65)
|
40
|
+
* Fix extension munging when pretty permalinks are enabled (#64)
|
41
|
+
* Stop sorting categories (#33)
|
42
|
+
* Preserve generated attributes over front matter (#119)
|
43
|
+
* Fix source directory binding using Dir.pwd (#75)
|
44
|
+
|
45
|
+
== 0.5.7 / 2010-01-12
|
46
|
+
* Minor Enhancements
|
47
|
+
* Allow overriding of post date in the front matter (#62, #38)
|
48
|
+
* Bug Fixes
|
49
|
+
* Categories isn't always an array (#73)
|
50
|
+
* Empty tags causes error in read_posts (#84)
|
51
|
+
* Fix pagination to adhere to read/render/write paradigm
|
52
|
+
* Test Enhancement
|
53
|
+
* cucumber features no longer use site.ports.first where a better
|
54
|
+
alternative is available
|
55
|
+
|
56
|
+
== 0.5.6 / 2010-01-08
|
57
|
+
* Bug Fixes
|
58
|
+
* Require redcloth >= 4.2.1 in tests (#92)
|
59
|
+
* Don't break on triple dashes in yaml frontmatter (#93)
|
60
|
+
* Minor Enhancements
|
61
|
+
* Allow .mkd as markdown extension
|
62
|
+
* Use $stdout/err instead of constants (#99)
|
63
|
+
* Properly wrap code blocks (#91)
|
64
|
+
* Add javascript mime type for webrick (#98)
|
65
|
+
|
66
|
+
== 0.5.5 / 2010-01-08
|
67
|
+
* Bug Fixes
|
68
|
+
* Fix pagination % 0 bug (#78)
|
69
|
+
* Ensure all posts are processed first (#71)
|
70
|
+
|
71
|
+
== NOTE
|
72
|
+
* After this point I will no longer be giving credit in the history;
|
73
|
+
that is what the commit log is for.
|
74
|
+
|
75
|
+
== 0.5.4 / 2009-08-23
|
76
|
+
* Bug Fixes
|
77
|
+
* Do not allow symlinks (security vulnerability)
|
78
|
+
|
79
|
+
== 0.5.3 / 2009-07-14
|
80
|
+
* Bug Fixes
|
81
|
+
* Solving the permalink bug where non-html files wouldn't work
|
82
|
+
[github.com/jeffrydegrande]
|
83
|
+
|
84
|
+
== 0.5.2 / 2009-06-24
|
85
|
+
* Enhancements
|
86
|
+
* Added --paginate option to the executable along with a paginator object
|
87
|
+
for the payload [github.com/calavera]
|
88
|
+
* Upgraded RedCloth to 4.2.1, which makes <notextile> tags work once
|
89
|
+
again.
|
90
|
+
* Configuration options set in config.yml are now available through the
|
91
|
+
site payload [github.com/vilcans]
|
92
|
+
* Posts can now have an empty YAML front matter or none at all
|
93
|
+
[github.com/bahuvrihi]
|
94
|
+
* Bug Fixes
|
95
|
+
* Fixing Ruby 1.9 issue that requires to_s on the err object
|
96
|
+
[github.com/Chrononaut]
|
97
|
+
* Fixes for pagination and ordering posts on the same day [github.com/ujh]
|
98
|
+
* Made pages respect permalinks style and permalinks in yml front matter
|
99
|
+
[github.com/eugenebolshakov]
|
100
|
+
* Index.html file should always have index.html permalink
|
101
|
+
[github.com/eugenebolshakov]
|
102
|
+
* Added trailing slash to pretty permalink style so Apache is happy
|
103
|
+
[github.com/eugenebolshakov]
|
104
|
+
* Bad markdown processor in config fails sooner and with better message
|
105
|
+
[github.com/gcnovus]
|
106
|
+
* Allow CRLFs in yaml frontmatter [github.com/juretta]
|
107
|
+
* Added Date#xmlschema for Ruby versions < 1.9
|
108
|
+
|
109
|
+
== 0.5.1 / 2009-05-06
|
110
|
+
* Major Enhancements
|
111
|
+
* Next/previous posts in site payload [github.com/pantulis,
|
112
|
+
github.com/tomo]
|
113
|
+
* Permalink templating system
|
114
|
+
* Moved most of the README out to the GitHub wiki
|
115
|
+
* Exclude option in configuration so specified files won't be brought over
|
116
|
+
with generated site [github.com/duritong]
|
117
|
+
* Bug Fixes
|
118
|
+
* Making sure config.yaml references are all gone, using only config.yml
|
119
|
+
* Fixed syntax highlighting breaking for UTF-8 code [github.com/henrik]
|
120
|
+
* Worked around RDiscount bug that prevents Markdown from getting parsed
|
121
|
+
after highlight [github.com/henrik]
|
122
|
+
* CGI escaped post titles [github.com/Chrononaut]
|
123
|
+
|
124
|
+
== 0.5.0 / 2009-04-07
|
125
|
+
* Minor Enhancements
|
126
|
+
* Ability to set post categories via YAML [github.com/qrush]
|
127
|
+
* Ability to set prevent a post from publishing via YAML
|
128
|
+
[github.com/qrush]
|
129
|
+
* Add textilize filter [github.com/willcodeforfoo]
|
130
|
+
* Add 'pretty' permalink style for wordpress-like urls
|
131
|
+
[github.com/dysinger]
|
132
|
+
* Made it possible to enter categories from YAML as an array
|
133
|
+
[github.com/Chrononaut]
|
134
|
+
* Ignore Emacs autosave files [github.com/Chrononaut]
|
135
|
+
* Bug Fixes
|
136
|
+
* Use block syntax of popen4 to ensure that subprocesses are properly
|
137
|
+
disposed [github.com/jqr]
|
138
|
+
* Close open4 streams to prevent zombies [github.com/rtomayko]
|
139
|
+
* Only query required fields from the WP Database [github.com/ariejan]
|
140
|
+
* Prevent _posts from being copied to the destination directory
|
141
|
+
[github.com/bdimcheff]
|
142
|
+
* Refactors
|
143
|
+
* Factored the filtering code into a method [github.com/Chrononaut]
|
144
|
+
* Fix tests and convert to Shoulda [github.com/qrush,
|
145
|
+
github.com/technicalpickles]
|
146
|
+
* Add Cucumber acceptance test suite [github.com/qrush,
|
147
|
+
github.com/technicalpickles]
|
148
|
+
|
149
|
+
== 0.4.1
|
150
|
+
* Minor Enhancements
|
151
|
+
* Changed date format on wordpress converter (zeropadding)
|
152
|
+
[github.com/dysinger]
|
153
|
+
* Bug Fixes
|
154
|
+
* Add jekyll binary as executable to gemspec [github.com/dysinger]
|
155
|
+
|
156
|
+
== 0.4.0 / 2009-02-03
|
157
|
+
* Major Enhancements
|
158
|
+
* Switch to Jeweler for packaging tasks
|
159
|
+
* Minor Enhancements
|
160
|
+
* Type importer [github.com/codeslinger]
|
161
|
+
* site.topics accessor [github.com/baz]
|
162
|
+
* Add array_to_sentence_string filter [github.com/mchung]
|
163
|
+
* Add a converter for textpattern [github.com/PerfectlyNormal]
|
164
|
+
* Add a working Mephisto / MySQL converter [github.com/ivey]
|
165
|
+
* Allowing .htaccess files to be copied over into the generated site
|
166
|
+
[github.com/briandoll]
|
167
|
+
* Add option to not put file date in permalink URL [github.com/mreid]
|
168
|
+
* Add line number capabilities to highlight blocks [github.com/jcon]
|
169
|
+
* Bug Fixes
|
170
|
+
* Fix permalink behavior [github.com/cavalle]
|
171
|
+
* Fixed an issue with pygments, markdown, and newlines
|
172
|
+
[github.com/zpinter]
|
173
|
+
* Ampersands need to be escaped [github.com/pufuwozu, github.com/ap]
|
174
|
+
* Test and fix the site.categories hash [github.com/zzot]
|
175
|
+
* Fix site payload available to files [github.com/matrix9180]
|
176
|
+
|
177
|
+
== 0.3.0 / 2008-12-24
|
178
|
+
* Major Enhancements
|
179
|
+
* Added --server option to start a simple WEBrick server on destination
|
180
|
+
directory [github.com/johnreilly and github.com/mchung]
|
181
|
+
* Minor Enhancements
|
182
|
+
* Added post categories based on directories containing _posts
|
183
|
+
[github.com/mreid]
|
184
|
+
* Added post topics based on directories underneath _posts
|
185
|
+
* Added new date filter that shows the full month name [github.com/mreid]
|
186
|
+
* Merge Post's YAML front matter into its to_liquid payload
|
187
|
+
[github.com/remi]
|
188
|
+
* Restrict includes to regular files underneath _includes
|
189
|
+
* Bug Fixes
|
190
|
+
* Change YAML delimiter matcher so as to not chew up 2nd level markdown
|
191
|
+
headers [github.com/mreid]
|
192
|
+
* Fix bug that meant page data (such as the date) was not available in
|
193
|
+
templates [github.com/mreid]
|
194
|
+
* Properly reject directories in _layouts
|
195
|
+
|
196
|
+
== 0.2.1 / 2008-12-15
|
197
|
+
* Major Changes
|
198
|
+
* Use Maruku (pure Ruby) for Markdown by default [github.com/mreid]
|
199
|
+
* Allow use of RDiscount with --rdiscount flag
|
200
|
+
* Minor Enhancements
|
201
|
+
* Don't load directory_watcher unless it's needed [github.com/pjhyett]
|
202
|
+
|
203
|
+
== 0.2.0 / 2008-12-14
|
204
|
+
* Major Changes
|
205
|
+
* related_posts is now found in site.related_posts
|
206
|
+
|
207
|
+
== 0.1.6 / 2008-12-13
|
208
|
+
* Major Features
|
209
|
+
* Include files in _includes with {% include x.textile %}
|
210
|
+
|
211
|
+
== 0.1.5 / 2008-12-12
|
212
|
+
* Major Features
|
213
|
+
* Code highlighting with Pygments if --pygments is specified
|
214
|
+
* Disable true LSI by default, enable with --lsi
|
215
|
+
* Minor Enhancements
|
216
|
+
* Output informative message if RDiscount is not available
|
217
|
+
[github.com/JackDanger]
|
218
|
+
* Bug Fixes
|
219
|
+
* Prevent Jekyll from picking up the output directory as a source
|
220
|
+
[github.com/JackDanger]
|
221
|
+
* Skip related_posts when there is only one post [github.com/JackDanger]
|
222
|
+
|
223
|
+
== 0.1.4 / 2008-12-08
|
224
|
+
* Bug Fixes
|
225
|
+
* DATA does not work properly with rubygems
|
226
|
+
|
227
|
+
== 0.1.3 / 2008-12-06
|
228
|
+
* Major Features
|
229
|
+
* Markdown support [github.com/vanpelt]
|
230
|
+
* Mephisto and CSV converters [github.com/vanpelt]
|
231
|
+
* Code hilighting [github.com/vanpelt]
|
232
|
+
* Autobuild
|
233
|
+
* Bug Fixes
|
234
|
+
* Accept both \r\n and \n in YAML header [github.com/vanpelt]
|
235
|
+
|
236
|
+
== 0.1.2 / 2008-11-22
|
237
|
+
* Major Features
|
238
|
+
* Add a real "related posts" implementation using Classifier
|
239
|
+
* Command Line Changes
|
240
|
+
* Allow cli to be called with 0, 1, or 2 args intuiting dir paths
|
241
|
+
if they are omitted
|
242
|
+
|
243
|
+
== 0.1.1 / 2008-11-22
|
244
|
+
* Minor Additions
|
245
|
+
* Posts now support introspectional data e.g. {{ page.url }}
|
246
|
+
|
247
|
+
== 0.1.0 / 2008-11-05
|
248
|
+
* First release
|
249
|
+
* Converts posts written in Textile
|
250
|
+
* Converts regular site pages
|
251
|
+
* Simple copy of binary files
|
252
|
+
|
253
|
+
== 0.0.0 / 2008-10-19
|
254
|
+
* Birthday!
|
255
|
+
|
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.
|
data/README.textile
ADDED
@@ -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.
|
data/Rakefile
ADDED
@@ -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
|