-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
67 lines (54 loc) · 1.44 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
# frozen_string_literal: true
require 'bundler/gem_tasks'
# refs:
# * https://relishapp.com/rspec/rspec-core/v/3-10/docs/command-line/rake-task
# * https://github.com/rspec/rspec-core/blob/ea8554afd1a2b63677c6593059fa8f2476181deb/lib/rspec/core/rake_task.rb
# * https://github.com/rspec/rspec-core/blob/ea8554afd1a2b63677c6593059fa8f2476181deb/spec/rspec/core/rake_task_spec.rb
require 'rspec/core/rake_task'
require 'irb/color'
RSpec::Core::RakeTask.new(:spec) do |t|
t.ruby_opts = %w[-w]
end
task :look_at_examples do
puts IRB::Color.colorize_code(File.read('./examples/spec/example_spec.rb'))
end
RSpec::Core::RakeTask.new(:run_examples) do |t|
t.pattern = 'examples/**{,/*/**}/*_spec.rb'
end
task default: [:spec]
begin
require 'rubocop/rake_task'
rescue LoadError
puts 'can not use rubocop in this environment'
else
RuboCop::RakeTask.new
end
task(:view_packaging_files) do
sh('rm -rf ./pkg')
sh('rake build')
cd('pkg') do
sh('gem unpack *.gem')
sh('tree -I *\.gem')
end
sh('rm -rf ./pkg')
end
task(:update) do
sh('dprint config update --yes')
end
desc 'Print dependencies'
task :deps do
sh('ruby --version')
sh('dprint --version')
sh('tree --version')
sh('typos --version')
end
desc 'Tests except ruby'
task :linters do
sh('typos . .github .vscode')
sh('dprint check')
sh('nixfmt --check ./*.nix')
end
desc 'https://github.com/kachick/selfup'
task :selfup do
sh('git ls-files | xargs selfup run')
end