-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathRakefile
executable file
·76 lines (66 loc) · 1.57 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
72
73
74
75
76
# File name: Rakefile
# Stript type: Rake
# Country/State: Brazil/SP
# Author : William C. Canin
# Page author: http://williamcanin.github.io
# Description: Task creation file for the 'manager.rb' file.
require "./_src/lib/rb/manager.rb"
# Instance class
manager = Manager.new
# Task create header post
# Example: rake post
desc "Create new post"
task :post do
manager.post_create
end
# Task create header page
# Example: rake page
desc "Create new page"
task :page do
manager.page_create
end
# # DEPRECATED!
# # Task to set up after installation
# # Example: rake postinstall
# desc "Setup after installation"
# task :postinstall do
# manager.postinstall
# end
# # UNDER DEVELOPMENT
# # Task to set up before installation
# # Example: rake preinstall
# desc "Setup before installation"
# task :preinstall do
# manager.preinstall
# end
# UNDER DEVELOPMENT
## Task to deploy the compiled project
## Example: rake deploy:public
# desc "Deploy the compiled project"
# namespace :deploy do
# task :public do
# manager.deploy('public', 'public')
# end
# end
# UNDER DEVELOPMENT
## Task to deploy the project source.
## Example: rake deploy:source
# desc "Deploy the project source"
# namespace :deploy do
# task :source do
# manager.deploy('.', 'src')
# end
# end
# Other outputs
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