Module: FasterPath::Platform
- Defined in:
- lib/faster_path/platform.rb
Class Method Summary collapse
- .ffi_library ⇒ Object
- .host_os ⇒ Object
- .lib_prefix ⇒ Object
- .lib_suffix ⇒ Object
- .operating_system ⇒ Object
- .rust_release ⇒ Object
Class Method Details
.ffi_library ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/faster_path/platform.rb', line 4 def ffi_library file = [ lib_prefix, "faster_path.", lib_suffix ] File.join(rust_release, file.join()) end |
.host_os ⇒ Object
55 56 57 |
# File 'lib/faster_path/platform.rb', line 55 def host_os RbConfig::CONFIG['host_os'].downcase end |
.lib_prefix ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/faster_path/platform.rb', line 27 def lib_prefix case () when /windows/ '' when /cygwin/ 'cyg' else 'lib' end end |
.lib_suffix ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/faster_path/platform.rb', line 38 def lib_suffix case () when /darwin/ 'dylib' when /linux/ 'so' when /windows|cygwin/ 'dll' else 'so' end end |
.operating_system ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/faster_path/platform.rb', line 14 def case host_os() when /linux|bsd|solaris/ "linux" when /darwin/ "darwin" when /mingw|mswin/ "windows" else host_os() end end |
.rust_release ⇒ Object
51 52 53 |
# File 'lib/faster_path/platform.rb', line 51 def rust_release File.("../../target/release/", __dir__) end |