Class: Object

### Home Classes Methods

### In Files

- lib/padrino-core.rb
- lib/padrino-core/cli/console.rb
- lib/padrino-core/cli/rake.rb
- lib/padrino-core/cli/rake_tasks.rb
- lib/padrino-core/logger.rb

### Parent

BasicObject

### Methods

- #applications
- #list_app_routes
- #reload!
- #shell

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetupError
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Erubis
- Padrino::Erubis::SafeBufferEnhancer
- Padrino::Erubis::SafeBufferTemplate
- Padrino::Erubis::Template
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::MounterException
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Rendering
- Padrino::Rendering::ClassMethods
- Padrino::Rendering::InstanceMethods
- Padrino::Rendering::SafeTemplate
- Padrino::Rendering::TemplateNotFound
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- Padrino::Utils
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::Path
- HttpRouter::Request
- HttpRouter::Route
- Haml
- Haml::Helpers
- Haml::Util
- Sinatra
- Sinatra::Request
- Slim
- Slim::Template
- Tilt
- Tilt::HamlTemplate
- FileSet
- Kernel
- Module
- Object
- ObjectSpace
- PadrinoTasks
- String
- SupportLite

No matching classes.

# Object

### Constants

PADRINO_ENV

  The Padrino environment (falls back to the rack env or finally develop)

PADRINO_LOGGER

  Defines the logger used for a Padrino project.

PADRINO_LOG_LEVEL

  Defines the log level for a Padrino project.

PADRINO_ROOT

  The Padrino project root path (falls back to the first caller)

### Public Instance Methods

applications() click to toggle source

Show applications

    # File lib/padrino-core/cli/console.rb, line 7
    def applications
      puts "==== List of Mounted Applications ====\n\n"
      Padrino.mounted_apps.each do |app|
        puts " * %-10s mapped to      %s" % [app.name, app.uri_root]
      end
      puts
      Padrino.mounted_apps.map { |app| "#{app.name} => #{app.uri_root}" }
    end

list_app_routes(app, args) click to toggle source

lists all routes of a given app

    # File lib/padrino-core/cli/rake_tasks.rb, line 26
    def list_app_routes(app, args)
      app_routes = app.named_routes
      app_routes.reject! { |r| r.identifier.to_s !~ /#{args.query}/ } if args.query.present?
      app_routes.map! { |r| [r.verb, r.name, r.path] }
      return if app_routes.empty?
      shell.say "\nApplication: #{app.app_class}", :yellow
      app_routes.unshift(["REQUEST", "URL", "PATH"])
      max_col_1 = app_routes.max { |a, b| a[0].size <=> b[0].size }[0].size
      max_col_2 = app_routes.max { |a, b| a[1].size <=> b[1].size }[1].size
      app_routes.each_with_index do |row, i|
        message = [row[1].ljust(max_col_2+2), row[0].center(max_col_1+2), row[2]]
        shell.say("    " + message.join(" "), i==0 ? :bold : nil)
      end
    end

reload!() click to toggle source

Reloads classes

    # File lib/padrino-core/cli/console.rb, line 2
    def reload!
      Padrino.reload!
    end

shell() click to toggle source

    # File lib/padrino-core/cli/rake.rb, line 45
    def shell
      @_shell ||= Thor::Base.shell.new
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.