ddollar / simple-parser
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
17b8406
commit 17b8406bd7a1fad009a4934ae4b179148ce8a10b
tree d2d692edea79fd2bc1aba3f842bc4227a68a8887
parent 9c851aaa04a629300a77e0761598a3a510e7cbcb
tree d2d692edea79fd2bc1aba3f842bc4227a68a8887
parent 9c851aaa04a629300a77e0761598a3a510e7cbcb
simple-parser / README.markdown
simple-parser
A library to parse simple strings into named tokens
Installation
$ sudo gem install ddollar-simple-parser --source http://gems.github.com
Usage
As a library
>> require 'simple-parser'
>> SimpleParser::String.parse(
'this is "a test" string',
':word1 :: ":phrase1" :word2'
)
=> { :word1 => 'this',
:phrase1 => 'a test',
:word2 => 'string' }
As a mixin
>> require 'simple-parser'
>> class String; include SimpleParser::String; end
>> 'test now'.parse(':word1 :word2')
=> { :word1 => 'test', :word2 => 'now' }

