lib/mpatch/process.rb in mpatch-1.3.0 vs lib/mpatch/process.rb in mpatch-2.0.0
- old
+ new
@@ -1,28 +1,17 @@
-module Process
+module MPatch
+ module Process
- # return a string obj that include the memory usage info
- def self.memory_usage
+ # return a string obj that include the memory usage info
+ def self.memory_usage
- begin
- return `pmap #{self.pid}`.lines.to_a(
- ).last.chomp.scan(/ *\w* *(\w+)/)[0][0]
- rescue NoMethodError
- return nil
+ begin
+ return `pmap #{self.pid}`.lines.to_a(
+ ).last.chomp.scan(/ *\w* *(\w+)/)[0][0]
+ rescue ::NoMethodError
+ return nil
+ end
+
end
- end
-
-
- def self.daemonize
- File.create Application.pid,'a+'
- File.create Application.log,'a+'
- File.create Application.daemon_stderr,'a+'
- Daemon.start fork,
- Application.pid,
- Application.log,
- Application.daemon_stderr
- end
- def self.stop
- Daemon.stop
end
end
\ No newline at end of file