Module: Meribah

Defined in:
lib/meribah.rb,
app/controllers/meribah/download_controller.rb

Defined Under Namespace

Modules: Controller Classes: DownloadController, Engine

Constant Summary collapse

META_TAG =
"<meta http-equiv='refresh' content='1;url=/meribah/download' />"
JAVASCRIPT_TAG =
"<script type='text/javascript'>window.open('/meribah/download')</script>"
IFRAME_TAG =
"<iframe style='display:none;' src='/meribah/download'></iframe>"
TEMPFILES =
Set.new
MUTEX =
Mutex.new

Class Method Summary collapse

Class Method Details

.setup {|_self| ... } ⇒ Object

Yield self on setup for nice config blocks

Yields:

  • (_self)

Yield Parameters:

  • _self (Meribah)

    the object that the method was called on



17
18
19
# File 'lib/meribah.rb', line 17

def self.setup
  yield self
end

.temp_fileObject

Generate a temporary file name



22
23
24
25
26
27
# File 'lib/meribah.rb', line 22

def self.temp_file()
  while true
    path = "#{Rails.root}/tmp/meribah_#{rand(8999999)+1000000}"
    return path unless File.exist? path
  end
end