Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jonmagic/slaw

recipe parser
https://github.com/jonmagic/slaw

Last synced: 30 days ago
JSON representation

recipe parser

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
=> 1

first[:unit].to_s
=> "cup"

first[:ingredient].to_s
=> "flour"

second = ingredients[1]

second[:quantity].to_i
=> 3

second[: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
```