$running = true
Signal.trap("TERM") do
$running = false
end
while($running) do
# Replace this with your code
get_current_time
ActiveRecord::Base.logger.info "This daemons is still running at #
{@current_time}.\n"
sleep 5
requiring that file just means that the module BasicFunctions is now
loaded. you haven't done anything with it yet (include BasicFunctions
somewhere might be a good starting point)
I tried what u said but I wasn't able to get it going. This time I didn't
require the file I dumped the module inside the daemons.rb file but I just
couldn't get it to work. I know it must be something to do with the syntax I
used.
#!/usr/bin/env ruby
# You might want to change this
ENV["RAILS_ENV"] ||= "development"
#require 'basic_functions.rb'
include Basic_functions
$running = true
Signal.trap("TERM") do
$running = false
end
while($running) do
# Replace this with your code
get_current_time
ActiveRecord::Base.logger.info "This daemons is still running at
#{@current_time}.\n"
sleep 5
end
[mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Frederick Cheung
I tried what u said but I wasn't able to get it going. This time I didn't
require the file I dumped the module inside the daemons.rb file but I just
couldn't get it to work. I know it must be something to do with the syntax I
used.
where the module is on disk is somewhat irrelevant.