Class: Padrino::Cli::Launcher

### Home Classes Methods

### In Files

- lib/padrino-core/cli/launcher.rb

### Parent

Thor

### Methods

- #chdir
- #prepare
- #start
- #stop

### Included Modules

- Thor::Actions

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetup
- Padrino::ApplicationSetup::ClassMethods
- Padrino::AuthenticityToken
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Cli::Launcher
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Loader
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::ApplicationWrapper
- Padrino::Mounter::MounterException
- Padrino::ParamsProtection
- Padrino::ParamsProtection::ClassMethods
- Padrino::ParamsProtection::InstanceMethods
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Reloader::Storage
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::FreeRegex
- HttpRouter::Node::Glob
- HttpRouter::Node::Path
- HttpRouter::Node::SpanningRegex
- HttpRouter::Request
- HttpRouter::Route
- Sinatra
- Sinatra::Base
- Sinatra::Request
- Kernel
- Object
- PadrinoTasks

No matching classes.

# Padrino::Cli::Launcher

### Public Instance Methods

start(*args) click to toggle source

    # File lib/padrino-core/cli/launcher.rb, line 22
    def start(*args)
      prepare :start
      require File.expand_path("../adapter", __FILE__)
      require File.expand_path('config/boot.rb')

      if options[:server_options]
        puts server_options(options)
      else
        Padrino::Cli::Adapter.start(args.last ? options.merge(:config => args.last).freeze : options)
      end
    end

stop() click to toggle source

    # File lib/padrino-core/cli/launcher.rb, line 37
    def stop
      prepare :stop
      require File.expand_path("../adapter", __FILE__)
      Padrino::Cli::Adapter.stop(options)
    end

### Protected Instance Methods

chdir(dir) click to toggle source

    # File lib/padrino-core/cli/launcher.rb, line 83
    def chdir(dir)
      return unless dir
      begin
        Dir.chdir(dir.to_s)
      rescue Errno::ENOENT
        puts "=> Specified Padrino root '#{dir}' does not appear to exist!"
      rescue Errno::EACCES
        puts "=> Specified Padrino root '#{dir}' cannot be accessed by the current user!"
      end
    end

prepare(task) click to toggle source

    # File lib/padrino-core/cli/launcher.rb, line 70
    def prepare(task)
      if options.help?
        help(task.to_s)
        raise SystemExit
      end
      ENV["RACK_ENV"] ||= options.environment.to_s
      chdir(options.chdir)
      unless File.exist?('config/boot.rb')
        puts "=> Could not find boot file in: #{options.chdir}/config/boot.rb !!!"
        raise SystemExit
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.