Class: Utils
- Inherits:
-
Object
- Object
- Utils
- Defined in:
- lib/runit-man/utils.rb
Overview
Utilities.
Class Method Summary collapse
-
.host_name ⇒ String
Gets local host name.
-
.t(*args) ⇒ String
I18n.t shortcut.
Class Method Details
.host_name ⇒ String
Note:
Caches host name on first access.
Gets local host name.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/runit-man/utils.rb', line 10 def host_name unless @host_name begin @host_name = Socket.gethostbyname(Socket.gethostname).first rescue @host_name = Socket.gethostname end end @host_name end |
.t(*args) ⇒ String
I18n.t shortcut.
24 25 26 |
# File 'lib/runit-man/utils.rb', line 24 def t(*args) I18n.t(*args) end |