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.1"
Class Method Summary
collapse
Class Method Details
.basename(pth, ext = "") ⇒ Object
40
41
42
|
# File 'lib/faster_path.rb', line 40
def self.basename(pth, ext="")
Public.send(:basename, pth, ext)
end
|
.blank?(str) ⇒ Boolean
36
37
38
|
# File 'lib/faster_path.rb', line 36
def self.blank?(str)
"#{str}".strip.empty?
end
|
.children(pth, with_directory = true) ⇒ Object
44
45
46
47
48
|
# File 'lib/faster_path.rb', line 44
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
50
51
52
53
54
|
# File 'lib/faster_path.rb', line 50
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
56
57
58
59
|
# File 'lib/faster_path.rb', line 56
def self.chop_basename(pth)
result = Public.send(:chop_basename, pth)
result unless result.empty?
end
|
.entries(pth) ⇒ Object
61
62
63
64
65
|
# File 'lib/faster_path.rb', line 61
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
67
68
69
70
71
|
# File 'lib/faster_path.rb', line 67
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_bits ⇒ Object
32
33
34
|
# File 'lib/faster_path.rb', line 32
def self.ruby_arch_bits
1.size * 8
end
|
.rust_arch_bits ⇒ Object
28
29
30
|
# File 'lib/faster_path.rb', line 28
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
|