fastlane_core 0.43.0 → 0.43.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e1f8f4483072a22729df956093d77ccb7038a42
4
- data.tar.gz: c7f140b5b470fb9cdc552fb51f4403073fbb2178
3
+ metadata.gz: 7338920a9e707f019a03f32f2fed9ae1b6fc8789
4
+ data.tar.gz: 3b89484069d5ac342ad9e7987c67c132d1998541
5
5
  SHA512:
6
- metadata.gz: 222d88fa8160bb9ec77d991c772007862e0959066a14fbf18bdd1f46f6f2ddbbcf76356d46e6c533fdbf4868cb83f81980167d94be539f08d1e565befaa1fe7d
7
- data.tar.gz: 50d7d27a770fa0dce3c36a5841079afcb00ea5c6e914439406606950edb62a95ed963bca7f65f435112728e5a22ce628f2daa271ec005235d54f945246d4e01f
6
+ metadata.gz: 84de0848ed6f85b1501ccd5ad0d90e0266d6156f5bbfd0ac1b42dd6639f547bf313c65b9c5da14d72b8937842f86ef70ca1f11357127008bb8bb1e7b56587c9d
7
+ data.tar.gz: 5d6ee2cdf28880408bf5a897fd7166ea7356fc7a2d8734db2339397dd0fc8e7cc45af82d7b09d31aab6afbe44a5755d6cfc0bde8f72cfaa475d4c90ac6735862
@@ -19,6 +19,7 @@ require 'fastlane_core/project'
19
19
  require 'fastlane_core/device_manager'
20
20
  require 'fastlane_core/crash_reporting/crash_reporting'
21
21
  require 'fastlane_core/ui/ui'
22
+ require 'fastlane_core/tool_collector'
22
23
 
23
24
  # Third Party code
24
25
  require 'colored'
@@ -0,0 +1,71 @@
1
+ module FastlaneCore
2
+ class ToolCollector
3
+ HOST_URL = "https://fastlane-enhancer.herokuapp.com"
4
+
5
+ attr_reader :error
6
+
7
+ def did_launch_action(name)
8
+ name = name.to_sym
9
+ launches[name] += 1 if is_official?(name)
10
+ end
11
+
12
+ def did_raise_error(name)
13
+ name = name.to_sym
14
+ @error = name if is_official?(name)
15
+ end
16
+
17
+ def did_finish
18
+ return false if ENV["FASTLANE_OPT_OUT_USAGE"]
19
+
20
+ if !did_show_message? and !Helper.is_ci?
21
+ show_message
22
+ end
23
+
24
+ require 'excon'
25
+ url = HOST_URL + '/did_launch?'
26
+ url += URI.encode_www_form(
27
+ steps: launches.to_json,
28
+ error: @error
29
+ )
30
+
31
+ if Helper.is_test? # don't send test data
32
+ return url
33
+ else
34
+ fork do
35
+ begin
36
+ Excon.post(url)
37
+ rescue
38
+ # we don't want to show a stack trace if something goes wrong
39
+ end
40
+ end
41
+ return true
42
+ end
43
+ rescue
44
+ # We don't care about connection errors
45
+ end
46
+
47
+ def show_message
48
+ UI.message("Sending Crash/Success information. More information on: https://github.com/fastlane/enhancer")
49
+ UI.message("No personal/sensitive data is sent. Only sharing the following:")
50
+ UI.message(launches)
51
+ UI.message(@error) if @error
52
+ UI.message("This information is used to fix failing tools and improve those that are most often used.")
53
+ UI.message("You can disable this by setting the environment variable: FASTLANE_OPT_OUT_USAGE=1")
54
+ end
55
+
56
+ def launches
57
+ @launches ||= Hash.new(0)
58
+ end
59
+
60
+ def is_official?(name)
61
+ return true
62
+ end
63
+
64
+ def did_show_message?
65
+ path = File.join(File.expand_path('~'), '.did_show_opt_info')
66
+ did_show = File.exist?(path)
67
+ File.write(path, '1') unless did_show
68
+ did_show
69
+ end
70
+ end
71
+ end
@@ -19,8 +19,12 @@ module Commander
19
19
  parse_global_options
20
20
  remove_global_options options, @args
21
21
 
22
+ collector = FastlaneCore::ToolCollector.new
23
+
22
24
  begin
25
+ collector.did_launch_action(@program[:name])
23
26
  run_active_command
27
+ collector.did_finish
24
28
  rescue InvalidCommandError => e
25
29
  abort "#{e}. Use --help for more information"
26
30
  rescue Interrupt => ex
@@ -36,8 +40,10 @@ module Commander
36
40
  OptionParser::MissingArgument => e
37
41
  abort e.to_s
38
42
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
43
+ collector.did_raise_error(@program[:name])
39
44
  display_user_error!(e, e.message)
40
45
  rescue => e # high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
46
+ collector.did_raise_error(@program[:name])
41
47
  handle_unknown_error!(e)
42
48
  end
43
49
  end
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.43.0".freeze
2
+ VERSION = "0.43.1".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.43.0
4
+ version: 0.43.1
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-05-01 00:00:00.000000000 Z
11
+ date: 2016-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -370,6 +370,7 @@ files:
370
370
  - lib/fastlane_core/project.rb
371
371
  - lib/fastlane_core/provisioning_profile.rb
372
372
  - lib/fastlane_core/string_filters.rb
373
+ - lib/fastlane_core/tool_collector.rb
373
374
  - lib/fastlane_core/ui/disable_colors.rb
374
375
  - lib/fastlane_core/ui/fastlane_runner.rb
375
376
  - lib/fastlane_core/ui/implementations/shell.rb
@@ -399,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
400
  version: '0'
400
401
  requirements: []
401
402
  rubyforge_project:
402
- rubygems_version: 2.4.0
403
+ rubygems_version: 2.4.5.1
403
404
  signing_key:
404
405
  specification_version: 4
405
406
  summary: Contains all shared code/dependencies of the fastlane.tools