-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
71 lines (58 loc) · 2.25 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
# frozen_string_literal: true
# ==============================================================================
# Bundler
# ------------------------------------------------------------------------------
require "bundler/gem_tasks"
# ==============================================================================
# Console
# ------------------------------------------------------------------------------
desc "Open an IRB session preloaded with this library"
task :console do
sh "bin/console"
end
desc "Alias of console"
task :c, [] => :console
# ==============================================================================
# Docs
# ------------------------------------------------------------------------------
desc "Runs a live-reloading server for viewing documentation"
task :docs do
sh "yard server --reload"
end
# ==============================================================================
# Minitest
# ------------------------------------------------------------------------------
require "minitest/test_task"
Minitest::TestTask.create do |task|
task.test_prelude = %(require "initializers/simplecov")
task.framework = %(require "initializers/minitest")
task.test_globs = ENV.fetch("TEST", "test/**/*_test.rb").split(",")
end
# ==============================================================================
# RuboCop
# ------------------------------------------------------------------------------
require "rubocop/rake_task"
RuboCop::RakeTask.new
# ==============================================================================
# SyntaxTree
# ------------------------------------------------------------------------------
require "syntax_tree/rake_tasks"
configure_syntax_tree = ->(task) do
# should match the version in gemspec
task.target_ruby_version = "3.2.0"
task.source_files =
FileList[
"Gemfile",
"Rakefile",
".simplecov",
"nummy.gemspec",
"lib/**/*.rb",
"test/*.rb"
]
end
SyntaxTree::Rake::CheckTask.new(&configure_syntax_tree)
SyntaxTree::Rake::WriteTask.new(&configure_syntax_tree)
# ==============================================================================
# Default
# ------------------------------------------------------------------------------
task :default, [] => %i[test rubocop stree:check]