nutrition_calculator 1.0.2 → 1.0.3
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdf1b1d1d82d53bc441aa174ac25a7c18230ba18
|
4
|
+
data.tar.gz: 89dfd108e4ae7d1aa81935174bd61c26728a2dd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd8e4e88e9e99e18c4311b2c43e95d78bd6cd79e95fdfd1c8eaf4589e3072ad789dd4e1814762315097639e2a409e4c1ec91251b3307f1176e2bc29bfc6c8bc1
|
7
|
+
data.tar.gz: 3d9120ab0259503793d2b40a70248b97a360f387b642e400f2e18868f9c26c839e0f6dd756fc100767588ec719384a683fa7bfe976b45baedf0d9068cc7efd06
|
data/bin/run_calorie_budgeter
CHANGED
@@ -75,9 +75,12 @@ def data_for_day(day_num)
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def prior_days_net_calories
|
78
|
-
(1
|
78
|
+
values = (1...current_day_num).map { |day_num|
|
79
79
|
day_data = data_for_day(day_num)
|
80
|
-
|
80
|
+
day_data['calories_consumed'] - day_data['calories_burned']
|
81
|
+
}
|
82
|
+
values.reduce { |sum, daily_net_calories|
|
83
|
+
sum + daily_net_calories
|
81
84
|
}
|
82
85
|
end
|
83
86
|
|
@@ -94,6 +97,8 @@ def calories_consumed_today
|
|
94
97
|
end
|
95
98
|
|
96
99
|
cb = NutritionCalculator::CalorieBudgeter.new
|
100
|
+
# require 'logger'
|
101
|
+
# cb.logger = Logger.new(STDERR)
|
97
102
|
cb.resting_metabolic_rate = data['resting_metabolic_rate']
|
98
103
|
cb.weekly_calorie_goal = data['weekly_calorie_goal']
|
99
104
|
cb.current_day_of_week = current_day_num
|