basis-band 0.3.1 → 0.3.2

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/README.md CHANGED
@@ -38,7 +38,7 @@ command line every time. Just create a file like this as ~/.basis-band:
38
38
 
39
39
  The main basis-band command requires the name of a cache directory to use.
40
40
  You can either pass it on the command line using --cachedir, or add it to the
41
- ~/basis-band initialization file. The cache directory must exist before
41
+ ~/.basis-band initialization file. The cache directory must exist before
42
42
  running the commands.
43
43
 
44
44
  The default is to fetch metrics for a given day (expressed in YYYY-MM-DD
@@ -46,6 +46,12 @@ OptionParser.new do |opts|
46
46
  opts.on("-T", "--type TYPE", "'metrics' or 'activities' (default 'metrics')") do |t|
47
47
  options[:type] = t
48
48
  end
49
+ opts.on("-e", "--email EMAIL", "email for login") do |e|
50
+ options[:email] = e
51
+ end
52
+ opts.on("-p", "--password PASSWORD", "password for login") do |p|
53
+ options[:password] = p
54
+ end
49
55
  end.parse!
50
56
 
51
57
  b = BasisBand.new(options[:cachedir])
@@ -68,8 +74,14 @@ if options[:summary]
68
74
  end
69
75
 
70
76
  if options[:type] == 'metrics'
77
+ if not options[:userid]
78
+ options[:token], options[:userid] = ApiAuth.new.login(options[:email], options[:password])
79
+ end
71
80
  raw = b.metrics_for_day(options[:userid], options[:date])
72
81
  elsif options[:type] == 'activities'
82
+ if not options[:token]
83
+ options[:token], options[:userid] = ApiAuth.new.login(options[:email], options[:password])
84
+ end
73
85
  raw = b.activities_for_day(options[:token], options[:date])
74
86
  else
75
87
  raw = $stdin.read
@@ -1,3 +1,3 @@
1
1
  module BasisBandMeta
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basis-band
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-11 00:00:00.000000000 Z
12
+ date: 2013-11-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json