Module: Chester::Helpers

Included in:
Command::Base
Defined in:
lib/chester/helpers.rb

Instance Method Summary collapse

Instance Method Details

#home_directoryObject



3
4
5
# File 'lib/chester/helpers.rb', line 3

def home_directory
  running_on_windows? ? ENV['USERPROFILE'] : ENV['HOME']
end

#running_on_a_mac?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/chester/helpers.rb', line 11

def running_on_a_mac?
  RUBY_PLATFORM =~ /-darwin\d/
end

#running_on_windows?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/chester/helpers.rb', line 7

def running_on_windows?
  RUBY_PLATFORM =~ /mswin32|mingw32/
end