forked from wycats/merb-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
96 lines (80 loc) · 2.05 KB
/
Rakefile
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
## THESE ARE CRUCIAL
module Merb
# Set this to the version of merb-core that you are building against/for
VERSION = "0.9.9"
# Set this to the version of merb-more you plan to release
MORE_VERSION = "0.9.9"
end
GEM_VERSION = Merb::VERSION
require 'rubygems'
require "rake/clean"
require "rake/gempackagetask"
require 'merb-core/tasks/merb_rake_helper'
require 'fileutils'
include FileUtils
gems = %w[
merb_activerecord
merb_sequel
merb_test_unit
merb_stories
merb_screw_unit
merb_jquery
merb_builder
merb_parts
]
# Implement standard Rake::GemPackageTask tasks - see merb.thor
task :clobber_package do; FileUtils.rm_rf('pkg'); end
task :package do; end
desc "Install all gems"
task :install => :install_gems
desc "Uninstall all gems"
task :uninstall => :uninstall_gems
desc "Build the merb-more gems"
task :build_gems do
gems.each do |dir|
Dir.chdir(dir) { sh "#{Gem.ruby} -S rake package" }
end
end
desc "Install the merb-plugins sub-gems"
task :install_gems do
gems.each do |dir|
Dir.chdir(dir) { sh "#{Gem.ruby} -S rake install" }
end
end
desc "Uninstall the merb-plugins sub-gems"
task :uninstall_gems do
gems.each do |dir|
Dir.chdir(dir) { sh "#{Gem.ruby} -S rake uninstall" }
end
end
desc "Clobber the merb-plugins sub-gems"
task :clobber_gems do
gems.each do |dir|
Dir.chdir(dir) { sh "#{Gem.ruby} -S rake clobber" }
end
end
desc "Bundle up all the merb-plugins gems"
task :bundle do
mkdir_p "bundle"
gems.each do |gem|
File.open("#{gem}/Rakefile") do |rakefile|
rakefile.read.detect {|l| l =~ /^GEM_VERSION\s*=\s*"(.*)"$/ }
Dir.chdir(gem){ sh "rake package" }
sh %{cp #{gem}/pkg/#{gem}-#{$1}.gem bundle/}
end
end
end
desc "Release gems in merb-plugins"
task :release do
gems.each do |dir|
Dir.chdir(dir){ sh "#{Gem.ruby} -S rake release" }
end
end
desc "Run spec examples for Merb More gems, one by one."
task :spec do
gems.each do |gem|
Dir.chdir(gem) { sh "#{Gem.ruby} -S rake spec" }
end
end
desc 'Default: run spec examples for all the gems.'
task :default => 'spec'