-
Notifications
You must be signed in to change notification settings - Fork 152
/
Rakefile
63 lines (51 loc) · 1.39 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
require 'rubygems'
require 'rubygems/package_task'
require 'rspec/core'
require 'rspec/core/rake_task'
def gemspec
$ripple_gemspec ||= Gem::Specification.load("ripple.gemspec")
end
Gem::PackageTask.new(gemspec) do |pkg|
pkg.need_zip = false
pkg.need_tar = false
end
task :gem => :gemspec
desc %{Validate the gemspec file.}
task :gemspec do
gemspec.validate
end
desc %{Release the gem to RubyGems.org}
task :release => :gem do
system "gem push pkg/#{gemspec.name}-#{gemspec.version}.gem"
end
desc "Cleans up white space in source files"
task :clean_whitespace do
no_file_cleaned = true
Dir["**/*.rb"].each do |file|
contents = File.read(file)
cleaned_contents = contents.gsub(/([ \t]+)$/, '')
unless cleaned_contents == contents
no_file_cleaned = false
puts " - Cleaned #{file}"
File.open(file, 'w') { |f| f.write(cleaned_contents) }
end
end
if no_file_cleaned
puts "No files with trailing whitespace found"
end
end
desc "Run Unit Specs Only"
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.rspec_opts = %w[--profile --tag ~integration]
end
namespace :spec do
desc "Run Integration Specs Only"
RSpec::Core::RakeTask.new(:integration) do |spec|
spec.rspec_opts = %w[--profile --tag integration]
end
desc "Run All Specs"
RSpec::Core::RakeTask.new(:all) do |spec|
spec.rspec_opts = %w[--profile]
end
end
task :default => "spec:all"