Class: SingleServing::SystemUtils
- Inherits:
-
Object
- Object
- SingleServing::SystemUtils
- Defined in:
- lib/singleserving/system_utils.rb
Class Method Summary collapse
Class Method Details
.hostname ⇒ Object
9 10 11 |
# File 'lib/singleserving/system_utils.rb', line 9 def self.hostname Socket.gethostname end |
.ip_address ⇒ Object
5 6 7 |
# File 'lib/singleserving/system_utils.rb', line 5 def self.ip_address UDPSocket.open {|s| s.connect('4.4.4.4', 1); s.addr.last} end |
.pbcopy(str) ⇒ Object
13 14 15 16 17 |
# File 'lib/singleserving/system_utils.rb', line 13 def self.pbcopy(str) system "ruby -e \"print '#{str}'\" | pbcopy" rescue raise "Copy to clipboard failed" end |