Creating a rails 3 app generator executable using thor

For inspiration I have been looking into rails 3.0pre

I found this in the file bin/rails

except I run into the following issue

module Nifty
  module Generators
    class ScaffoldGenerator < Base
...
      def initialize(*args, &block)
        super

        args_for_c_m.each do |arg|
          if arg == '!'
            options[:invert] = true <<<<<< line 53
...
        if @model_attributes.empty?
          options[:skip_model] = true <<<<<<<<

end

I fixed it with a pretty ugly hack :stuck_out_tongue:

      def initialize(*args, &block)
        super

        @my_options ||= {}
...
          if arg == '!'
            @my_options[:invert] = true
...
        if @model_attributes.empty?
          @my_options[:skip_model] = true

      def do_skip_model?
        options.skip_model? || @my_options[:skip_model]
      end

      def do_invert?
        options.invert? || @my_options[:invert]
      end

      def create_model
        unless do_skip_model?
...

I'm sure there must be better ways around this!

I have also managed to create executables for all my generators!

http://github.com/kristianmandrup/very_nifty_generators

Enjoy!