skylight 1.3.0 → 1.3.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
  SHA1:
3
- metadata.gz: f628a6b5a3ed23626781369f5cab3b4adfbbb3c0
4
- data.tar.gz: 8c623387c32d39fdde9bbbd482039be124fa92c5
3
+ metadata.gz: 83dd7c6f5a27d456efd3e03bfc08303fea5f1085
4
+ data.tar.gz: c7bfa08ec18f46a18b43ae6e2d7e4d568f54d6b1
5
5
  SHA512:
6
- metadata.gz: '0915a87d423f154fe620d05a090574bc40c1ae10ad511a564a07b1917c54f1d0d94af969e5e858e915387c51ce2126616e3dfcea17aaac7cb58b3bd5e693b958'
7
- data.tar.gz: a12c534ac052171b7f37b5f62f3aee67f3a230fa6a5925fdd545653489904c7469ea45c90190fdc409f973e24f2308ca1bf7d8ef1f534219a812edbed6941bc9
6
+ metadata.gz: 5b2faf2103731fc3549aa34da956454461703fff11e05d18de2be546b9adab1f0011b96782894d0aea709b03aa1070a5e27421dc8800c92b2f9a5914cdac418b
7
+ data.tar.gz: 585d6d962d8473fdf99d5fcc2a97fa97732d9a691e92ffb3e51c4219bdf75fa834f4d7eaefdb96ec9d3a1109616a3e744fd4cb9765829808a7dee8b9a1327482
@@ -1,3 +1,7 @@
1
+ ## 1.3.1 (May 17, 2017)
2
+
3
+ * [IMPROVEMENT] Better suggestions in `skylight doctor`.
4
+
1
5
  ## 1.3.0 (May 17, 2017)
2
6
 
3
7
  * [FEATURE] Add normalizer for couch_potato. (Thanks @cobot)
@@ -56,7 +56,7 @@ you should set the `SKYLIGHT_AUTHENTICATION` variable to:
56
56
 
57
57
  OUT
58
58
  rescue Api::CreateFailed => e
59
- say "Could not create the application", :red
59
+ say "Could not create the application. Please run `skylight doctor` for diagnostics.", :red
60
60
  say e.to_s, :yellow
61
61
  rescue Interrupt
62
62
  end
@@ -13,11 +13,17 @@ module Skylight
13
13
  if req.success?
14
14
  say "OK", :green
15
15
  else
16
+ encountered_error!
16
17
  if req.exception.is_a?(Util::HTTP::StartError) && req.exception.original.is_a?(OpenSSL::SSL::SSLError)
17
18
  say "Failed to verify SSL certificate.", :red
18
19
  if Util::SSL.ca_cert_file?
19
20
  say "Certificates located at #{Util::SSL.ca_cert_file_or_default} may be out of date.", :yellow
20
- say "Please update your local certificates or try setting `SKYLIGHT_FORCE_OWN_CERTS=1` in your environment.", :yellow
21
+ if is_mac? && has_rvm?
22
+ say "Please update your certificates with RVM by running `rvm osx-ssl-certs update all`.", :yellow
23
+ say "Alternatively, try setting `SKYLIGHT_FORCE_OWN_CERTS=1` in your environment.", :yellow
24
+ else
25
+ say "Please update your local certificates or try setting `SKYLIGHT_FORCE_OWN_CERTS=1` in your environment.", :yellow
26
+ end
21
27
  end
22
28
  else
23
29
  say "Unable to reach Skylight servers.", :red
@@ -34,8 +40,9 @@ module Skylight
34
40
  if is_rails?
35
41
  say "Rails application detected", :green
36
42
  else
37
- say "No Rails application detected", :red
38
- abort "Currently `skylight doctor` only works with Rails applications"
43
+ say "No Rails application detected", :yellow
44
+ say "Additional `skylight doctor` checks only work with Rails applications.", :yellow
45
+ done!
39
46
  end
40
47
  end
41
48
 
@@ -49,6 +56,8 @@ module Skylight
49
56
  if Skylight.native?
50
57
  say "Native agent installed", :green
51
58
  else
59
+ encountered_error!
60
+
52
61
  say "Unable to load native extension", :yellow
53
62
 
54
63
  indent do
@@ -62,7 +71,7 @@ module Skylight
62
71
  end
63
72
  end
64
73
 
65
- abort
74
+ done!
66
75
  end
67
76
  end
68
77
 
@@ -77,12 +86,15 @@ module Skylight
77
86
  config.validate!
78
87
  say "Configuration is valid", :green
79
88
  rescue ConfigError => e
89
+ encountered_error!
90
+
80
91
  say "Configuration is invalid", :red
81
92
  indent do
82
93
  say e.message, :red
83
94
  say "This may occur if you are configuring with ENV variables and didn't set them in this shell."
84
95
  end
85
- abort
96
+
97
+ done!
86
98
  end
87
99
  end
88
100
 
@@ -111,8 +123,11 @@ module Skylight
111
123
  if started
112
124
  say "Successfully started", :green
113
125
  else
126
+ encountered_error!
127
+
114
128
  say "Failed to start", :red
115
- abort
129
+
130
+ done!
116
131
  end
117
132
 
118
133
  say "Waiting for daemon... "
@@ -134,6 +149,8 @@ module Skylight
134
149
  if daemon_running
135
150
  say "Success", :green
136
151
  else
152
+ encountered_error!
153
+
137
154
  say "Failed", :red
138
155
  end
139
156
  end
@@ -141,8 +158,8 @@ module Skylight
141
158
  say "\n"
142
159
  end
143
160
 
144
- def status
145
- say "All checks passed!", :green
161
+ def wrap_up
162
+ done!
146
163
  end
147
164
 
148
165
  private
@@ -163,6 +180,42 @@ module Skylight
163
180
  super
164
181
  end
165
182
  end
183
+
184
+ def is_mac?
185
+ Util::Platform::OS == 'darwin'
186
+ end
187
+
188
+ # NOTE: This check won't work correctly on Windows
189
+ def has_rvm?
190
+ if @has_rvm.nil?
191
+ @has_rvm = system("which rvm > /dev/null");
192
+ end
193
+ @has_rvm
194
+ end
195
+
196
+ def encountered_error!
197
+ @has_errors = true
198
+ end
199
+
200
+ def has_errors?
201
+ @has_errors
202
+ end
203
+
204
+ def done!
205
+ shell.padding = 0
206
+ say "\n\n"
207
+
208
+ if has_errors?
209
+ say "Skylight Doctor found some errors. Please review the output above.", :red
210
+ say "If you have any further questions, please contact support@skylight.io.", :yellow
211
+ exit 1
212
+ else
213
+ say "All checks passed!", :green
214
+ say "If you're still having trouble, please contact support@skylight.io.", :yellow
215
+ exit 0
216
+ end
217
+ end
218
+
166
219
  end
167
220
  end
168
- end
221
+ end
@@ -1,4 +1,4 @@
1
1
  module Skylight
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport