forked from ngmoco/cache-money
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
79 lines (72 loc) · 2.09 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
begin
require File.expand_path('../.bundle/environment', __FILE__)
rescue LoadError
begin
require 'rubygems'
require 'bundler'
Bundler.require
rescue
require File.expand_path('../config/environment', __FILE__)
end
end
begin
require 'rake/testtask'
require 'rake/rdoctask'
require 'rspec/core/rake_task'
rescue
puts $!.backtrace
puts $!.inspect
STDERR.puts "Error, could not load rake/rspec tasks! (#{$!})\n\nDid you run `bundle install`?\n\n"
exit 1
end
jt = Jeweler::Tasks.new do |gem|
gem.name = "sreeix-cache-money"
gem.summary = "Write-through and Read-through Cacheing for ActiveRecord"
gem.description = "Write-through and Read-through Cacheing for ActiveRecord"
gem.email = "teamplatform@ngmoco.com"
gem.homepage = "http://github.com/sreeix/cache-money"
gem.authors = ["Nick Kallen","Ashley Martens","Scott Mace","John O'Neill"]
gem.has_rdoc = false
gem.files = FileList[
"README",
"TODO",
"UNSUPPORTED_FEATURES",
"lib/**/*.rb",
"rails/init.rb",
"init.rb"
]
gem.test_files = FileList[
"config/*",
"db/schema.rb",
"spec/**/*.rb"
]
gem.add_dependency("activerecord", [">= 2.2.0"])
gem.add_dependency("activesupport", [">= 2.2.0"])
end
Jeweler::GemcutterTasks.new
RSpec::Core::RakeTask.new do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
# Put spec opts in a file named .rspec in root
end
desc "Generate code coverage"
RSpec::Core::RakeTask.new(:coverage) do |t|
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
t.rcov = true
t.rcov_opts = ['--exclude', '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
desc "Push a new version to Gemcutter"
task :publish => [:build ] do
system "git tag v#{jt.jeweler.version}"
system "git push origin v#{jt.jeweler.version}"
system "git push origin master"
system "gem push pkg/sreeix-cache-money-#{jt.jeweler.version}.gem"
system "git clean -fd"
end