lib/rubigen/scripts.rb
# Run the generator script.  Takes an array of unparsed arguments
# and a hash of parsed arguments, takes the generator as an option
# or first remaining argument, and invokes the requested command.
Run the generator script.  Takes an array of unparsed arguments
and a hash of parsed arguments, takes the generator as an option
or first remaining argument, and invokes the requested command.
Run the generator script . Takes an array of unparsed arguments and a hash of parsed arguments takes the generator as an option or first remaining argument and invokes the requested command .
def run(args = [], runtime_options = {})
        @stdout = runtime_options[:stdout] || $stdout
        begin
          parse!(args.dup, runtime_options)
        rescue OptionParser::InvalidOption => e
        end
        unless options[:generator]
          usage if args.empty?
          options[:generator] ||= args.shift
        end
        RubiGen::Base.instance(options[:generator], args, options).command(options[:command]).invoke!
      rescue => e
        stdout.puts e
        stdout.puts "  #{e.backtrace.join("\n  ")}\n" if options[:backtrace]
        raise SystemExit unless options[:no_exit]
      end
def run ( args = [ ] , runtime_options = { } ) @stdout = runtime_options [ :stdout ] || $stdout begin parse! ( args . dup , runtime_options ) rescue OptionParser :: InvalidOption => e end unless options [ :generator ] usage if args . empty? options [ :generator ] ||= args . shift end RubiGen :: Base . instance ( options [ :generator ] , args , options ) . command ( options [ :command ] ) . invoke! rescue => e stdout . puts e stdout . puts "  #{e.backtrace.join("\n  ")}\n" if options [ :backtrace ] raise SystemExit unless options [ :no_exit ] end
Run the generator script.
Run the generator script .
# Don't cry, script. Generators want what you think is invalid. # Generator name is the only required option. # Look up generator instance and invoke command on it.
args
<not_specific>
runtime_options
<not_specific>