Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/common/util.rb

Instance Method Summary collapse

Instance Method Details

#expand_envObject



24
25
26
27
28
# File 'lib/common/util.rb', line 24

def expand_env
  gsub(/\$([a-zA-Z_][a-zA-Z0-9_]*)|\${\g<1>}|%\g<1>%/) do
    ENV.fetch(Regexp.last_match(1), nil)
  end
end

#to_boolObject



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