public
Description: Better autotest for RSpec & Cucumber with Spork support on OS X. (The GUI version has moved to rubyphunk/rspactor-gui)
Homepage:
Clone URL: git://github.com/rubyphunk/rspactor.git
Click here to lend your support to: rspactor and make a donation at www.pledgie.com !
rspactor / Rakefile
100644 58 lines (48 sloc) 1.656 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
task :default => :spec
 
desc "starts RSpactor"
task :spec do
  system "ruby -Ilib bin/rspactor"
end
 
desc "generates .gemspec file"
task :gemspec => "version:read" do
  spec = Gem::Specification.new do |gem|
    gem.name = "rspactor"
    gem.summary = "RSpactor is a command line tool to automatically run your changed specs & cucumber features (much like autotest)."
    gem.description = "read summary!"
    gem.email = "guillaumegentil@gmail.com"
    gem.homepage = "http://github.com/guillaumegentil/rspactor"
    gem.authors = ["Mislav Marohnić", "Andreas Wolff", "Pelle Braendgaard", "Thibaud Guillaume-Gentil"]
    gem.has_rdoc = false
    
    gem.version = GEM_VERSION
    gem.files = FileList['Rakefile', '{bin,lib,images,spec}/**/*', 'README*', 'LICENSE*']
    gem.executables = Dir['bin/*'].map { |f| File.basename(f) }
  end
  
  spec_string = spec.to_ruby
  
  begin
    Thread.new { eval("$SAFE = 3\n#{spec_string}", binding) }.join
  rescue
    abort "unsafe gemspec: #{$!}"
  else
    File.open("#{spec.name}.gemspec", 'w') { |file| file.write spec_string }
  end
end
 
task :bump => ["version:bump", :gemspec]
 
namespace :version do
  task :read do
    unless defined? GEM_VERSION
      GEM_VERSION = File.read("VERSION")
    end
  end
  
  task :bump => :read do
    if ENV['VERSION']
      GEM_VERSION.replace ENV['VERSION']
    else
      GEM_VERSION.sub!(/\d+$/) { |num| num.to_i + 1 }
    end
    
    File.open("VERSION", 'w') { |v| v.write GEM_VERSION }
  end
end
 
task :release => :bump do
  system %(git commit VERSION *.gemspec -m "release v#{GEM_VERSION}")
  system %(git tag -am "release v#{GEM_VERSION}" v#{GEM_VERSION})
end