Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 4207 Bytes
1 | require 'rake/clean' |
2 | |
3 | task :default => :test |
4 | |
5 | CLEAN.include %w[coverage/ doc/api tags] |
6 | CLOBBER.include %w[dist] |
7 | |
8 | # load gemspec like github's gem builder to surface any SAFE issues. |
9 | Thread.new do |
10 | require 'rubygems/specification' |
11 | $spec = eval("$SAFE=3\n#{File.read('rack-cache.gemspec')}") |
12 | end.join |
13 | |
14 | # SPECS ===================================================================== |
15 | |
16 | desc 'Run specs with story style output' |
17 | task :spec do |
18 | sh 'specrb --specdox -Ilib:test test/*_test.rb' |
19 | end |
20 | |
21 | desc 'Run specs with unit test style output' |
22 | task :test => FileList['test/*_test.rb'] do |t| |
23 | suite = t.prerequisites |
24 | sh "specrb -Ilib:test #{suite.join(' ')}", :verbose => false |
25 | end |
26 | |
27 | desc 'Generate test coverage report' |
28 | task :rcov do |
29 | sh "rcov -Ilib:test test/*_test.rb" |
30 | end |
31 | |
32 | # DOC ======================================================================= |
33 | desc 'Build all documentation' |
34 | task :doc => %w[doc:api doc:markdown] |
35 | |
36 | # requires the hanna gem: |
37 | # gem install mislav-hanna --source=http://gems.github.com |
38 | desc 'Build API documentation (doc/api)' |
39 | task 'doc:api' => 'doc/api/index.html' |
40 | file 'doc/api/index.html' => FileList['lib/**/*.rb'] do |f| |
41 | rm_rf 'doc/api' |
42 | sh((<<-SH).gsub(/[\s\n]+/, ' ').strip) |
43 | hanna |
44 | --op doc/api |
45 | --promiscuous |
46 | --charset utf8 |
47 | --fmt html |
48 | --inline-source |
49 | --line-numbers |
50 | --accessor option_accessor=RW |
51 | --main Rack::Cache |
52 | --title 'Rack::Cache API Documentation' |
53 | #{f.prerequisites.join(' ')} |
54 | SH |
55 | end |
56 | CLEAN.include 'doc/api' |
57 | |
58 | desc 'Build markdown documentation files' |
59 | task 'doc:markdown' |
60 | FileList['doc/*.markdown'].each do |source| |
61 | dest = "doc/#{File.basename(source, '.markdown')}.html" |
62 | file dest => [source, 'doc/layout.html.erb'] do |f| |
63 | puts "markdown: #{source} -> #{dest}" if verbose |
64 | require 'erb' unless defined? ERB |
65 | require 'rdiscount' unless defined? RDiscount |
66 | template = File.read(source) |
67 | content = Markdown.new(ERB.new(template, 0, "%<>").result(binding), :smart).to_html |
68 | title = content.match("<h1>(.*)</h1>")[1] rescue '' |
69 | layout = ERB.new(File.read("doc/layout.html.erb"), 0, "%<>") |
70 | output = layout.result(binding) |
71 | File.open(dest, 'w') { |io| io.write(output) } |
72 | end |
73 | task 'doc:markdown' => dest |
74 | CLEAN.include dest |
75 | end |
76 | |
77 | desc 'Publish documentation' |
78 | task 'doc:publish' => :doc do |
79 | sh 'rsync -avz doc/ gus@tomayko.com:/src/rack-cache' |
80 | end |
81 | |
82 | desc 'Start the documentation development server (requires thin)' |
83 | task 'doc:server' do |
84 | sh 'cd doc && thin --rackup server.ru --port 3035 start' |
85 | end |
86 | |
87 | # PACKAGING ================================================================= |
88 | |
89 | def package(ext='') |
90 | "dist/rack-cache-#{$spec.version}" + ext |
91 | end |
92 | |
93 | desc 'Build packages' |
94 | task :package => %w[.gem .tar.gz].map {|e| package(e)} |
95 | |
96 | desc 'Build and install as local gem' |
97 | task :install => package('.gem') do |
98 | sh "gem install #{package('.gem')}" |
99 | end |
100 | |
101 | directory 'dist/' |
102 | |
103 | file package('.gem') => %w[dist/ rack-cache.gemspec] + $spec.files do |f| |
104 | sh "gem build rack-cache.gemspec" |
105 | mv File.basename(f.name), f.name |
106 | end |
107 | |
108 | file package('.tar.gz') => %w[dist/] + $spec.files do |f| |
109 | sh "git archive --format=tar HEAD | gzip > #{f.name}" |
110 | end |
111 | |
112 | desc 'Upload gem and tar.gz distributables to rubyforge' |
113 | task :release => [package('.gem'), package('.tar.gz')] do |t| |
114 | sh <<-SH |
115 | rubyforge add_release wink rack-cache #{$spec.version} #{package('.gem')} && |
116 | rubyforge add_file wink rack-cache #{$spec.version} #{package('.tar.gz')} |
117 | SH |
118 | end |
119 | |
120 | # GEMSPEC =================================================================== |
121 | |
122 | file 'rack-cache.gemspec' => FileList['{lib,test}/**','Rakefile'] do |f| |
123 | # read spec file and split out manifest section |
124 | spec = File.read(f.name) |
125 | parts = spec.split(" # = MANIFEST =\n") |
126 | fail 'bad spec' if parts.length != 3 |
127 | # determine file list from git ls-files |
128 | files = `git ls-files`. |
129 | split("\n").sort.reject{ |file| file =~ /^\./ }. |
130 | map{ |file| " #{file}" }.join("\n") |
131 | # piece file back together and write... |
132 | parts[1] = " s.files = %w[\n#{files}\n ]\n" |
133 | spec = parts.join(" # = MANIFEST =\n") |
134 | spec.sub!(/s.date = '.*'/, "s.date = '#{Time.now.strftime("%Y-%m-%d")}'") |
135 | File.open(f.name, 'w') { |io| io.write(spec) } |
136 | puts "updated #{f.name}" |
137 | end |