Class: Configure::Controllers::Install

### Home Classes Methods

### In Files

- lib/mongrel_config/win32_app.rb

### Parent

R'/install'

### Methods

- #bad?
- #get
- #good?
- #post

### Class/Module Index

Quicksearch

- Configure
- Configure::Controllers
- Configure::Controllers::ClearLogs
- Configure::Controllers::Delete
- Configure::Controllers::Index
- Configure::Controllers::Info
- Configure::Controllers::Install
- Configure::Controllers::Kill
- Configure::Controllers::Logs
- Configure::Controllers::Start
- Configure::Controllers::Stop
- Configure::Views
- ConfigTool
- W32Support

No matching classes.

# Configure::Controllers::Install

### Public Instance Methods

bad?(field) click to toggle source

    # File lib/mongrel_config/win32_app.rb, line 113
    def bad?(field)
      not good? field
    end

get() click to toggle source

    # File lib/mongrel_config/win32_app.rb, line 76
    def get
      render :install_form
    end

good?(field) click to toggle source

    # File lib/mongrel_config/win32_app.rb, line 109
    def good?(field)
      field and not field.strip.empty?
    end

post() click to toggle source

    # File lib/mongrel_config/win32_app.rb, line 80
    def post
      options = []
      if bad?(input.service_name) or bad?(input.root) or bad?(input.environment) or bad?(input.address) or bad?(input.port)
        @result = "ERROR: You must fill out all mandatory (*) fields."
        render :install_result
      else
        options << ["-n", input.service_name]
        options << ["-r", '"' + input.root + '"']
        options << ["-e", input.environment]
        options << ["-b", input.address]
        options << ["-p", input.port]
        options << ["-d", input.display_name] if good? input.display_name
        options << ["-m", '"' + input.mime + '"'] if good? input.mime
        options << ["-P", input.num_procs] if good? input.num_procs
        options << ["-t", input.timeout] if good? input.timeout
        options << ["-c", input.cpu] if good? input.cpu

        begin
          @result = `ruby #$mongrel_rails_service install #{options.join(' ')}`
          $service_logs << @result
        rescue
          @result = "Failed to start #{input.service_name}: #$!"
          $service_logs << @result
        end

        render :install_result
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.