-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathRakefile
32 lines (28 loc) · 884 Bytes
/
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
$:.unshift(File.dirname(__FILE__) + '/lib')
require "rubygems"
require "bundler"
require "rspec/core/rake_task"
require 'ruby-metrics/version'
desc 'Build gem into the pkg directory'
task :build do
FileUtils.rm_rf('pkg')
Dir['*.gemspec'].each do |gemspec|
puts "Building #{gemspec}"
system "gem build #{gemspec}"
end
FileUtils.mkdir_p('pkg')
FileUtils.mv(Dir['*.gem'], 'pkg')
end
desc 'Tags version, pushes to remote, and pushes gem'
task :release => :build do
puts "Releasing v#{Metrics::VERSION}"
sh 'git', 'tag', '-m', "Version #{Metrics::VERSION}", "v#{Metrics::VERSION}"
sh "git push origin master"
sh "git push origin v#{Metrics::VERSION}"
sh "ls pkg/*.gem | xargs -n 1 gem push"
end
RSpec::Core::RakeTask.new do |t|
t.rspec_opts = ["-c", "-f progress", "-r ./spec/spec_helper.rb"]
t.pattern = 'spec/**/*_spec.rb'
end
task :default => :spec