-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
84 lines (71 loc) · 1.94 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
require "rubygems"
require "pathname"
require "rake"
require "rake/testtask"
require "spec/rake/spectask"
# Specs
task :default => [:spec, :test]
Spec::Rake::SpecTask.new("spec") do |t|
t.spec_opts << "--colour" << "--loadby" << "random"
t.spec_files = Dir["spec/**/*_spec.rb"]
end
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"]
t.verbose = true
end
# rcov
Spec::Rake::SpecTask.new("rcov") do |t|
t.spec_opts << "--colour" << "--loadby" << "random"
t.rcov = true
t.spec_files = Dir["spec/**/*_spec.rb"]
t.rcov_opts << "--exclude" << "spec,environment.rb"
t.rcov_opts << "--text-summary"
t.rcov_opts << "--sort" << "coverage" << "--sort-reverse"
end
# Performance
task :perf => :performance
task :performance do
puts `ruby #{Pathname(__FILE__).dirname + "script/performance.rb"}`
end
# Gem
require "rake/gempackagetask"
NAME = "wheels"
SUMMARY = "Wheels Framework"
GEM_VERSION = "0.3.4"
spec = Gem::Specification.new do |s|
s.name = NAME
s.summary = s.description = SUMMARY
s.author = "Wieck Media"
s.email = "[email protected]"
s.version = GEM_VERSION
s.platform = Gem::Platform::RUBY
s.require_path = 'lib'
s.files = %w(Rakefile) + Dir.glob("lib/**/*")
s.executables = ['wheels']
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "Install Wheels as a gem"
task :install => [:repackage] do
sh %{gem install pkg/#{NAME}-#{GEM_VERSION}}
end
desc "Publish Wheels gem"
task :publish do
STDOUT.print "Publishing gem... "
STDOUT.flush
`git tag -a #{GEM_VERSION} -m "v. #{GEM_VERSION}" &> /dev/null`
`git push --tags &> /dev/null`
commands = [
"if [ ! -d '#{NAME}' ]; then git clone git://github.com/wiecklabs/wheels.git; fi",
"cd #{NAME}",
"git pull &> /dev/null",
"rake repackage &> /dev/null",
"cp pkg/* ../site/gems",
"cd ../site",
"gem generate_index"
]
`ssh [email protected] "#{commands.join(" && ")}"`
STDOUT.puts "done"
end