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
|
# File 'lib/tane/commands/create.rb', line 4
def process(args)
authenticate_user
app_name = args[0] ||= term.ask("Please enter a name for your new app: ") { |app_name| app_name }
template_url = ENV['KIMONO_URL'] || "https://raw.github.com/Bushido/kimono/master/kimono.rb"
print "Creating a new Bushido rails app in #{ app_name } ... "
system("rails new #{app_name} -m #{ template_url } > tane.log")
Dir.chdir("./#{app_name}")do
system("bundle exec tane init > ../tane.log")
end
success_messages = ["Let the hacking commence!",
"Hacks and glory await!",
"Hack and be merry!",
"Your hacking starts... NOW!",
"May the source be with you!",
"Take this demi-REPL, dear friend, and may it serve you well.",
"Lemonodor-fame is but a hack away!",
"Go forth to #{ app_name }, and hack for all you're worth - for all mankind!"]
success_message = success_messages[ rand(success_messages.length) ]
FileUtils.mv("./tane.log", "./#{ app_name }/log/tane.log")
puts "Finished successfully!"
puts "Your app is now in ./#{ app_name } . #{ success_message }"
end
|