lib/padrino-gen/generators/app.rb in padrino-gen-0.9.10 vs lib/padrino-gen/generators/app.rb in padrino-gen-0.9.11

- old
+ new

@@ -16,28 +16,29 @@ desc "Description:\n\n\tpadrino-gen app generates a new Padrino application" argument :name, :desc => "The name of your padrino application" - class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string - class_option :destroy, :aliases => '-d', :default => false, :type => :boolean + class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string + class_option :destroy, :aliases => '-d', :default => false, :type => :boolean + class_option :tiny, :desc => "Generate tiny app skeleton", :aliases => '-i', :default => false, :type => :boolean # Show help if no argv given require_arguments! # Copies over the Padrino base admin application def create_app self.destination_root = options[:root] - @class_name = name.gsub(/\W/, "_").underscore.classify + @app_name = name.gsub(/\W/, "_").underscore.classify if in_app_root? - directory("app/", destination_root(name)) - append_file destination_root("config/apps.rb"), "\nPadrino.mount(\"#{@class_name}\").to(\"/#{name.underscore}\")" + app_skeleton(name, options[:tiny]) + append_file destination_root("config/apps.rb"), "\nPadrino.mount(\"#{@app_name}\").to(\"/#{name.underscore}\")" return if self.behavior == :revoke say (<<-TEXT).gsub(/ {10}/,'') ================================================================= - Your #{@class_name} application has been installed. + Your #{@app_name} application has been installed. This application has been mounted to /#{name.underscore} You can configure a different path by editing 'config/apps.rb' ================================================================= TEXT \ No newline at end of file