strava-ruby-cli 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 795187f6ed3b261eda5e43a77d27c299772de0d877af93c523dfe5b302c7c476
4
- data.tar.gz: 54880408a8294f2eee97ab2698452c79804b3da10cf6ad09f7b8b5905e3299ca
3
+ metadata.gz: 8da8c746357f49b3b17cb190f85944a7172782e8c8c73b0db1387a8dc690025f
4
+ data.tar.gz: 45d932b8dbd8c194c81dde0bf61f95230665fd60509dedf3815bc8d499c91eed
5
5
  SHA512:
6
- metadata.gz: cdfcea1a6d0d98f0e9e4bbdc34964d33fab3beb9a5df5109180526b483a164e4beabca11d52e7f3305d6633d845460bf43320a7b870462e276ef745bb8c89df7
7
- data.tar.gz: 7df4d3579bd3d1b8c7500bbd8b001077ea39de044bf027cb032ccfb4a339bd1852a6a1f13bfadff6e24e81a66fdd9bf88aab44a0d7b98cd0d3e5b2d679476a1c
6
+ metadata.gz: ef025007701487c799a89b04fa6e1e6ce01d6a9e703c7f9b9d8690c608d5a293295d8a64501e613bdecd58f3adac656b5fcf3c3d8179cbecb1cf77cc77d3e556
7
+ data.tar.gz: 8f48a59678d1a4f6a2aaac721860f105c259089928fbb4dc30c6f8d826e7c8ad08017b34c9291dd5b6c7307b621cd5f9260914179945fad848011f29a4b931c7
@@ -1,3 +1,9 @@
1
+ ### 0.1.1 (2020/6/5)
2
+
3
+ * Added detail to `--verbose` error reporting - [@dblock](https://github.com/dblock).
4
+ * [#2](https://github.com/dblock/strava-ruby-cli/pull/2): Make browser launch platform-independent - [@mattdsteele](https://github.com/mattdsteele).
5
+ * [#5](https://github.com/dblock/strava-ruby-cli/pull/5): Raise error if browser can't open - [@mattdsteele](https://github.com/mattdsteele).
6
+
1
7
  ### 0.1.0 (2019/1/11)
2
8
 
3
9
  * Initial public release - [@dblock](https://github.com/dblock).
data/bin/strava CHANGED
@@ -24,6 +24,8 @@ class App
24
24
  pre do |global_options, _command, options, _args|
25
25
  options = global_options.dup
26
26
  $auth = Strava::Cli::Auth.new(options)
27
+ $verbose = options.fetch(:verbose)
28
+ true
27
29
  end
28
30
 
29
31
  desc 'Opens a Strava console'
@@ -40,6 +42,20 @@ class App
40
42
  Strava::Cli::Console.new($auth.access_token).run(args)
41
43
  end
42
44
  end
45
+
46
+ on_error do |e|
47
+ warn "Error: #{e.message}"
48
+ if $verbose
49
+ case e
50
+ when Strava::Errors::Fault then
51
+ warn ' ' + e.to_s
52
+ warn ' ' + e.errors.map(&:to_s).join("\n ")
53
+ else
54
+ warn ' ' + e.backtrace.join("\n ")
55
+ end
56
+ end
57
+ false
58
+ end
43
59
  end
44
60
 
45
61
  exit App.run(ARGV)
@@ -62,7 +62,9 @@ module Strava
62
62
  scope: @scope
63
63
  )
64
64
 
65
- system 'open', redirect_url
65
+ Launchy.open redirect_url do |err|
66
+ raise "Failed to browse to #{redirect_url}: #{err}"
67
+ end
66
68
 
67
69
  server.start
68
70
 
@@ -1,5 +1,5 @@
1
1
  module Strava
2
2
  module Cli
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
@@ -1,5 +1,6 @@
1
1
  require 'open3'
2
2
  require 'English'
3
+ require 'launchy'
3
4
 
4
5
  require 'strava-ruby-client'
5
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strava-ruby-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-11 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: launchy
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: ripl
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
100
  - !ruby/object:Gem::Version
87
101
  version: 1.3.6
88
102
  requirements: []
89
- rubyforge_project:
90
- rubygems_version: 2.7.6
103
+ rubygems_version: 3.1.2
91
104
  signing_key:
92
105
  specification_version: 4
93
106
  summary: Strava API CLI.