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
77
|
# File 'lib/rails/generators/rorchado/rorchado_generator.rb', line 26
def GeneratorHandler
command = "#{command_name}".downcase
module_name = "#{options.module}".downcase
if !@valid_commands.include?( command ) then
puts "The command '#{command}' is not supported by RoRChado gem."
elsif command=="help" then
puts "List of available commands:"
@valid_commands.each do |command|
puts " - #{command} , e.g. rails g rorchado #{command} [OPTIONS]"
end
elsif command=="list" then
puts "List of available Chado modules:"
@valid_modules.each do |module_tmp|
puts " - #{module_tmp}"
end
else
if module_name == "all" then
@valid_modules.each do |module_tmp|
send("#{command.capitalize}Module" , module_tmp )
end
else
found = false
@valid_modules.each do |module_tmp|
if module_tmp == module_name then
found = true
break
end
end
if found then
send("#{command.capitalize}Module" , module_name )
else
if module_name == "admin" then
send("#{command.capitalize}Admin")
else
puts "The module '#{module_name}' is not supported by RoRChado gem."
end
end
end
end
end
|