fitgem-app 2.0.2 → 2.1.0
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 +4 -4
- data/bin/fitgem +13 -9
- 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: 6d68fb5ccffe3177b801ca8a0bf71c7b32722ef5
|
4
|
+
data.tar.gz: a49ec36187c624b6628814133b16456ddd2b4f19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbcbd2ee5bc5436713b967dce759111f40d020ad63b171bdf61234b4604946639d7a6cab9f1f36f181583810b4171fba526787a4950ca7c2fbd5791b7d3d9ad3
|
7
|
+
data.tar.gz: 7d7c9ab2fcb301d8b167ccfe0b91ad9237597ecd7445170be943897f2f95445e3e45c107b65749753091cd3023c97f04baccf51d3738782d0476962a5aea2bcf
|
data/bin/fitgem
CHANGED
@@ -11,16 +11,20 @@ class FitbitAccount
|
|
11
11
|
@user_id = `echo -n $FB_USER_ID`
|
12
12
|
|
13
13
|
if @access_token == "" && @user_id == ""
|
14
|
-
puts "We need some information.
|
14
|
+
puts "We need some information. Please navigate to http://juniorrubyist.github.io/fitgem/authorize.html in a browser. Then, authorize and copy/paste the information."
|
15
|
+
print "Where is your shell configuration/variables file in your home directory?\n(e.g. .bashrc, .zshenv, etc.; usually .bashrc) "
|
16
|
+
@default_shell = File.open(ENV['HOME']+"/#{gets.chomp}", "a+")
|
17
|
+
@default_shell.puts("\n### Added by Fitgem")
|
18
|
+
|
15
19
|
print "Copy your Access Token: "
|
16
20
|
@access_token = gets.chomp
|
21
|
+
@default_shell.puts("export FB_ACCESS_TOKEN=\"@access_token\"")
|
17
22
|
|
18
23
|
print "Copy your User ID: "
|
19
24
|
@user_id = gets.chomp
|
25
|
+
@default_shell.puts("export FB_USER_ID=\"@user_id\"")
|
20
26
|
|
21
|
-
|
22
|
-
# system( "echo \"export FB_ACCESS_TOKEN=#{@access_token}\" >> ~/.bashrc")
|
23
|
-
@authorization_header = {"Authorization" => "Bearer #{@access_token}"}
|
27
|
+
puts "OK, now restart your terminal or logout and login again."
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
@@ -92,17 +96,17 @@ fitgem = FitbitAccount.new()
|
|
92
96
|
choice = ARGV[0]
|
93
97
|
case choice
|
94
98
|
when 'steps', 's'
|
95
|
-
puts fitgem.steps
|
99
|
+
puts "#{fitgem.steps} steps taken"
|
96
100
|
when 'distance', 'd'
|
97
|
-
puts fitgem.distance
|
101
|
+
puts "#{fitgem.distance} miles walked"
|
98
102
|
when 'floors', 'f'
|
99
|
-
puts fitgem.floors
|
103
|
+
puts "#{fitgem.floors} floors climbed"
|
100
104
|
when 'calories', 'c'
|
101
|
-
puts calories
|
105
|
+
puts "#{fitgem.calories} calories burned"
|
102
106
|
when 'full', 'all', 'a'
|
103
107
|
fitgem.full_report
|
104
108
|
when 'help', 'h', '?'
|
105
109
|
fitgem.help
|
106
110
|
else
|
107
|
-
|
111
|
+
puts "Are you lost?, run Fitgem help"
|
108
112
|
end
|