-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRakefile
More file actions
37 lines (29 loc) · 755 Bytes
/
Rakefile
File metadata and controls
37 lines (29 loc) · 755 Bytes
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
# vim: set ts=2 sw=2 ai et:
# Does the current user have root privileges?
#
# @return [Boolean] true if user can exercise root privileges;
# false if user does not have privileges OR we're on a
# non-posix platform
def got_root?
# attempt to exercise privilege
Process::Sys.setuid(0)
true
rescue Errno::EPERM
false
end
abort 'Must not run as root' if got_root?
require 'bundler/setup'
require 'bundler/settings'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'fileutils'
task default: :help
desc 'Display the list of available rake tasks'
task :help do
system('rake -T')
end
RuboCop::RakeTask.new
desc 'Run rspec tests'
RSpec::Core::RakeTask.new(:spec_standalone)
desc 'Run all tests'
task spec: :spec_standalone