forked from ruhoh/ruhoh.rb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
35 lines (28 loc) · 822 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
33
34
35
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
require 'rubygems'
require 'rake'
require 'bundler'
require 'ruhoh/version'
require 'rspec/core/rake_task'
name = Dir['*.gemspec'].first.split('.').first
gemspec_file = "#{name}.gemspec"
gem_file = "#{name}-#{Ruhoh::VERSION}.gem"
task :release => :build do
sh "git commit --allow-empty -m 'Release #{Ruhoh::VERSION}'"
sh "git tag v#{Ruhoh::VERSION}"
sh "git push origin master --tags"
sh "git push origin v#{Ruhoh::VERSION}"
sh "gem push pkg/#{name}-#{Ruhoh::VERSION}.gem"
end
task :build do
sh "mkdir -p pkg"
sh "gem build #{gemspec_file}"
sh "mv #{gem_file} pkg"
end
task :install => :build do
sh "gem install pkg/#{name}-#{Ruhoh::VERSION}.gem"
end
## Tests
RSpec::Core::RakeTask.new('spec')
desc "Run tests"
task :default => :spec