class Monkey::FilePaths
Public Class Methods
global_apps()
click to toggle source
# File lib/helpers/file_paths.rb, line 28 def self.global_apps global_bit64_apps || global_bit32_apps end
global_bit32_apps()
click to toggle source
# File lib/helpers/file_paths.rb, line 18 def self.global_bit32_apps if Computer.windows? path = ENV['programfiles(x86)'] if Computer.bit64? path = ENV['programfiles'] if Computer.bit32? return path.gsub(File::ALT_SEPARATOR, File::SEPARATOR) elsif Computer.mac? return File.join(root, '/Applications') end end
global_bit64_apps()
click to toggle source
# File lib/helpers/file_paths.rb, line 12 def self.global_bit64_apps return nil if Computer.bit32? return ENV['programfiles'].gsub(File::ALT_SEPARATOR, File::SEPARATOR) if Computer.windows? return File.join(root, '/Applications') if Computer.mac? end
hosts_file()
click to toggle source
# File lib/helpers/file_paths.rb, line 32 def self.hosts_file return File.join(root, 'windows/system32/drivers/etc/hosts') if Computer.windows? return File.join(root, '/private/etc/hosts') if Computer.mac? end
root()
click to toggle source
# File lib/helpers/file_paths.rb, line 4 def self.root if Computer.windows? Dir.pwd.scan(/\w:\//).first else '/' end end