public
Fork of pivotal/desert
Description: Desert is a component framework for Rails that allows your plugins have a Rails app like directory structure, routes, migrations, and dependencies.
Homepage: http://pivotalrb.rubyforge.org
Clone URL: git://github.com/tog/desert.git
pivotal (author)
Tue Apr 07 16:14:15 -0700 2009
aitor (committer)
Wed Apr 22 03:30:37 -0700 2009
desert / Rakefile
100644 107 lines (91 sloc) 2.923 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
require "rake"
require 'rake/gempackagetask'
require 'rake/contrib/rubyforgepublisher'
require 'rake/clean'
require 'rake/testtask'
require 'rake/rdoctask'
 
desc "Runs the Rspec suite"
task :default do
  run_suite
end
 
desc "Runs the Rspec suite"
task :spec do
  run_suite
end
 
def run_suite
  dir = File.dirname(__FILE__)
  system("ruby #{dir}/spec/spec_suite.rb") || raise("Example Suite failed")
end
 
desc "Copies the trunk to a tag with the name of the current release"
task :tag_release do
  tag_release
end
 
PKG_NAME = "desert"
PKG_VERSION = "0.3.5"
PKG_FILES = FileList[
  '[A-Z]*',
  '*.rb',
  'lib/**/*.rb',
  'generators/**/*',
  'generators/**/templates/*',
  'examples/**/*.rb'
]
 
spec = Gem::Specification.new do |s|
  s.name = PKG_NAME
  s.version = PKG_VERSION
  s.summary = "Desert is a component framework for Rails that allows your plugins to be packaged as mini Rails apps."
  #s.test_files = "examples/spec_suite.rb"
  s.description = s.summary
 
  s.files = PKG_FILES.to_a
  s.require_path = 'lib'
 
  s.has_rdoc = true
  s.extra_rdoc_files = [ "README.rdoc", "CHANGES" ]
  s.rdoc_options = ["--main", "README.rdoc", "--inline-source", "--line-numbers"]
 
  #s.test_files = Dir.glob('spec/*_spec.rb')
  #s.require_path = 'lib'
  s.author = "Pivotal Labs"
  s.email = "opensource@pivotallabs.com"
  s.homepage = "http://pivotallabs.com"
  s.rubyforge_project = "desert"
end
 
Rake::GemPackageTask.new(spec) do |pkg|
  pkg.need_zip = true
  pkg.need_tar = true
end
desc "Regenerate desert.gemspec file. This file is used by github to autobuild the gem and add it to http://gems.github.com source."
task(:gemspec) do
  File.open("#{PKG_NAME}.gemspec", "w") do |gemspec|
    gemspec.puts spec.to_ruby
  end
  puts "#{PKG_NAME}.gemspec generated."
end
 
def tag_release
  dashed_version = PKG_VERSION.gsub('.', '-')
  svn_user = "#{ENV["SVN_USER"]}@" || ""
  `svn cp svn+ssh://#{svn_user}rubyforge.org/var/svn/pivotalrb/desert/trunk svn+ssh://#{svn_user}rubyforge.org/var/svn/pivotalrb/desert/tags/REL-#{dashed_version} -m 'Version #{PKG_VERSION}'`
end
 
desc "Install dependencies to run the build. This task uses Git."
task :install_dependencies do
  require "lib/desert/supported_rails_versions"
  system("git clone git://github.com/rails/rails.git spec/rails_root/vendor/rails_versions/edge")
  Dir.chdir("spec/rails_root/vendor/rails_versions/edge") do
    begin
      Desert::SUPPORTED_RAILS_VERSIONS.each do |version, data|
        unless version == 'edge'
          system("git checkout #{data['git_tag']}")
          system("cp -R ../edge ../#{version}")
        end
      end
    ensure
      system("git checkout master")
    end
  end
end
 
desc "Updates the dependencies to run the build. This task uses Git."
task :update_dependencies do
  system "cd spec/rails_root/vendor/rails_versions/edge; git pull origin"
end
 
desc "Runs the CI build"
task :cruise => :install_dependencies do
  run_suite
end