Closed lebogan closed 8 years ago
Thanks, great suggestion. I've updated the title to be a little clearer.
Please note: I am a network engtineer, not a software developer. I leave that to the pros.
That said, I managed to come up with a solution using bundler and commander. I have written a program using commander 'classic-style' to write a here-doc to a file in project_dir/exe. I used the commander source as an inspiration.
This solves my issue for now.
Thanks for this great software.
exe_name = ask('Name of executable: ').strip exe_description = ask 'Description of executable: ' exe_commands = ask_for_array 'List commands: ' exe_file = "#{project}/exe/#{exe_name}" begin File.open(exe_file, 'w') do | f | f.write <<-"...".gsub!(/^\s+ | /, '') | #!/usr/bin/env ruby |
---|---|---|---|---|
require 'rubygems' | ||||
require 'commander' | ||||
require "#{project}/version" | ||||
# Main class | ||||
class MyApplication | ||||
include Commander::Methods | ||||
# include whatever else you need | ||||
This can probably be closed unless it's accepted as a future feature request.
Thanks.
I don't have another way to track feature requests so leaving the issue open is fine. If you feel like attempting the patch to bin/commander
go for it...
Ok. I repeat - I'm not a software developer. I think I have something to submit as soon as I can figure out how to do a 'pull request?'. I committed my patch to lebogan/commander.
I want to close this with the release of 4.4.0. Ok?
Oops, good catch, closing!
Is it possible to heve 'commander init' generate a modular-style stub? If not now, may I submit this as a new feature request?
Thank you for the great dsl.
Lewis