From 1605baca70b27bee9f57db8517ff19c2a7cc328d Mon Sep 17 00:00:00 2001 From: _why Date: Wed, 3 May 2006 15:29:20 +0000 Subject: [PATCH] * Rakefile: build gems, install, uninstall, docs. * COPYING: bsd license --- COPYING | 18 ++++++++++++ Rakefile | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 COPYING create mode 100644 Rakefile diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94b6b84 --- /dev/null +++ b/COPYING @@ -0,0 +1,18 @@ +Copyright (c) 2006 why the lucky stiff + +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +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 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. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..55089c1 --- /dev/null +++ b/Rakefile @@ -0,0 +1,89 @@ +require 'rake' +require 'rake/clean' +require 'rake/gempackagetask' +require 'rake/rdoctask' +require 'fileutils' +include FileUtils + +NAME = "camping" +VERS = "1.4.1.87" +CLEAN.include ['**/.*.sw?', '*.gem', '.config'] +RDOC_OPTS = ['--quiet', '--title', "Camping, the Documentation", + "--template", "extras/flipbook_rdoc.rb", + "--opname", "index.html", + "--line-numbers", + "--main", "README", + "--inline-source"] + +desc "Packages up Camping." +task :default => [:package] +task :package => [:clean] + +task :doc => [:before_doc, :rdoc, :after_doc] + +task :before_doc do + mv "lib/camping.rb", "lib/camping-mural.rb" + mv "lib/camping-unabridged.rb", "lib/camping.rb" +end + +Rake::RDocTask.new do |rdoc| + rdoc.rdoc_dir = 'doc' + rdoc.options += RDOC_OPTS + rdoc.template = "extras/flipbook_rdoc.rb" + rdoc.main = "README" + rdoc.title = "Camping, the Documentation" + rdoc.rdoc_files.add ['README', 'CHANGELOG', 'COPYING', 'lib/camping.rb'] +end + +task :after_doc do + mv "lib/camping.rb", "lib/camping-unabridged.rb" + mv "lib/camping-mural.rb", "lib/camping.rb" + cp "extras/Camping.gif", "doc/" + cp "extras/permalink.gif", "doc/" + sh %{scp -r doc/* #{ENV['USER']}@rubyforge.org:/var/www/gforge-projects/camping/} +end + +spec = + Gem::Specification.new do |s| + s.name = NAME + s.version = VERS + s.platform = Gem::Platform::RUBY + s.has_rdoc = true + s.extra_rdoc_files = ["README", "CHANGELOG", "COPYING"] + s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)\/', '--exclude', 'lib/camping.rb'] + s.summary = "minature rails for stay-at-home moms" + s.description = s.summary + s.author = "why the lucky stiff" + s.email = 'why@ruby-lang.org' + s.homepage = 'http://code.whytheluckystiff.net/camping/' + s.executables = ['camping'] + + s.add_dependency('activerecord', '>=1.14.2') + s.add_dependency('markaby', '>=0.4') + s.add_dependency('metaid') + s.required_ruby_version = '>= 1.8.2' + + s.files = %w(COPYING README Rakefile) + + Dir.glob("{bin,doc/rdoc,test,lib,extras}/**/*") + + Dir.glob("ext/**/*.{h,c,rb}") + + Dir.glob("examples/**/*.rb") + + Dir.glob("tools/*.rb") + + s.require_path = "lib" + # s.extensions = FileList["ext/**/extconf.rb"].to_a + s.bindir = "bin" + end + +Rake::GemPackageTask.new(spec) do |p| + p.need_tar = true + p.gem_spec = spec +end + +task :install do + sh %{rake package} + sh %{sudo gem install pkg/#{NAME}-#{VERS}} +end + +task :uninstall => [:clean] do + sh %{sudo gem uninstall #{NAME}} +end