0
-require 'rake/testtask'
0
-require 'rake/rdoctask'
0
-require 'spec/rake/spectask'
0
+# Copyright 2008 Scott Barron (scott@elitists.net)
0
-desc 'Default: run unit tests.'
0
-task :default => [:clean_db, :test]
0
+# This file may be distributed under an MIT style license.
0
+# See MIT-LICENSE for details.
0
-desc 'Remove the stale db file'
0
- `rm -f #{File.dirname(__FILE__)}/test/state_machine.sqlite.db`
0
+ require 'rake/gempackagetask'
0
+ require 'rake/testtask'
0
+ require 'rake/rdoctask'
0
+ require 'spec/rake/spectask'
0
-desc 'Test the acts as state machine plugin.'
0
-Rake::TestTask.new(:test) do |t|
0
- t.pattern = 'test/**/*_test.rb'
0
+CURRENT_VERSION = '0.0.0'
0
+$package_version = CURRENT_VERSION
0
+PKG_FILES = FileList['[A-Z]*',
0
desc 'Generate documentation for the acts as state machine plugin.'
0
-Rake::RDocTask.new(:rdoc) do |rdoc|
0
+rd = Rake::RDocTask.new(:rdoc) do |rdoc|
0
+ rdoc.rdoc_dir = 'html'
0
+ rdoc.template = 'doc/jamis.rb'
0
- rdoc.title = 'Acts As State Machine'
0
- rdoc.options << '--line-numbers --inline-source'
0
- rdoc.rdoc_files.include('README')
0
- rdoc.rdoc_files.include('TODO')
0
- rdoc.rdoc_files.include('lib/**/*.rb')
0
+ rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README' << '--title' << 'AASM'
0
+ rdoc.rdoc_files.include('README', 'MIT-LICENSE', 'TODO', 'CHANGELOG')
0
+ rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
0
-desc "Run all examples with RCov"
0
-Spec::Rake::SpecTask.new('cruise') do |t|
0
- t.spec_files = FileList['spec/*.rb']
0
- t.rcov_opts = ['--exclude', 'spec']
0
+ puts "Package target requires RubyGEMs"
0
+ spec = Gem::Specification.new do |s|
0
+ s.version = $package_version
0
+ s.summary = 'State machine mixin for Ruby objects'
0
+ s.description = <<-EOF
0
+AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.
0
+ s.files = PKG_FILES.to_a
0
+ s.require_path = 'lib'
0
+ s.extra_rdoc_files = rd.rdoc_files.reject {|fn| fn =~ /\.rb$/}.to_a
0
+ s.rdoc_options = rd.options
0
+ s.author = 'Scott Barron'
0
+ s.email = 'scott@elitists.net'
0
+ s.homepage = 'http://rubyi.st/aasm'
0
+ package_task = Rake::GemPackageTask.new(spec) do |pkg|
0
-desc "Run all examples"
0
-Spec::Rake::SpecTask.new('spec') do |t|
0
- t.spec_files = FileList['spec/*.rb']
0
- t.spec_opts = ['-cfs']
0
+ puts "spec and cruise targets require RSpec"
0
+ desc "Run all examples with RCov"
0
+ Spec::Rake::SpecTask.new('cruise') do |t|
0
+ t.spec_files = FileList['spec/*.rb']
0
+ t.rcov_opts = ['--exclude', 'spec']
0
+ desc "Run all examples"
0
+ Spec::Rake::SpecTask.new('spec') do |t|
0
+ t.spec_files = FileList['spec/*.rb']
0
+ t.spec_opts = ['-cfs']
0
task :default => [:spec]
Comments
No one has commented yet.