Parent

Included Modules

Padrino::Generators::App

Responsible for applications within a Padrino project. Creates and mounts the application and gives the user related information.

Public Class Methods

source_root() click to toggle source

Define the source template root

# File lib/padrino-gen/generators/app.rb, line 13
def self.source_root; File.expand_path(File.dirname(__FILE__)); end

Public Instance Methods

create_app() click to toggle source

Copies over the Padrino base admin application

@api private

# File lib/padrino-gen/generators/app.rb, line 35
def create_app
  self.destination_root = options[:root]
  @app_name = name.gsub(/\W/, "_").underscore.camelize
  if in_app_root?
    self.behavior = :revoke if options[:destroy]
    app_skeleton(@app_name.downcase, options[:tiny])
    empty_directory destination_root("public/#{@app_name.downcase}")
    append_file destination_root("config/apps.rb"),  "\nPadrino.mount(\"#{@app_name}\").to(\"/#{@app_name.downcase}\")"

    return if self.behavior == :revoke
    say
    say "="*65, :green
    say "Your #{@app_name} application has been installed."
    say "="*65, :green
    say "This application has been mounted to /#{@app_name.downcase}"
    say "You can configure a different path by editing 'config/apps.rb"
    say "="*65, :green
    say
  else
    say "You are not at the root of a Padrino application! (config/boot.rb not found)"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.