-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
57 lines (48 loc) · 1.27 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
# frozen_string_literal: true
# Rakefile
require 'rake/testtask'
require 'rdoc/task'
require 'bundler/gem_tasks'
# Task to format code using RuboCop
desc 'Format Ruby code'
task :format do
# echo to console what is happening
puts 'Running RuboCop with auto-correct...'
sh 'rubocop -A'
end
# Task to lint code using RuboCop
desc 'Lint Ruby code'
task :lint do
puts 'Running RuboCop...'
sh 'rubocop'
end
# Task to run unit tests using Minitest
Rake::TestTask.new do |t|
puts 'Running Minitest...'
t.libs << 'test'
t.test_files = FileList['test/**/*_test.rb']
t.warning = true
end
# Task to generate documentation using RDoc
RDoc::Task.new do |rdoc|
puts 'Generating RDoc documentation...'
rdoc.rdoc_dir = 'doc'
rdoc.title = 'Isopod Game Documentation'
rdoc.options << '--all'
rdoc.rdoc_files.include('lib/**/*.rb', '*.rb')
end
# Task to create a distributable gem package
task :build do
puts 'Building gem...'
sh 'gem build isopod_game.gemspec'
end
# Task to clean generated files
desc 'Clean generated files'
task :clean do
puts 'Cleaning generated files...'
sh 'rm -rf doc'
sh 'rm -f *.gem'
end
# Default task to run all the above tasks
desc 'Run all tasks: format, lint, test, build, and generate docs'
task default: %i[format lint test build rdoc]