module Utils
© ANB Andrew Bizyaev
foto tools
Public Class Methods
dir_empty?(dir)
click to toggle source
# File lib/phtools/utils/dir.rb, line 6 def self.dir_empty?(dir) (Dir.entries(dir) - ['.', '..']).empty? end
os(os_string = RbConfig::CONFIG['host_os'])
click to toggle source
determine OS
# File lib/phtools/utils/os.rb, line 10 def self.os(os_string = RbConfig::CONFIG['host_os']) case os_string when /darwin/i then :macosx when /linux/i then :linux when /mswin|mingw|w32/i then :windows else :unknown end end