Module: FasterPath

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

Defined Under Namespace

Modules: RefineFile, RefinePathname

Constant Summary collapse

FFI_LIBRARY =
begin
  toplevel_dir = File.dirname(__dir__)
  config = Thermite::Config.new(cargo_project_path: toplevel_dir,
                                ruby_project_path: toplevel_dir)
  config.ruby_extension_path
end
VERSION =
"0.3.6"

Class Method Summary collapse

Class Method Details

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



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

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

.blank?(str) ⇒ Boolean

Returns:

  • (Boolean)


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

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

.children(pth, with_directory = true) ⇒ Object

Raises:

  • (Errno::NOENT)


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

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)


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

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



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

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

.entries(pth) ⇒ Object

Raises:

  • (Errno::NOENT)


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

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)


68
69
70
71
72
# File 'lib/faster_path.rb', line 68

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



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

def self.ruby_arch_bits
  1.size * 8
end

.rust_arch_bitsObject



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

def self.rust_arch_bits
  Rust.rust_arch_bits
end

.sledgehammer_everything!Object



99
100
101
102
103
# File 'lib/faster_path/optional/monkeypatches.rb', line 99

def self.sledgehammer_everything!()
  MonkeyPatches._ruby_core_file!
  MonkeyPatches._ruby_library_pathname!
  "CAUTION: Monkey patching effects everything! Be very sure you want this!"
end