-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (37 loc) · 1.13 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
require 'bundler/setup'
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:rspec)
RuboCop::RakeTask.new(:lint)
require_relative 'build/version'
require_relative 'lib/version'
task :default => :check
desc 'Run tests and linter'
task :check => %i[rspec lint]
desc 'Generate documentation'
task :doc do
puts `yard --doc - Readme.md Changelog.md`
end
namespace :gem do
GEMNAME = "tracetool-#{Tracetool::Version}.gem".freeze
desc "Build #{GEMNAME}"
task :build => :check do
puts `gem build tracetool.gemspec`
FileUtils.mkdir_p '.out'
FileUtils.mv Dir['tracetool-*.gem'], '.out'
end
desc "Install #{GEMNAME}"
task :install => :build do
puts `gem install .out/#{GEMNAME}`
end
end
namespace :version do
desc 'bump version. version=x,y,z to describe increment'
task :bump do
version = ENV['version'].split(',').map(&:to_i)
# Pad left with 0, so [1, 2] => [0, 1, 2]
version = [0] * [0, (3 - version.length)].max + version
Tracetool::Build::Bumper.new('lib/version.rb')
.bump(major: version[0], minor: version[1], patch: version[2])
end
end