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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/fitgem +13 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2bf08dc4c8ae15318006ac829053e26640386de
4
- data.tar.gz: b1897aad1d3b02a96706d950d2a7915d9141dd12
3
+ metadata.gz: 6d68fb5ccffe3177b801ca8a0bf71c7b32722ef5
4
+ data.tar.gz: a49ec36187c624b6628814133b16456ddd2b4f19
5
5
  SHA512:
6
- metadata.gz: 0fa2f80e0df592ac6e358667bce4961579d03a8d31c98717dfa4bf80d6af40c7690e59214d1fba6b754d84cd722683b2be8d55f577571313e679cf7c5ed10742
7
- data.tar.gz: 91980e9afbfef6c1d2ce09a9eae5d0bb7cb9379e56e5471d2df979e691dbb57eb9028ad6d4b89d346077420b2b7627261affb3b4c52730044ac189e168a778d2
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. It will be saved"
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
- system( "clear" ) # Clears Screen
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
- fitgem.help
111
+ puts "Are you lost?, run Fitgem help"
108
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fitgem-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Geis