README.md in faster_path-0.0.1 vs README.md in faster_path-0.0.2

- old
+ new

@@ -16,10 +16,18 @@ **NOTE**: Refinements and monkeypatch methods are highly likely to be changed and renamed pre version 0.1.0 so keep that in mind! ## Installation +Ensure Rust is installed: + +[Rust Downloads](https://www.rust-lang.org/downloads.html) + +``` +curl -sSf https://static.rust-lang.org/rustup.sh | sudo sh -s -- --channel=nightly +``` + Add this line to your application's Gemfile: ```ruby gem 'faster_path' ``` @@ -32,10 +40,37 @@ $ gem install faster_path ## Usage -TODO: _(project is too young for usage details)_ +Current methods implemented: + +|Rust Implementation|Ruby Implementation|Performance Improvemant| +|---|---|---| +| `FasterPath.absolute?` | `Pathname#absolute?` | 545% to 1450% | +| `FasterPath.chop_basename` | `Pathname#chop_basename` | 6.7% to 54.6% | +| FasterPath.blank? | | | + +You may choose to use the methods directly, or scope change to rewrite behavior on the +standard library with the included refinements, or even call a method to monkeypatch +everything everywhere. + +**Note:** `Pathname#chop_basename` in Ruby STDLIB has a bug with blank strings, that is the +only difference in behavior against FasterPath's implementation. + +For the scoped **refinements** you will need to + +``` +require "faster_path/optional/refinements" +using FasterPath::RefinePathname +``` + +And for the sldeghammer of monkey patching you can do + +``` +require "faster_path/optional/monkeypatching" +FasterPath.sledgehammer_everything! +``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.