Module: UnicornHorn::Utils
- Defined in:
- lib/unicorn_horn/utils.rb
Class Method Summary collapse
Class Method Details
.proc_name(foo) ⇒ Object
18 19 20 21 22 |
# File 'lib/unicorn_horn/utils.rb', line 18 def proc_name foo @orig_zero ||= $0 @orig_argv ||= ARGV.join(' ') $0 = "#{@orig_zero} #{foo} #{@orig_argv}" end |
.tmpio ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/unicorn_horn/utils.rb', line 7 def tmpio fp = File.open("#{Dir::tmpdir}/#{rand}", File::RDWR|File::CREAT|File::EXCL, 0600) File.unlink(fp.path) fp.binmode fp.sync = true fp rescue Errno::EEXIST retry end |