fastlane_core 0.46.3 → 0.47.0

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: 4b0214358b14e3586af63825d39d4ea34a05abfb
4
- data.tar.gz: 9f8bf1d501384e32f2833cac4694b28d15955b25
3
+ metadata.gz: a7185fbff80f72401005c7636415172c76d64a6a
4
+ data.tar.gz: aa78f033508315cee114f3ad8071452670f951ef
5
5
  SHA512:
6
- metadata.gz: 065b94851db39b584bf1c8a5430404d941c6532628845e289088b659af533eb178b50f7f5d69ff9b81f7e1d2b09e382c138cb5c1b4c5ec9f63cc6f6445e16498
7
- data.tar.gz: 983e08ed5200832d75d45f8bb969f13b6fffc6c35d22a55b1bc9e4b7601160b9a756788854d0a4b4cb4cc3203019418e813cd88fe367b33f853c68a252995326
6
+ metadata.gz: 28840e3cc161f4e899de2b9991d8941448416ddb9489c27c969ac19abe1b64983c5b9d8bfdcbaba80581bedd76e36d02d01d954d86a07c01b1e383295342bc84
7
+ data.tar.gz: 68e1e5731ca4cb268fcaaff18db650d61f239bf8b11ca07f4d4c6b8f4aa0fb86afc16fe9a525d65f6cdf2cce35a445098c308f236f43164529e1e8d60e096503
@@ -40,6 +40,7 @@ module Commander
40
40
  abort e.to_s
41
41
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
42
42
  collector.did_raise_error(@program[:name])
43
+ show_github_issues(e.message)
43
44
  display_user_error!(e, e.message)
44
45
  rescue => e # high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
45
46
  collector.did_crash(@program[:name])
@@ -59,8 +60,13 @@ module Commander
59
60
 
60
61
  if error_info
61
62
  error_info = error_info.join("\n\t") if error_info.kind_of?(Array)
63
+
64
+ show_github_issues(error_info)
65
+
62
66
  display_user_error!(e, error_info)
63
67
  else
68
+ show_github_issues(e.message)
69
+
64
70
  # From https://stackoverflow.com/a/4789702/445598
65
71
  # We do this to make the actual error message red and therefore more visible
66
72
  reraise_formatted!(e, e.message)
@@ -78,5 +84,19 @@ module Commander
78
84
  def reraise_formatted!(e, message)
79
85
  raise e, "[!] #{message}".red, e.backtrace
80
86
  end
87
+
88
+ def show_github_issues(message)
89
+ return if ENV["FASTLANE_HIDE_GITHUB_ISSUES"]
90
+ return if FastlaneCore::Helper.test?
91
+
92
+ require 'gh_inspector'
93
+ require 'fastlane_core/ui/github_issue_inspector_reporter'
94
+
95
+ inspector = GhInspector::Inspector.new("fastlane", "fastlane", verbose: $verbose)
96
+ delegate = Fastlane::InspectorReporter.new
97
+ inspector.search_query(message, delegate)
98
+ rescue => ex
99
+ UI.error("Error finding relevant GitHub issues: #{ex}")
100
+ end
81
101
  end
82
102
  end
@@ -0,0 +1,49 @@
1
+ module Fastlane
2
+ # Adds all the necessary emojis (obv)
3
+ #
4
+ class InspectorReporter
5
+ NUMBER_OF_ISSUES_INLINE = 3
6
+
7
+ # Called just as the investigation has begun.
8
+ def inspector_started_query(query, inspector)
9
+ puts ""
10
+ puts "Looking for related GitHub issues on #{inspector.repo_owner}/#{inspector.repo_name}..."
11
+ puts "Search query: #{query}" if $verbose
12
+ puts ""
13
+ end
14
+
15
+ # Called once the inspector has recieved a report with more than one issue.
16
+ def inspector_successfully_recieved_report(report, inspector)
17
+ report.issues[0..(NUMBER_OF_ISSUES_INLINE - 1)].each { |issue| print_issue_full(issue) }
18
+
19
+ if report.issues.count > NUMBER_OF_ISSUES_INLINE
20
+ puts "and #{report.total_results - NUMBER_OF_ISSUES_INLINE} more at: #{report.url}"
21
+ end
22
+ end
23
+
24
+ # Called once the report has been recieved, but when there are no issues found.
25
+ def inspector_recieved_empty_report(report, inspector)
26
+ puts "Found no similar issues. To create a new issue, please visit:"
27
+ puts "https://github.com/#{inspector.repo_owner}/#{inspector.repo_name}/issues/new"
28
+ end
29
+
30
+ # Called when there have been networking issues in creating the report.
31
+ def inspector_could_not_create_report(error, query, inspector)
32
+ puts "Could not access the GitHub API, you may have better luck via the website."
33
+ puts "https://github.com/#{inspector.repo_owner}/#{inspector.repo_name}/search?q=#{query}&type=Issues&utf8=✓"
34
+ puts "Error: #{error.name}"
35
+ end
36
+
37
+ private
38
+
39
+ def print_issue_full(issue)
40
+ resolved = issue.state == 'closed'
41
+ status = (resolved ? issue.state.green : issue.state.red)
42
+
43
+ puts "➡️ #{issue.title.yellow}"
44
+ puts " #{issue.html_url} [#{status}] #{issue.comments} 💬"
45
+ puts " #{Time.parse(issue.updated_at).to_pretty}"
46
+ puts ""
47
+ end
48
+ end
49
+ end
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.46.3".freeze
2
+ VERSION = "0.47.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.46.3
4
+ version: 0.47.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-09 00:00:00.000000000 Z
11
+ date: 2016-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: 1.4.5
153
+ - !ruby/object:Gem::Dependency
154
+ name: gh_inspector
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: credentials_manager
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -358,6 +372,7 @@ files:
358
372
  - lib/fastlane_core/tool_collector.rb
359
373
  - lib/fastlane_core/ui/disable_colors.rb
360
374
  - lib/fastlane_core/ui/fastlane_runner.rb
375
+ - lib/fastlane_core/ui/github_issue_inspector_reporter.rb
361
376
  - lib/fastlane_core/ui/implementations/shell.rb
362
377
  - lib/fastlane_core/ui/interface.rb
363
378
  - lib/fastlane_core/ui/ui.rb