forked from ruby-git/ruby-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
79 lines (60 loc) · 1.89 KB
/
Rakefile
File metadata and controls
79 lines (60 loc) · 1.89 KB
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
73
74
75
76
77
78
79
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'English'
require 'git/version'
default_tasks = []
desc 'Run Unit Tests'
task :test do
sh 'ruby bin/test'
# You can run individual test files (or multiple files) from the command
# line with:
#
# $ bin/test test_archive.rb
#
# $ bin/test test_archive.rb test_object.rb
end
default_tasks << :test
# Rubocop
require 'rubocop/rake_task'
RuboCop::RakeTask.new
default_tasks << :rubocop
# YARD
unless RUBY_PLATFORM == 'java' || RUBY_ENGINE == 'truffleruby'
#
# YARD documentation for this project can NOT be built with JRuby.
# This project uses the redcarpet gem which can not be installed on JRuby.
#
require 'yard'
YARD::Rake::YardocTask.new
CLEAN << '.yardoc'
CLEAN << 'doc'
default_tasks << :yard
require 'yardstick/rake/verify'
Yardstick::Rake::Verify.new(:'yardstick:coverage') do |t|
t.threshold = 50
t.require_exact_threshold = false
end
default_tasks << :'yardstick:coverage'
desc 'Run yardstick to check yard docs'
task :yardstick do
sh "yardstick 'lib/**/*.rb'"
end
# Do not include yardstick as a default task for now since there are too many
# warnings. Will work to get the warnings down before re-enabling it.
#
# default_tasks << :yardstick
end
default_tasks << :build
task default: default_tasks
desc 'Build and install the git gem and run a sanity check'
task 'test:gem': :install do
output = `ruby -e "require 'git'; g = Git.open('.'); puts g.log.size"`.chomp
raise 'Gem test failed' unless $CHILD_STATUS.success?
raise 'Expected gem test to return an integer' unless output =~ /^\d+$/
puts 'Gem Test Succeeded'
end
# Make it so that calling `rake release` just calls `rake release:rubygem_push` to
# avoid creating and pushing a new tag.
Rake::Task['release'].clear
desc 'Customized release task to avoid creating a new tag'
task release: 'release:rubygem_push'