Class: FFI::Compiler::Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi-compiler/platform.rb

Constant Summary collapse

LIBSUFFIX =
FFI::Platform.mac? ? 'bundle' : FFI::Platform::LIBSUFFIX

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.systemObject



5
6
7
# File 'lib/ffi-compiler/platform.rb', line 5

def self.system
  @@system ||= Platform.new
end

Instance Method Details

#archObject



13
14
15
# File 'lib/ffi-compiler/platform.rb', line 13

def arch
  FFI::Platform::ARCH
end

#mac?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ffi-compiler/platform.rb', line 25

def mac?
  FFI::Platform.mac?
end

#map_library_name(name) ⇒ Object



9
10
11
# File 'lib/ffi-compiler/platform.rb', line 9

def map_library_name(name)
  "#{FFI::Platform::LIBPREFIX}#{name}.#{LIBSUFFIX}"
end

#nameObject



21
22
23
# File 'lib/ffi-compiler/platform.rb', line 21

def name
  FFI::Platform.name
end

#osObject



17
18
19
# File 'lib/ffi-compiler/platform.rb', line 17

def os
  FFI::Platform::OS
end