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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12559a70086221b3a9d8bad4dd21a390bedd7672
4
- data.tar.gz: 7a2924fd52a79a8fed10f83f49b2b262bb1fca58
3
+ metadata.gz: 2888d77818d98df4b10a00e1b964b4a023b6b812
4
+ data.tar.gz: 0d09f3f2e82724089f2fcdc2a434fa6bd874c14d
5
5
  SHA512:
6
- metadata.gz: 8c8af46b6547dfe4676eb51797d2cd1768dd898e21b3b88c67214814600660bd498b81fe05408431a956fff3fc5080b527875637a49069c57e33cb2b9c218203
7
- data.tar.gz: 407d21b3b56b670b3351d712bd4726805e2f53cf1d47f6f6074d50884c1d09ee45c11cc27ef231e2c2c0192eb11671dcd3ee1b21565b0e4756b2a273246d210b
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/monkeypatching"
108
+ require "faster_path/optional/monkeypatches"
109
109
  FasterPath.sledgehammer_everything!
110
110
  ```
111
111
 
data/Rakefile CHANGED
@@ -17,8 +17,7 @@ task :clean_src do
17
17
  Dir.
18
18
  glob('target/release/*').
19
19
  keep_if {|f|
20
- # TODO: change regex to include other library extensions for other OS builds
21
- !f[/\.so\z/]
20
+ !f[/\.(?:so|dll)\z/]
22
21
  }
23
22
  )
24
23
  end
@@ -1,3 +1,3 @@
1
1
  module FasterPath
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
- "#{File.expand_path("../target/release/", File.dirname(__FILE__))}/libfaster_path.#{FFI::Platform::LIBSUFFIX}"
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
- //}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faster_path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel P. Clark