Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonmagic/slaw
recipe parser
https://github.com/jonmagic/slaw
Last synced: 30 days ago
JSON representation
recipe parser
- Host: GitHub
- URL: https://github.com/jonmagic/slaw
- Owner: jonmagic
- Created: 2014-02-12T16:27:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-16T15:06:35.000Z (almost 11 years ago)
- Last Synced: 2023-04-10T22:39:33.748Z (over 1 year ago)
- Language: Ruby
- Size: 176 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Slaw
Slaw is a recipe parser implemented in ruby. Let's make a roux.
```ruby
ingredients = Slaw::Parser.new.parse("1 cup flour\n3 tbsp butter")
first = ingredients[0]first[:quantity].to_i
=> 1first[:unit].to_s
=> "cup"first[:ingredient].to_s
=> "flour"second = ingredients[1]
second[:quantity].to_i
=> 3second[:unit].to_s
=> "tbsp"second[:ingredient].to_s
=> "butter"
```## Tests
```bash
bundle exec rake
```## Update units of measurement
```bash
gem install glean
glean export jonmagic/units_of_measurement --format=json > lib/slaw/units
```