Module: SkippyLib::Platform
- Defined in:
- modules/platform.rb
Overview
Constant Summary collapse
- POINTER_SIZE =
['a'].pack('P').size * 8
- KEY =
(self.mac? ? 'win' : 'osx').freeze
- ID =
"#{KEY}#{POINTER_SIZE}"
- NAME =
(self.mac? ? 'macOS' : 'Windows').freeze
- IS_MAC =
self.mac?
- IS_WIN =
self.win?
Class Method Summary collapse
Class Method Details
.mac? ⇒ Boolean
8 9 10 |
# File 'modules/platform.rb', line 8 def self.mac? Sketchup.platform == :platform_osx end |
.temp_path ⇒ String
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'modules/platform.rb', line 37 def self.temp_path paths = [ Sketchup.temp_dir, ENV.fetch('TMPDIR', nil), ENV.fetch('TMP', nil), ENV.fetch('TEMP', nil), ] temp = paths.find { |path| File.exist?(path) } raise 'Unable to locate temp directory' if temp.nil? File.(temp) end |
.win? ⇒ Boolean
13 14 15 |
# File 'modules/platform.rb', line 13 def self.win? Sketchup.platform == :platform_win end |