Module: Gemfury::Platform

Included in:
Command::Authorization
Defined in:
lib/gemfury/platform.rb

Instance Method Summary collapse

Instance Method Details

#config_pathObject


7
8
9
# File 'lib/gemfury/platform.rb', line 7

def config_path
  File.expand_path('.gem/gemfury', home_directory)
end

#home_directoryObject


3
4
5
# File 'lib/gemfury/platform.rb', line 3

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

#on_mac?Boolean


15
16
17
# File 'lib/gemfury/platform.rb', line 15

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

#on_windows?Boolean


11
12
13
# File 'lib/gemfury/platform.rb', line 11

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