Sha256: 4d7cb98a5992e4dd4b5825126b571c7aa68ecb89d2efd70b99c4d0b287e5dd50

Contents?: true

Size: 1.17 KB

Versions: 57

Compression:

Stored size: 1.17 KB

Contents

class Application < Rhoconnect::Base
  class << self
    def authenticate(username,password,session)
      true # do some interesting authentication here...
    end
    
    # Add hooks for application startup here
    # Don't forget to call super at the end!
    def initializer(path)
      super
    end
    
    # Calling super here returns rack tempfile path:
    # i.e. /var/folders/J4/J4wGJ-r6H7S313GEZ-Xx5E+++TI
    # Note: This tempfile is removed when server stops or crashes...
    # See http://rack.rubyforge.org/doc/Multipart.html for more info
    # 
    # Override this by creating a copy of the file somewhere
    # and returning the path to that file (then don't call super!):
    # i.e. /mnt/myimages/soccer.png
    def store_blob(object,field_name,blob)
      super #=> returns blob[:tempfile]
    end
  end
end

Application.initializer(ROOT_PATH)

# Support passenger smart spawning/fork mode:
if defined?(PhusionPassenger)
  PhusionPassenger.on_event(:starting_worker_process) do |forked|
    if forked
      # We're in smart spawning mode.
      Store.db.client.reconnect
    else
      # We're in conservative spawning mode. We don't need to do anything.
    end
  end
end

Version data entries

57 entries across 35 versions & 1 rubygems

Version Path
rhoconnect-3.4.5 bench/benchapp/application.rb
rhoconnect-3.4.4 bench/benchapp/application.rb
rhoconnect-3.4.3 bench/benchapp/application.rb
rhoconnect-3.4.2 bench/benchapp/application.rb
rhoconnect-3.3.6 bench/benchapp/application.rb
rhoconnect-3.3.5 bench/benchapp/application.rb
rhoconnect-3.3.4 bench/benchapp/application.rb
rhoconnect-3.3.3 bench/benchapp/application.rb
rhoconnect-3.3.2 bench/benchapp/application.rb
rhoconnect-3.3.1 bench/benchapp/application.rb
rhoconnect-3.3.1.beta4 bench/benchapp/application.rb
rhoconnect-3.3.1.beta3 bench/benchapp/application.rb
rhoconnect-3.3.1.beta2 bench/benchapp/application.rb
rhoconnect-3.2.1 bench/benchapp/application.rb
rhoconnect-3.2.1 generators/templates/application/application.rb
rhoconnect-3.2.0 generators/templates/application/application.rb
rhoconnect-3.2.0 bench/benchapp/application.rb
rhoconnect-3.2.0.beta5 bench/benchapp/application.rb
rhoconnect-3.2.0.beta5 generators/templates/application/application.rb
rhoconnect-3.2.0.beta4 generators/templates/application/application.rb