rnnr 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rnnr.rb +2 -0
- data/lib/rnnr/version.rb +1 -1
- data/lib/send.rb +4 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 856f3f9a1ed27d01c8153523f379b1719f50d5e1
|
4
|
+
data.tar.gz: 7d3fafa2c6fc80efb01f4369bf3009ca6a105e45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe261523a4c8c100fb3c2a17dc829ddb38443121c13bb5ad9f877bb5c94789a975a9bfbd1b2b52442bb709b25b23c54cbc9515ea4ae127d387efff5fca39cb9
|
7
|
+
data.tar.gz: c1552bbf735a96acd77383cbdb50bfbfb6f54f41c39fc29a3bee5cc4046b6a71d3162e26f75e0f236f143a7c98bb314f15f979a0d3f4e4c13a53e2917020317d
|
data/lib/rnnr.rb
CHANGED
@@ -20,10 +20,12 @@ module Rnnr
|
|
20
20
|
c.description = 'Send email of year-to-date running total'
|
21
21
|
c.option '--offset INTEGER', Integer, 'Offset for days in year'
|
22
22
|
c.option '--email <true/false>', String, 'Send an email'
|
23
|
+
c.option '--disp <true/false>', String, 'Print results to screen'
|
23
24
|
c.option '--config_dir directory', String, 'Directory where your .rnnr_config.yml file lives'
|
24
25
|
c.action do |args, options|
|
25
26
|
options.default :offset => 0,
|
26
27
|
:email => 'false',
|
28
|
+
:disp => 'true',
|
27
29
|
:config_dir => "~/"
|
28
30
|
Rnnr.send options
|
29
31
|
end
|
data/lib/rnnr/version.rb
CHANGED
data/lib/send.rb
CHANGED
@@ -41,15 +41,12 @@ module Rnnr
|
|
41
41
|
weekly_distance = weekly_distance.to_miles.round(2)
|
42
42
|
milesperday = (yearly_distance / (Date.today.yday - options.offset)).round(2)
|
43
43
|
|
44
|
-
rslt_str = "Yearly:
|
45
|
-
"\nWeekly:
|
44
|
+
rslt_str = "Yearly: #{yearly_distance}"\
|
45
|
+
"\nWeekly: #{weekly_distance}"\
|
46
46
|
"\nMiles/Day: #{milesperday}"\
|
47
47
|
|
48
|
-
if options.email == 'true'
|
49
|
-
|
50
|
-
else
|
51
|
-
puts rslt_str
|
52
|
-
end
|
48
|
+
send_email rslt_str if options.email == 'true'
|
49
|
+
puts rslt_str if options.disp == 'true'
|
53
50
|
else
|
54
51
|
raise "Unable to retrieve workout data"
|
55
52
|
end
|