class TFClient::Environment
Constants
- WIN_PATTERNS
@visibility private
Public Class Methods
debug?()
click to toggle source
Returns true if debugging is enabled.
# File lib/textflight-client/environment.rb, line 23 def self.debug? ENV['DEBUG'] == '1' end
user_home_directory()
click to toggle source
Returns the user home directory
# File lib/textflight-client/environment.rb, line 6 def self.user_home_directory require 'etc' # If uid is omitted, the value from Passwd[:uid] is returned instead. #noinspection RubyArgCount Etc.getpwuid.dir end
windows_env?()
click to toggle source
Returns true if Windows environment
# File lib/textflight-client/environment.rb, line 14 def self.windows_env? if @@windows_env.nil? @@windows_env = Environment.host_os_is_win? end @@windows_env end
Private Class Methods
ci_var_defined?()
click to toggle source
!@visibility private
# File lib/textflight-client/environment.rb, line 30 def self.ci_var_defined? value = ENV["CI"] !!value && value != '' end
host_os_is_win?()
click to toggle source
@!visibility private
# File lib/textflight-client/environment.rb, line 50 def self.host_os_is_win? ruby_platform = RbConfig::CONFIG["host_os"] !!WIN_PATTERNS.find { |r| ruby_platform =~ r } end