faster_path 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/Rakefile +1 -2
- data/lib/faster_path/version.rb +1 -1
- data/lib/faster_path.rb +2 -3
- data/src/lib.rs +0 -35
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2888d77818d98df4b10a00e1b964b4a023b6b812
|
4
|
+
data.tar.gz: 0d09f3f2e82724089f2fcdc2a434fa6bd874c14d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec703f8a01cbb66b705154cfb779fde1c00b6374185d7dfe2ebdd0302ae65d825df1f25f84beb79014928f8acffb5a01d9edc8ccabdb252ca8bf1212ba76f00d
|
7
|
+
data.tar.gz: e2d3c27b7606e9d60c0491d9848850f45d27ced5762251ec54f8768756704940723abc0f38682cbaf79a617c7d9635883e956384f141354260a9c8172aff70c0
|
data/README.md
CHANGED
@@ -105,7 +105,7 @@ using FasterPath::RefinePathname
|
|
105
105
|
And for the sledgehammer of monkey patching you can do
|
106
106
|
|
107
107
|
```
|
108
|
-
require "faster_path/optional/
|
108
|
+
require "faster_path/optional/monkeypatches"
|
109
109
|
FasterPath.sledgehammer_everything!
|
110
110
|
```
|
111
111
|
|
data/Rakefile
CHANGED
data/lib/faster_path/version.rb
CHANGED
data/lib/faster_path.rb
CHANGED
@@ -28,15 +28,14 @@ module FasterPath
|
|
28
28
|
private
|
29
29
|
module Rust
|
30
30
|
extend FFI::Library
|
31
|
-
#ffi_lib 'target/release/libfaster_path.so'
|
32
31
|
ffi_lib begin
|
33
|
-
|
32
|
+
prefix = Gem.win_platform? ? "" : "lib"
|
33
|
+
"#{File.expand_path("../target/release/", File.dirname(__FILE__))}/#{prefix}faster_path.#{FFI::Platform::LIBSUFFIX}"
|
34
34
|
end
|
35
35
|
attach_function :is_absolute, [ :string ], :bool
|
36
36
|
attach_function :is_blank, [ :string ], :bool
|
37
37
|
attach_function :basename, [ :string ], :string
|
38
38
|
attach_function :dirname, [ :string ], :string
|
39
|
-
#attach_function :chop_basename, [ :string ], [:string]
|
40
39
|
end
|
41
40
|
private_constant :Rust
|
42
41
|
end
|
data/src/lib.rs
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
// http://opensource.org/licenses/MIT>, at your option. This file may not be
|
6
6
|
// copied, modified, or distributed except according to those terms.
|
7
7
|
extern crate libc;
|
8
|
-
//extern crate regex;
|
9
8
|
|
10
9
|
use std::path::{Path,MAIN_SEPARATOR};
|
11
10
|
use libc::c_char;
|
@@ -77,37 +76,3 @@ pub extern fn dirname(string: *const c_char) -> *const c_char {
|
|
77
76
|
let output = CString::new(out_str).unwrap();
|
78
77
|
output.into_raw()
|
79
78
|
}
|
80
|
-
|
81
|
-
//#[no_mangle]
|
82
|
-
//pub extern fn chop_basename(string: *const c_char) -> Vec<*const c_char> {
|
83
|
-
// let c_str = unsafe {
|
84
|
-
// assert!(!string.is_null());
|
85
|
-
//
|
86
|
-
// CStr::from_ptr(string)
|
87
|
-
// };
|
88
|
-
//
|
89
|
-
// let r_str = str::from_utf8(c_str.to_bytes()).unwrap();
|
90
|
-
// let mut parts: Vec<*const libc::c_char> = vec![];
|
91
|
-
//
|
92
|
-
// {
|
93
|
-
// use regex::Regex;
|
94
|
-
// let re = Regex::new(format!(r"\A{}?\z", MAIN_SEPARATOR).as_str()).unwrap();
|
95
|
-
// if re.is_match(r_str){
|
96
|
-
// return parts;
|
97
|
-
// }
|
98
|
-
// }
|
99
|
-
//
|
100
|
-
// let mut pieces = r_str.rsplitn(1, MAIN_SEPARATOR);
|
101
|
-
// loop {
|
102
|
-
// match pieces.next() {
|
103
|
-
// Some(val) => { parts.push(CString::new(val.to_string()).unwrap().into_raw()) },
|
104
|
-
// None => { break },
|
105
|
-
// }
|
106
|
-
// }
|
107
|
-
// parts
|
108
|
-
//}
|
109
|
-
|
110
|
-
//#[test]
|
111
|
-
//fn it_chops_basename() {
|
112
|
-
// let result = chop_basename(CString::new("/hello/world.txt").unwrap().as_ptr());
|
113
|
-
//}
|