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.
- data/lib/ingreedy/ingreedy_parser.rb +12 -0
- data/lib/ingreedy/version.rb +1 -1
- metadata +2 -2
@@ -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|
|
data/lib/ingreedy/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ingreedy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
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-
|
13
|
+
date: 2011-09-05 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|