Module: FasterPath

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

Defined Under Namespace

Modules: Platform, RefineFile, RefinePathname

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

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



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

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

.blank?(str) ⇒ Boolean

Returns:

  • (Boolean)


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

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

.children(pth, with_directory = true) ⇒ Object

Raises:

  • (Errno::NOENT)


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

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)


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

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



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

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

.entries(pth) ⇒ Object

Raises:

  • (Errno::NOENT)


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

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)


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

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



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

def self.ruby_arch_bits
  1.size * 8
end

.rust_arch_bitsObject



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

def self.rust_arch_bits
  Rust.rust_arch_bits
end

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



95
96
97
98
99
# File 'lib/faster_path/optional/monkeypatches.rb', line 95

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