A ruby gem to calculate baker's percentages
gem install bread_calculator
or, if you want the latest and the greatest, or if you want the man page installed:
git clone https://github.com/nbirnel/bread-calculator cd bread-calculator rake install
sudo as necessary)
ruby >= 1.9.2
Inspiration and History
Baker's percentages make baking easier, but I don't like to do the math.
© 2014 Noah Birnel MIT license
<title>bread-calc</title> Man page
bread-calc − calculate baker’s percentages
bread-calc [OPTIONS] [FILE]
bread-calc parses a nearly free-form bread recipe in file FILE, or from standard in. By default, the canonical representation of the recipe is printed to standard out. Optionally, the weight, or bakers percentage formula can be generated, or the recipe can by scaled up or down.
--help Print a brief usage message.
--summary Print all baker’s percentages of the recipe. Over-rides --scale-by
--html Print recipe as html. Over-rides --weight or --scale-to.
--weight Print the weight of the recipe. Over-rides --html or --scale-to.
--scale-to WEIGHT Regenerate the recipe or summary to WEIGHT total weight. Over-rides --html or --weight.
--scale-by FACTOR. Regenerate the recipe, scaling up or down by FACTOR Over-rides --summary.
bread-calc --summary sample.recipe summarize a recipe
bread-calc --scale-by .5 --html sample.recipe > sample.html halve a recipe and render as html
The recipe format consists of a metadata prelude followed by steps.
In prelude lines, anything before a colon is considered to be the name of a metadata field; anything after the colon is a value to populate. Lines without colons are continuations of the ’notes’ field. I suggest having at least a ’name’ field.
A line starting with a hyphen ends the prelude and starts the first step.
Each step is delimited by one or more blank lines.
Any line in a step starting with a space or a blank is an ingredient, consisting of quantity, units, and the ingredient itself.
bread-calc makes a crude attempt to guess at the type of ingredient, but you can always force it by including one of the words ’flour’, ’liquid’, or ’additive’ in the line.
Here is a brief example (note that if you are reading this on github, you won’t see the indenting):
notes: This is a silly fake bread recipe
makes: 1 bad loaf
This line will become part of the notes
500 g flour
300 g water
Bake at 375°
It is cheerfully assumed that all units are grams.
It is undefined how ’liquid flour additive’ is parsed, but don’t expect anything sensible.
Copyright 2014 Noah Birnel