ingreedy 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -76,6 +76,18 @@ class IngreedyParser
76
76
  end
77
77
  end
78
78
 
79
+ # if no unit yet, try it again downcased
80
+ if @unit.nil?
81
+ @ingredient_string.downcase!
82
+ @unit_map.each do |abbrev, unit|
83
+ if @ingredient_string.start_with?(abbrev + " ")
84
+ # if a unit is found, remove it from the ingredient string
85
+ @ingredient_string.sub! abbrev, ""
86
+ @unit = unit
87
+ end
88
+ end
89
+ end
90
+
79
91
  # if we still don't have a unit, check to see if we have a container unit
80
92
  if @unit.nil? and @container_unit
81
93
  @unit_map.each do |abbrev, unit|
@@ -1,4 +1,4 @@
1
1
  module Ingreedy
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
4
4
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ingreedy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ian C. Anderson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-28 00:00:00 -04:00
13
+ date: 2011-09-05 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies: []
16
16