10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/rails_wizard/command.rb', line 10
def new(name)
if options[:scrolls]
run_template(name, options[:scrolls], options[:template])
else
@scrolls = []
while scroll = ask("#{print_scrolls}#{bold}Which scroll would you like to add? #{clear}#{yellow}(blank to finish)#{clear}")
if scroll == ''
run_template(name, @scrolls)
break
elsif RailsWizard::Scrolls.list.include?(scroll)
@scrolls << scroll
puts
puts "> #{green}Added '#{scroll}' to template.#{clear}"
else
puts
puts "> #{red}Invalid scroll, please try again.#{clear}"
end
end
end
end
|