forked from kbrock/cache-money
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathRakefile
49 lines (41 loc) · 1.21 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
require 'rubygems'
require 'bundler/setup'
Bundler.require :default, 'development'
require File.expand_path('../config/environment', __FILE__)
begin
require 'rake/testtask'
require 'rake/rdoctask'
require 'spec/rake/spectask'
rescue MissingSourceFile
STDERR.puts "Error, could not load rake/rspec tasks! (#{$!})\n\nDid you run `bundle install`?\n\n"
exit 1
end
require 'lib/cash/version'
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.spec_opts = ['--format', 'profile', '--color']
end
Spec::Rake::SpecTask.new(:coverage) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_opts = ['-x', 'spec,gems']
end
desc "Default task is to run specs"
task :default => :spec
namespace :britt do
desc 'Removes trailing whitespace'
task :space do
sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
end
end
task :build do
system "gem build ngmoco-cache-money.gemspec"
end
desc "Push a new version to Gemcutter"
task :publish => [ :spec, :build ] do
system "git tag v#{Cash::VERSION}"
system "git push origin v#{Cash::VERSION}"
system "git push origin master"
system "gem push ngmoco-cache-money-#{Cash::VERSION}.gem"
system "git clean -fd"
end