-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (36 loc) · 784 Bytes
/
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
require 'rake'
# Include all rake files in the tasks directory
Dir.glob('tasks/*.rake').each { |r| import r }
task :default => 'install'
# Default utility functions available in all tasks
def ok_failed(condition)
if (condition)
puts "OK"
else
puts "FAILED"
end
end
def get_stdin(message)
print message
STDIN.gets.chomp
end
def ask(message, valid_options)
if valid_options
answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer)
else
answer = get_stdin(message)
end
answer
end
def mac?
(/darwin/ =~ RUBY_PLATFORM) != nil
end
def windows?
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
def unix?
not windows?
end
def linux?
unix? and not mac?
end