bread_calculator 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53aef8e8a052ec183a4f4121445c1daa1d15319b
4
- data.tar.gz: 2c9b6a67fd14f71f0a3cddbfe2e73aa028dbbe9b
3
+ metadata.gz: a2b8cf625f1843c3566ad413b36f9e97ed5c95de
4
+ data.tar.gz: d213268cae4aa2704330e9792246f52bcc10436b
5
5
  SHA512:
6
- metadata.gz: 72f6258f4ed7b8884e85af325a4c1e5161a433be5e5bb460e80c7530e329aca0e778f143d4becd26059fbc64f08bb45e97001b0c227684734bac1f4427f171bc
7
- data.tar.gz: ed81a8f9cff34616d3c2c4199ebaea6b97b2ae44d23441a3bc478effbac1183e4c5e0b4d51a5ce0c95c7bfc059663a3395d7c732536042b9a4c6138b83eb1d8b
6
+ metadata.gz: a329806a53827eb21a2fe6ce3b5ef0d57040691170b3029c91e7cce4456cb987e170fc45d2eabaa5394cf0169054fdd28b83d54adf2875b4f6f6e59f01a47bfa
7
+ data.tar.gz: 07a565116b09c5bc73034be62dba699f42a3e224b898ae589d0b41f105d1a016cb787bd11e4b82d2453ad8aa2264e6189ac86a90619d66bf8a8ed47242486a4b
data/README.md CHANGED
@@ -107,14 +107,14 @@ Over-rides <b>--scale-by</b></p>
107
107
 
108
108
  <p style="margin-left:11%; margin-top: 1em"><b>--html</b>
109
109
  Print recipe as html. Over-rides <b>--weight</b> or
110
- <b>--to.</b></p>
110
+ <b>--scale-to.</b></p>
111
111
 
112
112
 
113
113
  <p style="margin-left:11%; margin-top: 1em"><b>--weight</b>
114
114
  Print the weight of the recipe. Over-rides <b>--html</b> or
115
- <b>--to.</b></p>
115
+ <b>--scale-to.</b></p>
116
116
 
117
- <p style="margin-left:11%; margin-top: 1em"><b>--to
117
+ <p style="margin-left:11%; margin-top: 1em"><b>--scale-to
118
118
  WEIGHT</b> Regenerate the recipe or summary to <b>WEIGHT</b>
119
119
  total weight. Over-rides <b>--html</b> or
120
120
  <b>--weight.</b></p>
data/bin/bread-calc CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- #require "#{File.dirname(__FILE__)}/../lib/bread_calculator"
4
- require 'bread_calculator'
3
+ require "#{File.dirname(__FILE__)}/../lib/bread_calculator"
4
+ #require 'bread_calculator'
5
5
 
6
6
  def htm_header
7
7
  puts '<head>'
@@ -17,7 +17,7 @@ where OPTIONS are any of:
17
17
  --summary
18
18
  --html
19
19
  --weight
20
- --recipe
20
+ --scale-to WEIGHT
21
21
  --scale-by FACTOR
22
22
 
23
23
  Install the man page, or go to
@@ -41,8 +41,8 @@ loop { case ARGV[0]
41
41
  when /--summary/ then @opt[1] = 'summary'; ARGV.shift
42
42
  when /--html/ then @opt[2] = 'to_html'; ARGV.shift
43
43
  when /--weight/ then @opt[2] = 'weight'; ARGV.shift
44
- when /--to/ then ARGV.shift; @opt[2] = "recipe(#{ARGV.shift.to_f})"
45
- when /--/ then ARGV.shift; break
44
+ when /--scale_to/ then ARGV.shift; @opt[2] = "recipe(#{ARGV.shift.to_f})"
45
+ when /^--$/ then ARGV.shift; break
46
46
  when /^-/ then help 1
47
47
  else break
48
48
  end; }
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'bread_calculator'
3
- s.version = '0.4.0'
3
+ s.version = '0.5.0'
4
4
  s.date = '2014-03-13'
5
5
  s.summary = "calculate baker's percentages"
6
6
  s.description = "a gem and command-line wrapper to generate baker's
@@ -239,6 +239,12 @@ module BreadCalculator
239
239
  Recipe.new self.metadata, new_steps
240
240
  end
241
241
 
242
+ ##
243
+ # Return a new recipe of weight and units +args+
244
+ def recipe args=1
245
+ self.summary.recipe args
246
+ end
247
+
242
248
  ##
243
249
  # Returns a Summary
244
250
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bread_calculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Birnel