forked from honeybadger-io/honeybadger-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
72 lines (62 loc) · 1.82 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
require 'rubygems'
require 'bundler/setup'
require 'appraisal'
require 'honeybadger/version'
require_relative 'tools/release'
NAME = Dir['*.gemspec'].first.split('.').first.freeze
VERSION = Honeybadger::VERSION
GEM_FILE = "#{NAME}-#{VERSION}.gem".freeze
GEMSPEC_FILE = "#{NAME}.gemspec".freeze
require 'rspec/core/rake_task'
namespace :spec do
desc 'Run unit specs'
RSpec::Core::RakeTask.new(:units) do |t|
t.pattern = 'spec/unit/**/*_spec.rb'
t.rspec_opts = '--require spec_helper'
end
desc 'Run integration specs'
RSpec::Core::RakeTask.new(:integrations) do |t|
t.pattern = 'spec/integration/**/*_spec.rb'
t.rspec_opts = '--require spec_helper'
end
desc 'Run feature specs'
RSpec::Core::RakeTask.new(:features) do |t|
t.pattern = 'spec/features/**/*_spec.rb'
t.rspec_opts = '--require spec_helper'
end
desc 'Runs unit and feature specs'
task all: [:units, :integrations, :features]
end
desc 'Alias for spec:all (default task)'
task spec: :'spec:all'
task test: :spec
task default: :spec
desc "Bump v#{VERSION} to v#{Release.next_version(VERSION)}"
task :bump do
Release.bump
end
desc "Create tag v#{VERSION} and build and push #{GEM_FILE} to Rubygems"
task :release => :build do
unless `git branch` =~ /^\* master$/
puts "You must be on the master branch to release!"
exit!
end
sh "git commit --allow-empty -a -e -m 'Release #{VERSION}'"
sh "git tag v#{VERSION}"
sh "git push origin master"
sh "git push origin v#{VERSION}"
sh "gem push pkg/#{GEM_FILE}"
end
desc "Build #{GEM_FILE} into the pkg directory"
task :build do
sh "mkdir -p pkg"
sh "gem build #{GEMSPEC_FILE}"
sh "mv #{GEM_FILE} pkg"
end
require 'rdoc/task'
RDoc::Task.new do |rdoc|
rdoc.main = 'README.md'
rdoc.markup = 'tomdoc'
rdoc.rdoc_dir = 'doc'
rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
end