public
Description: A rich DSL for describing state, and state-related behaviour, in your ruby classes / models.
Homepage: nil
Clone URL: git://github.com/davidlee/state-fu.git
state-fu / Rakefile
100644 109 lines (89 sloc) 2.813 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env ruby
require "spec/rake/spectask"
#require 'cucumber/rake/task'
require "date"
require "fileutils"
require "rubygems"
 
load File.join( File.dirname(__FILE__),"/lib/tasks/state_fu.rake" )
 
load 'lib/tasks/spec_last.rake'
load 'lib/tasks/state_fu.rake'
 
# to build the gem:
#
# gem install jeweller
# rake build
# rake install
begin
  require 'jeweler'
  Jeweler::Tasks.new do |s| # gemspec (Gem::Specification)
  s.name = "state-fu"
  s.rubyforge_project = "state-fu"
  s.platform = Gem::Platform::RUBY
  s.has_rdoc = true
# s.extra_rdoc_files = ["README.rdoc"]
  s.summary = "A rich library for state-oriented programming with state machines / workflows"
  s.description = s.summary
  s.author = "David Lee"
  s.email = "david@rubyist.net.au"
  s.homepage = "http://github.com/davidlee/state-fu"
  s.require_path = "lib"
# s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,spec}/**/*")
  s.files = %w(Rakefile) + Dir.glob("{lib,spec}/**/*")
  end
rescue LoadError
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
 
namespace :spec do
 
  desc 'run the nice new specs'
  Spec::Rake::SpecTask.new(:state_fu) do |t|
    t.spec_files = FileList["spec/state_fu_spec.rb"]
    t.spec_opts = ["--options", "spec/spec.opts"]
  end
 
 
  desc "Run all (old) specs"
  Spec::Rake::SpecTask.new(:all) do |t|
    t.spec_files = FileList["spec/**/*_spec.rb"]
    t.spec_opts = ["--options", "spec/spec.opts"]
  end
 
  task :skip_slow do
    ENV['SKIP_SLOW_SPECS'] = 'true'
  end
 
  desc "Run all specs, except especially slow ones"
  task :quick => [:skip_slow, :all]
 
  desc "Run all specs with profiling & backtrace"
  Spec::Rake::SpecTask.new(:prof) do |t|
    t.spec_files = FileList["spec/**/*_spec.rb"]
    t.spec_opts = ['-c','-b','-f','profile','-R','-L','mtime']
  end
 
  desc "Print Specdoc for all specs (eaxcluding plugin specs)"
  Spec::Rake::SpecTask.new(:doc) do |t|
    t.spec_files = FileList["spec/**/*_spec.rb"]
    t.spec_opts = ["--format", "nested","--color"]
  end
 
  desc "Run autotest"
  task :auto do |t|
    exec 'autospec'
  end
 
  task :default => :state_fu
end
 
desc 'Runs irb in this project\'s context'
task :irb do |t|
  exec 'irb -I lib -I spec -r state-fu -r spec_helper'
end
 
desc 'Runs rdoc on the project lib directory'
task :doc do |t|
  exec 'rdoc lib/'
end
 
desc 'Delete logfiles'
namespace :log do
  task :clear do |t|
    Dir['log/*.log'].each { |log| File.rm(log) }
  end
end
 
begin
  require 'cucumber/rake/task'
 
  Cucumber::Rake::Task.new(:features) do |t|
      t.cucumber_opts = "--format pretty"
  end
rescue LoadError => e
end
 
task :all => 'spec:all'
task :default => :all