-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.rb
More file actions
27 lines (24 loc) · 844 Bytes
/
application.rb
File metadata and controls
27 lines (24 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Application < Rhosync::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(blob)
super #=> returns blob[:tempfile]
end
end
end
Application.initializer(ROOT_PATH)