Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/common/util.rb
Instance Method Summary collapse
Instance Method Details
#expand_env ⇒ Object
24 25 26 27 28 |
# File 'lib/common/util.rb', line 24 def gsub(/\$([a-zA-Z_][a-zA-Z0-9_]*)|\${\g<1>}|%\g<1>%/) do ENV.fetch(Regexp.last_match(1), nil) end end |
#to_bool ⇒ Object
17 18 19 20 21 22 |
# File 'lib/common/util.rb', line 17 def to_bool return true if casecmp('true').zero? return false if casecmp('false').zero? nil end |