README.md in excise-0.1.1 vs README.md in excise-0.2.0

- old
+ new

@@ -1,6 +1,6 @@ -# Excise [![Build Status](https://secure.travis-ci.org/ezkl/excise.png)](http://travis-ci.org/ezkl/excise) +# Excise [![Build Status](https://secure.travis-ci.org/ezkl/excise.png)](http://travis-ci.org/ezkl/excise) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/ezkl/excise) > This is a simple helper to extract values from a string based on a pattern. A Ruby port of [laktek's](https://github.com/laktek/) [extract-values](https://github.com/laktek/extract-values). ## Installation @@ -20,12 +20,18 @@ ## Usage ```ruby require 'excise' -Excise('About 49,000,000 results (0.15 seconds)', - 'About {result_count} results ({load_time} seconds)') +# Basic use +Excise('About {result_count} results ({load_time} seconds)', + 'About 49,000,000 results (0.15 seconds)') #=> {:result_count=>"49,000,000", :load_time=>"0.15"} + +# Memoize pattern for performance improvement +pattern = Excise::Base.new('[{key}]') +pattern.parse_string '[value]' #=> {:key=>"value"} +pattern.parse_string '[other]' #=> {:key=>"other"} ``` ## Contributing 1. Fork it