root / tags / 1.5 / Rakefile

Revision 159, 2.7 kB (checked in by why, 2 years ago)
  • lib/camping-unabridged.rb: remove most of the postamble docs, except when talking about CGI. for the rest,
    The Camping Server is recommended.
  • RakeFile?: we'll skip the custom rdoc template until RubyGems? supports it.
Line 
1require 'rake'
2require 'rake/clean'
3require 'rake/gempackagetask'
4require 'rake/rdoctask'
5require 'fileutils'
6include FileUtils
7
8NAME = "camping"
9REV = File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
10VERS = ENV['VERSION'] || ("1.4" + (REV ? ".#{REV}" : ""))
11CLEAN.include ['**/.*.sw?', '*.gem', '.config']
12RDOC_OPTS = ['--quiet', '--title', "Camping, the Documentation",
13    "--opname", "index.html",
14    "--line-numbers",
15    "--main", "README",
16    "--inline-source"]
17
18desc "Packages up Camping."
19task :default => [:package]
20task :package => [:clean]
21
22task :doc => [:before_doc, :rdoc, :after_doc]
23
24task :before_doc do
25    mv "lib/camping.rb", "lib/camping-mural.rb"
26    mv "lib/camping-unabridged.rb", "lib/camping.rb"
27end
28
29Rake::RDocTask.new do |rdoc|
30    rdoc.rdoc_dir = 'doc/rdoc'
31    rdoc.options += RDOC_OPTS
32    rdoc.template = "extras/flipbook_rdoc.rb"
33    rdoc.main = "README"
34    rdoc.title = "Camping, the Documentation"
35    rdoc.rdoc_files.add ['README', 'CHANGELOG', 'COPYING', 'lib/camping.rb', 'lib/camping/*.rb']
36end
37
38task :after_doc do
39    mv "lib/camping.rb", "lib/camping-unabridged.rb"
40    mv "lib/camping-mural.rb", "lib/camping.rb"
41    cp "extras/Camping.gif", "doc/rdoc/"
42    cp "extras/permalink.gif", "doc/rdoc/"
43    sh %{scp -r doc/rdoc/* #{ENV['USER']}@rubyforge.org:/var/www/gforge-projects/camping/}
44end
45
46spec =
47    Gem::Specification.new do |s|
48        s.name = NAME
49        s.version = VERS
50        s.platform = Gem::Platform::RUBY
51        s.has_rdoc = true
52        s.extra_rdoc_files = ["README", "CHANGELOG", "COPYING"]
53        s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)\/', '--exclude', 'lib/camping.rb']
54        s.summary = "minature rails for stay-at-home moms"
55        s.description = s.summary
56        s.author = "why the lucky stiff"
57        s.email = 'why@ruby-lang.org'
58        s.homepage = 'http://code.whytheluckystiff.net/camping/'
59        s.executables = ['camping']
60
61        s.add_dependency('activesupport', '>=1.3.1')
62        s.add_dependency('markaby', '>=0.4.65')
63        s.add_dependency('metaid')
64        s.required_ruby_version = '>= 1.8.2'
65
66        s.files = %w(COPYING README Rakefile) +
67          Dir.glob("{bin,doc,test,lib,extras}/**/*") +
68          Dir.glob("ext/**/*.{h,c,rb}") +
69          Dir.glob("examples/**/*.rb") +
70          Dir.glob("tools/*.rb")
71       
72        s.require_path = "lib"
73        # s.extensions = FileList["ext/**/extconf.rb"].to_a
74        s.bindir = "bin"
75    end
76
77Rake::GemPackageTask.new(spec) do |p|
78    p.need_tar = true
79    p.gem_spec = spec
80end
81
82task :install do
83  sh %{rake package}
84  sh %{sudo gem install pkg/#{NAME}-#{VERS}}
85end
86
87task :uninstall => [:clean] do
88  sh %{sudo gem uninstall #{NAME}}
89end
Note: See TracBrowser for help on using the browser.