-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
57 lines (47 loc) · 1.05 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
require 'bundler'
Bundler::GemHelper.install_tasks
require 'rake/testtask'
namespace :test do
Rake::TestTask.new(:unit) do |t|
t.libs.push('lib', 'test')
t.test_files = FileList['test/**/test_*.rb']
t.verbose = true
t.warning = true
end
end
namespace :generate do
desc 'Generates golden file for testing'
task :golden do
sh '\
cat ./test/proto/addressbook | \
protoc \
--encode=tutorial.AddressBook \
--proto_path=./test/proto/ \
./test/proto/addressbook.proto \
> ./test/proto/addressbook.bin'
end
desc 'Generates Ruby Protobuf classes'
task :proto do
sh 'protoc --proto_path=./test/proto --ruby_out=./test/proto ./test/proto/addressbook.proto '
end
end
namespace :lint do
desc 'Linting'
task :check do
sh 'rubocop'
end
desc 'Auto correcting lint errors'
task :fix do
sh 'rubocop --auto-correct'
end
end
desc 'Building ruby gem'
task :build do
sh 'gem build *.gemspec'
end
desc 'Listing all tasks'
task :help do
sh 'rake --tasks'
end
task default: [:help]