crep 1.0.1 → 1.0.2

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
- SHA1:
3
- metadata.gz: 9e68c3928d59e06f5e2ec9c38ad0b4bc85c3cfa7
4
- data.tar.gz: 69355f2f6cdefabc28ef9b0e71d0abdc012a12a3
2
+ SHA256:
3
+ metadata.gz: 1f850691e9c5310d08744bfe8a5bec641d2d5f66f31e740ee0649a6eace15193
4
+ data.tar.gz: 74a17e8a6bb887ff990b8de51fc30aea0641b3e6c55ed7e1618ca55cf0d5909e
5
5
  SHA512:
6
- metadata.gz: a67197963039aeda80eea053d1c0bff6ffa20cec630223782ddfb8f3c32d3c2dba3c104e6f13c7ee74ed59c2b3dfba5d5526714a0edb398bdfd158ca0b3ef70a
7
- data.tar.gz: d24461deb9766f4a0f3d83f33ec4257513154628601ca3492ac0465920ab74708f2e66339417477e9edf709d4f669af81e1fa81a2fb9e2789cb9e5af800c2345
6
+ metadata.gz: 4cbff327806fd717670fc4708b30b666d500a579b2be4053db97036362a6620b2ee118f09b41fd1468b4fda63b8d8fef5ef0df26d430573fd02d138496a69a29
7
+ data.tar.gz: 8f650185f26a56a2d96daeefaef9538bb17b78d208dfd2ab0c93afd562e811c50dec3b9399570e07584867e08b4dfdae525739dd88ff481cb010965b484e6001
data/.rubocop.yml CHANGED
@@ -15,3 +15,10 @@ Metrics/ParameterLists:
15
15
  Style/Documentation:
16
16
  Enabled: false
17
17
 
18
+ Metrics/BlockLength:
19
+ Exclude:
20
+ - 'spec/*_spec.rb'
21
+ - '*.gemspec'
22
+
23
+ Metrics/AbcSize:
24
+ Enabled: false
data/Changelog.md CHANGED
@@ -6,10 +6,20 @@
6
6
 
7
7
  ### Fixed
8
8
 
9
- - Reduced the size of the gem by removing unused assets being bundled with it.
10
-
11
9
  ### Miscellaneous
12
10
 
11
+ # v1.0.2
12
+
13
+ ### Added
14
+
15
+ - Support for generating top crashes without providing a version/build
16
+
17
+ # v1.0.1
18
+
19
+ ### Fixed
20
+
21
+ - Reduced the size of the gem by removing unused assets being bundled with it.
22
+
13
23
  # v1.0.0
14
24
 
15
25
  ### Added
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  # contains Support for Statistics
9
- gem 'hockeyapp', git: 'https://github.com/q231950/hockeyapp.git'
9
+ gem 'hockeyapp', git: 'https://github.com/xing/hockeyapp.git'
10
10
 
11
11
  gem 'danger'
12
12
  gem 'danger-rubocop'
data/Gemfile.lock CHANGED
@@ -1,5 +1,5 @@
1
1
  GIT
2
- remote: https://github.com/q231950/hockeyapp.git
2
+ remote: https://github.com/xing/hockeyapp.git
3
3
  revision: 67bdabfdae885e59c977cf30765ac6346dd0ab57
4
4
  specs:
5
5
  hockeyapp (0.0.17)
@@ -14,7 +14,7 @@ GIT
14
14
  PATH
15
15
  remote: .
16
16
  specs:
17
- crep (1.0.1)
17
+ crep (1.0.2)
18
18
  claide (~> 1.0.0)
19
19
  colorize
20
20
  hockeyapp
@@ -22,11 +22,11 @@ PATH
22
22
  GEM
23
23
  remote: https://rubygems.org/
24
24
  specs:
25
- activemodel (5.1.4)
26
- activesupport (= 5.1.4)
27
- activesupport (5.1.4)
25
+ activemodel (5.2.1)
26
+ activesupport (= 5.2.1)
27
+ activesupport (5.2.1)
28
28
  concurrent-ruby (~> 1.0, >= 1.0.2)
29
- i18n (~> 0.7)
29
+ i18n (>= 0.7, < 2)
30
30
  minitest (~> 5.1)
31
31
  tzinfo (~> 1.1)
32
32
  addressable (2.5.2)
@@ -61,7 +61,7 @@ GEM
61
61
  danger
62
62
  rubocop
63
63
  diff-lcs (1.3)
64
- docile (1.1.5)
64
+ docile (1.3.1)
65
65
  faraday (0.13.1)
66
66
  multipart-post (>= 1.2, < 3)
67
67
  faraday-http-cache (1.3.1)
@@ -71,9 +71,9 @@ GEM
71
71
  httparty (>= 0.7.3)
72
72
  mimemagic
73
73
  multipart-post
74
- httparty (0.15.6)
74
+ httparty (0.16.2)
75
75
  multi_xml (>= 0.5.2)
76
- i18n (0.9.3)
76
+ i18n (1.1.0)
77
77
  concurrent-ruby (~> 1.0)
78
78
  json (2.1.0)
79
79
  kramdown (1.16.2)
@@ -126,15 +126,15 @@ GEM
126
126
  sawyer (0.8.1)
127
127
  addressable (>= 2.3.5, < 2.6)
128
128
  faraday (~> 0.8, < 1.0)
129
- simplecov (0.15.1)
130
- docile (~> 1.1.0)
129
+ simplecov (0.16.1)
130
+ docile (~> 1.1)
131
131
  json (>= 1.8, < 3)
132
132
  simplecov-html (~> 0.10.0)
133
133
  simplecov-html (0.10.2)
134
134
  terminal-table (1.8.0)
135
135
  unicode-display_width (~> 1.1, >= 1.1.1)
136
136
  thread_safe (0.3.6)
137
- tzinfo (1.2.4)
137
+ tzinfo (1.2.5)
138
138
  thread_safe (~> 0.1)
139
139
  unicode-display_width (1.3.0)
140
140
 
@@ -154,4 +154,4 @@ DEPENDENCIES
154
154
  rubocop (= 0.51.0)
155
155
 
156
156
  BUNDLED WITH
157
- 1.16.1
157
+ 1.16.2
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2017 XING SE
3
+ Copyright (c) 2018 XING SE
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/Readme.md CHANGED
@@ -25,7 +25,10 @@ Please follow our guide in the [installation instructions](https://github.com/xi
25
25
  $ export CREP_HOCKEY_API_TOKEN='abcde'
26
26
 
27
27
  # Run Crep
28
- $ bundle exec crep crashes --identifier='com.example.company' --version='1.23.0' --build='42' --only-unresolved
28
+ $ bundle exec crep crashes --identifier='com.example.company' --version='1.23.0' --build='42'
29
+
30
+ # Run Crep for the latest version and build
31
+ $ bundle exec crep crashes --identifier='com.example.company' --only-unresolved
29
32
  ```
30
33
 
31
34
  The `--only-unresolved` flag filters out any crashes marked as resolved.
data/crep.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
20
20
  # to allow pushing to a single host or delete this section to allow pushing to any host.
21
21
  if spec.respond_to?(:metadata)
22
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
22
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
23
23
  else
24
24
  raise 'RubyGems 2.0 or newer is required to protect against ' \
25
25
  'public gem pushes.'
@@ -3,6 +3,7 @@
3
3
  require 'crep/command'
4
4
  require 'crep/crash_controller'
5
5
  require 'crep/model/crash_sources/hockeyapp_crash_source'
6
+ require 'crep/model/app_source/hockeyapp_app_source'
6
7
  require 'hockeyapp'
7
8
 
8
9
  module Crep
@@ -44,14 +45,16 @@ module Crep
44
45
  super
45
46
 
46
47
  help! 'The identifier (--identifier) is a required parameter' unless @bundle_identifier
47
- help! 'The version (--version) is a required parameter' unless @version
48
- help! 'The build number (--build) is a required parameter' unless @build
49
48
  end
50
49
 
51
50
  def run
52
51
  crash_datasource = HockeyAppCrashSource.new
53
52
  crash_controller = CrashController.new(@bundle_identifier, @top, crash_datasource, @show_only_unresolved, @template)
54
- crash_controller.top_crashes(@version, @build)
53
+ if @version && @build
54
+ crash_controller.top_crashes(@version, @build)
55
+ else
56
+ crash_controller.latest_top_crashes
57
+ end
55
58
  end
56
59
  end
57
60
  end
@@ -17,6 +17,17 @@ module Crep
17
17
  @template_path = template_path
18
18
  end
19
19
 
20
+ def latest_top_crashes
21
+ app_source = HockeyAppAppSource.new
22
+ app_source.configure
23
+ latest_top_crashes_with_app_source(app_source)
24
+ end
25
+
26
+ def latest_top_crashes_with_app_source(app_source)
27
+ latest_app = app_source.versions_for_bundle_identifier(@bundle_identifier).first
28
+ top_crashes(latest_app.version, latest_app.build)
29
+ end
30
+
20
31
  # returns list of top crashes for the given build
21
32
  def top_crashes(version, build)
22
33
  @version = version
@@ -12,6 +12,11 @@ module Crep
12
12
  raise 'AppSource subclass has to implement the `apps` method.'
13
13
  end
14
14
 
15
+ # versions_for_bundle_identifier returns the versions for the first found app with the given bundle identifier
16
+ def versions_for_bundle_identifier(_bundle_identifier)
17
+ raise 'AppSource subclass has to implement the `versions_for_bundle_identifier` method.'
18
+ end
19
+
15
20
  # versions returns the versions for the given app identifier
16
21
  def versions(_app_identifier)
17
22
  raise 'AppSource subclass has to implement the `versions` method.'
@@ -19,10 +19,31 @@ module Crep
19
19
  @client.get_apps
20
20
  end
21
21
 
22
- def versions(app_identifier)
23
- apps = @client.get_apps.select do |a|
22
+ def versions_for_bundle_identifier(bundle_identifier)
23
+ apps = apps_for_bundle_identifier(bundle_identifier)
24
+
25
+ raise("Unable to find app with bundle identifier: #{bundle_identifier}") unless apps.count.positive?
26
+
27
+ app = apps.first
28
+ app.versions.map do |version|
29
+ Crep::Version.new(version.shortversion, version.version, app.public_identifier.downcase)
30
+ end
31
+ end
32
+
33
+ def apps_for_bundle_identifier(bundle_identifier)
34
+ @client.get_apps.select do |a|
35
+ a.bundle_identifier.casecmp(bundle_identifier.downcase).zero?
36
+ end
37
+ end
38
+
39
+ def apps_for_app_identifier(app_identifier)
40
+ @client.get_apps.select do |a|
24
41
  a.public_identifier == app_identifier
25
42
  end
43
+ end
44
+
45
+ def versions(app_identifier)
46
+ apps = apps_for_app_identifier(app_identifier)
26
47
 
27
48
  raise("Unable to find app with identifier: #{app_identifier}") unless apps.count.positive?
28
49
 
@@ -36,19 +36,25 @@ module Crep
36
36
  def crash_groups(version, show_only_unresolved)
37
37
  reasons = version.crash_reasons('sort' => 'number_of_crashes', 'order' => 'desc')
38
38
  unresolved_reasons = show_only_unresolved ? unresolved_reasons(reasons) : reasons
39
+ crashes_from_reasons(unresolved_reasons)
40
+ end
41
+
42
+ def crashes_from_reasons(unresolved_reasons)
39
43
  unresolved_reasons.map do |reason|
40
- url = url(app_id: reason.app.public_identifier, version_id: version.id, reason_id: reason.id)
41
- deep_link = deep_link(app_id: reason.app.public_identifier, reason_id: reason.id)
42
- Crash.new(file_line: "#{reason.file}:#{reason.line}",
43
- occurrences: reason.number_of_crashes,
44
- reason: reason.reason,
45
- crash_class: reason.crash_class,
46
- registered_at: Date.parse(reason.created_at),
47
- deep_link: deep_link,
48
- url: url)
44
+ crash_from_reason(reason)
49
45
  end
50
46
  end
51
47
 
48
+ def crash_from_reason(reason)
49
+ Crash.new(file_line: "#{reason.file}:#{reason.line}",
50
+ occurrences: reason.number_of_crashes,
51
+ reason: reason.reason,
52
+ crash_class: reason.crash_class,
53
+ registered_at: Date.parse(reason.created_at),
54
+ deep_link: deep_link(app_id: reason.app.public_identifier, reason_id: reason.id),
55
+ url: url(app_id: reason.app.public_identifier, version_id: version.id, reason_id: reason.id))
56
+ end
57
+
52
58
  def url(app_id:, version_id:, reason_id:)
53
59
  "https://rink.hockeyapp.net/manage/apps/#{app_id}/app_versions/#{version_id}/crash_reasons/#{reason_id}"
54
60
  end
data/lib/crep/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crep
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kim Dung-Pham
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-08-13 00:00:00.000000000 Z
13
+ date: 2018-08-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: colorize
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  version: '0'
205
205
  requirements: []
206
206
  rubyforge_project:
207
- rubygems_version: 2.5.1
207
+ rubygems_version: 2.7.7
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: Create Crash Reports with ease.