Sha256: 3ff9c276aa60f34dc2e6a37ed4402a761863e2d5b4c07213f537f32770d7355c
Contents?: true
Size: 577 Bytes
Versions: 15
Compression:
Stored size: 577 Bytes
Contents
lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../lib')) if File.exist?(File.join(lib_dir, 'daemons.rb')) $LOAD_PATH.unshift lib_dir else begin; require 'rubygems'; rescue ::Exception; end end require 'daemons' Daemons.run_proc('myscript') do loop do file = File.open('/tmp/myscript.log', 'a') file.write(Random.rand) # breaks without seeding # file.write(Random.new.rand) # works without seeding # file.write(rand) # also works, but this is Kernel.rand() so its different file.write("\n") file.close sleep 2 end end
Version data entries
15 entries across 13 versions & 4 rubygems