lib/daemon-ogre.rb in daemon-ogre-1.2.0 vs lib/daemon-ogre.rb in daemon-ogre-1.2.1
- old
+ new
@@ -296,20 +296,21 @@
def stop
puts "#{$0} is going to be FacePalmed..."
Daemon.kill DaemonOgre::App.pid_path
kill_with_pid
File.open(DaemonOgre::App.pid_path, "w").write("")
- terminate
+ Process.exit
+
end
def restart
Daemon.kill DaemonOgre::App.pid_path
kill_with_pid
File.open(DaemonOgre::App.pid_path, "w").write("")
-
start
+
end
def kill_with_pid
begin
if File.exists?(DaemonOgre::App.pid_path)
@@ -330,14 +331,10 @@
rescue Exception => ex
puts "Exception has occured: #{ex}"
end
end
- def terminate
- Process.exit if DaemonOgre::App.terminate
- end
-
def continue?
Process.exit if !@@startup
end
def set_log(param)
@@ -414,10 +411,13 @@
end
end
#monkey patch
begin
+ def process_running?(input)
+ DaemonOgre.process_running?(input)
+ end
class File
def self.create!(input,optionable_data=nil,optionable_file_mod="w")
DaemonOgre.create_on_filesystem(input,optionable_data,optionable_file_mod)
end
end
@@ -453,33 +453,27 @@
end
return mrg
end
def number(length)
-
Random.rand(length)
-
end
def boolean
-
rand(2) == 1
-
end
def date from = Time.at(1114924812), to = Time.now
rand(from..to)
end
end
end
class Array
- #class << self
- def index_of(target_element)
- array = self
- hash = Hash[array.map.with_index.to_a]
- return hash[target_element]
- end
- #end
+ def index_of(target_element)
+ array = self
+ hash = Hash[array.map.with_index.to_a]
+ return hash[target_element]
+ end
end
end
#StartUp
begin
\ No newline at end of file