Passing args to generator


#1

I have some default_options in generator and when I wish to change they
value with --option_name I get only logical true instead of string

default_options :option_name => “Some string”

def add_options!(opt)
opt.separator ‘’
opt.separator ‘Options:’
opt.on("–option_name",“Some Text”) { |v| options[:option_name] = v }
end


#2

Description:
Generating list,edit,save and show partials for tasks from TrstSysTask
table, based on ‘exe_id’ value.
Convention:
base_path /app/views/trst_sys (change with --controller_path)
partial_path base_path/xxx/yyy/zzz/_*.html.erb with “./script/generate
task_partial xxx_yyy_zzz”
or partial_path base_path/xxx/yyy/_zzz.html.erb with
“./script/generate task_partial xxx_yyy_zzz --single”
Example:
“./script/generate task_partial db_sys_menu” =>
/app/views/trst_sys/db/sys/menu/_list.html.erb, _edit.html.rb …
“./script/generate task_partial db_sys_menu --single” =>
/app/views/trst_sys/db/sys/_menu.html.erb
“./script/generate task_partial db_sys_menu --single --controller_path
“other_path”” =>
/app/views/other_path/db/sys/_menu.html.erb

That’s what I need.
But as I mentioned above using --controller_path always returns logical
true

/app/views/…true…/db/sys/_menu.html.erb

Arghhh