module TorrentSearch::OS
Constants
- OSES
Public Class Methods
linux?()
click to toggle source
# File lib/torrent_search/os.rb, line 15 def linux? match? /linux|arch/i end
os_x?()
click to toggle source
# File lib/torrent_search/os.rb, line 11 def os_x? match? /darwin/i end
to_s()
click to toggle source
# File lib/torrent_search/os.rb, line 23 def to_s CONFIG['host_os'] end
to_sym()
click to toggle source
# File lib/torrent_search/os.rb, line 27 def to_sym OSES.find {|os| self.send "#{os}?"} || :unknown end
windows?()
click to toggle source
# File lib/torrent_search/os.rb, line 19 def windows? match? /cygwin|mswin|mingw|bccwin|wince|emx/ end
Private Class Methods
match?(regexp)
click to toggle source
# File lib/torrent_search/os.rb, line 32 def match?(regexp) !!(to_s =~ regexp) end