Top Level Namespace
Defined Under Namespace
Modules: CMSScanner, PublicSuffix, Typhoeus Classes: Numeric
Instance Method Summary collapse
-
#memory_usage ⇒ Integer
The memory of the current process in Bytes.
- #redirect_output_to_file(file) ⇒ Object
Instance Method Details
#memory_usage ⇒ Integer
Returns The memory of the current process in Bytes.
10 11 12 |
# File 'lib/cms_scanner/helper.rb', line 10 def memory_usage `ps -o rss= -p #{Process.pid}`.to_i * 1024 # ps returns the value in KB end |
#redirect_output_to_file(file) ⇒ Object
3 4 5 6 7 |
# File 'lib/cms_scanner/helper.rb', line 3 def redirect_output_to_file(file) $stdout.reopen(file, 'w') $stdout.sync = true $stderr.reopen($stdout) # Not sure if this is needed end |