src/lib.rs in faster_path-0.2.2 vs src/lib.rs in faster_path-0.2.3
- old
+ new
@@ -5,19 +5,24 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
#[macro_use]
extern crate ruru;
+#[macro_use]
+extern crate lazy_static;
+
class!(FasterPathname);
mod helpers;
mod pathname;
mod basename;
mod chop_basename;
+mod cleanpath_aggressive;
mod dirname;
mod extname;
mod plus;
+mod prepend_prefix;
pub mod rust_arch_bits;
mod path_parsing;
use ruru::{Class, Object, RString, Boolean, Array};
@@ -54,11 +59,13 @@
}
// fn r_cleanpath(){ pub_cleanpath(r_to_path()) }
// fn pub_cleanpath(pth: RString){}
- // fn r_cleanpath_aggressive(pth: RString){}
+ fn pub_cleanpath_aggressive(pth: RString) -> RString {
+ pathname::pn_cleanpath_aggressive(pth)
+ }
// fn r_cleanpath_conservative(pth: RString){}
// fn r_del_trailing_separator(pth: RString){}
@@ -93,11 +100,11 @@
pathname::pn_extname(pth)
}
// fn r_find(ignore_error: Boolean){}
// fn pub_find(pth: RString ,ignore_error: Boolean){}
-
+
fn pub_has_trailing_separator(pth: RString) -> Boolean {
pathname::pn_has_trailing_separator(pth)
}
// fn r_join(args: Array){}
@@ -145,21 +152,22 @@
// Public methods
// * methods for refinements, monkeypatching
// * methods that need all values as parameters
Class::from_existing("FasterPathname").get_nested_class("Public").define(|itself| {
- itself.def("absolute?", pub_is_absolute);
- itself.def("add_trailing_separator", pub_add_trailing_separator);
- itself.def("basename", pub_basename);
- itself.def("children", pub_children);
- itself.def("children_compat", pub_children_compat);
- itself.def("chop_basename", pub_chop_basename);
- itself.def("directory?", pub_is_directory);
- itself.def("dirname", pub_dirname);
- itself.def("entries", pub_entries);
- itself.def("entries_compat", pub_entries_compat);
- itself.def("extname", pub_extname);
- itself.def("has_trailing_separator?", pub_has_trailing_separator);
- itself.def("plus", pub_plus);
- itself.def("relative?", pub_is_relative);
+ itself.def_self("absolute?", pub_is_absolute);
+ itself.def_self("add_trailing_separator", pub_add_trailing_separator);
+ itself.def_self("basename", pub_basename);
+ itself.def_self("children", pub_children);
+ itself.def_self("children_compat", pub_children_compat);
+ itself.def_self("chop_basename", pub_chop_basename);
+ itself.def_self("cleanpath_aggressive", pub_cleanpath_aggressive);
+ itself.def_self("directory?", pub_is_directory);
+ itself.def_self("dirname", pub_dirname);
+ itself.def_self("entries", pub_entries);
+ itself.def_self("entries_compat", pub_entries_compat);
+ itself.def_self("extname", pub_extname);
+ itself.def_self("has_trailing_separator?", pub_has_trailing_separator);
+ itself.def_self("plus", pub_plus);
+ itself.def_self("relative?", pub_is_relative);
});
}