Module: FasterPath

Defined in:
lib/faster_path.rb,
lib/faster_path/version.rb,
lib/faster_path/platform.rb,
lib/faster_path/asset_resolution.rb,
lib/faster_path/optional/refinements.rb,
lib/faster_path/optional/monkeypatches.rb

Defined Under Namespace

Modules: AssetResolution, Platform, RefineFile, RefinePathname

Constant Summary collapse

FFI_LIBRARY =
FasterPath::Platform.ffi_library()
VERSION =
"0.2.4"

Class Method Summary collapse

Class Method Details

.basename(pth, ext = "") ⇒ Object



36
37
38
# File 'lib/faster_path.rb', line 36

def self.basename(pth, ext="")
  Public.send(:basename, pth, ext)
end

.blank?(str) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/faster_path.rb', line 32

def self.blank?(str)
  "#{str}".strip.empty?
end

.children(pth, with_directory = true) ⇒ Object

Raises:

  • (Errno::NOENT)


40
41
42
43
44
# File 'lib/faster_path.rb', line 40

def self.children(pth, with_directory=true)
  result = Public.send(:children, pth, with_directory)
  return result if result
  raise Errno::NOENT, "No such file or directory @ dir_initialize - #{pth}"
end

.children_compat(pth, with_directory = true) ⇒ Object

Raises:

  • (Errno::NOENT)


46
47
48
49
50
# File 'lib/faster_path.rb', line 46

def self.children_compat(pth, with_directory=true)
  result = Public.send(:children_compat, pth, with_directory)
  return result if result
  raise Errno::NOENT, "No such file or directory @ dir_initialize - #{pth}"
end

.chop_basename(pth) ⇒ Object



52
53
54
55
# File 'lib/faster_path.rb', line 52

def self.chop_basename(pth)
  result = Public.send(:chop_basename, pth)
  result unless result.empty?
end

.entries(pth) ⇒ Object

Raises:

  • (Errno::NOENT)


57
58
59
60
61
# File 'lib/faster_path.rb', line 57

def self.entries(pth)
  result = Public.send(:entries, pth)
  return result if result
  raise Errno::NOENT, "No such file or directory @ dir_initialize - #{pth}"
end

.entries_compat(pth) ⇒ Object

Raises:

  • (Errno::NOENT)


63
64
65
66
67
# File 'lib/faster_path.rb', line 63

def self.entries_compat(pth)
  result = Public.send(:entries_compat, pth)
  return result if result
  raise Errno::NOENT, "No such file or directory @ dir_initialize - #{pth}"
end

.ruby_arch_bitsObject



28
29
30
# File 'lib/faster_path.rb', line 28

def self.ruby_arch_bits
  1.size * 8
end

.rust_arch_bitsObject



24
25
26
# File 'lib/faster_path.rb', line 24

def self.rust_arch_bits
  Rust.rust_arch_bits
end

.sledgehammer_everything!(include_file = !!ENV['WITH_REGRESSION'])) ⇒ Object



81
82
83
84
85
# File 'lib/faster_path/optional/monkeypatches.rb', line 81

def self.sledgehammer_everything!(include_file = !!ENV['WITH_REGRESSION'])
  MonkeyPatches._ruby_core_file! if include_file # SLOW; DON'T AUTO INCLUDE
  MonkeyPatches._ruby_library_pathname!
  "CAUTION: Monkey patching effects everything! Be very sure you want this!"
end