danger-xcprofiler 0.4.0 → 0.5.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
  SHA256:
3
- metadata.gz: 98d8b6553f16e8366ff699fadb2a2353f9bb8f6813f3e20a223cba72474cbe5c
4
- data.tar.gz: bbb1c70e6efaeffd593cbf7b59d760143493e8cc578dcf16098888905c9c4959
3
+ metadata.gz: ffb92acc3f723fffe36d95a54d3e39d743c2ac24425e7cf4468992535c353ede
4
+ data.tar.gz: 236ecd6d8f3af89039d22a608b8ce261669e6cfd5dc7f27a0387ef6ce17d1f93
5
5
  SHA512:
6
- metadata.gz: bd7cdd61911169a68b9b0ce7ec7e34da47bfe43ec3e455330623fcaf60a167bb55c64c5f68f78f8df41970a071779381730769dc2d404e11ff04c159dbf5e810
7
- data.tar.gz: 22b2ae376946f27b8a13ed8eece85dc81812ab0f304e4f1cb0ecb0794cb9b0d0424fbfc5b4bd12a230b451904a0b9da5c80bc3673ba9787ec77781840abe271b
6
+ metadata.gz: c77695577fb7b5a8c527bada81931274cd86da2d213ce350078ea2b64935711b95e0d2039a0e2bbce5efc087b39e4b998ef991ef7da5de559b812c9bf72f2c3e
7
+ data.tar.gz: 99efe20d66d9ee8a2529f00ef436afe8dd7514b8456c6bd25b20fa9467d263408558c0020a7896402900ae07568b046597cc5c06acb3ae3b9a2f07b0b68c637b
@@ -0,0 +1,37 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.6', '2.7', '3.0']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
+ # uses: ruby/setup-ruby@v1
30
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
+ - name: Run tests
35
+ run: |
36
+ bundle exec rake
37
+ bundle exec rubocop
data/.rubocop.yml CHANGED
@@ -1,3 +1,6 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
1
4
  Metrics/ModuleLength:
2
5
  Max: 120
3
6
 
@@ -22,3 +25,9 @@ Lint/DuplicateMethods:
22
25
 
23
26
  Style/DoubleNegation:
24
27
  Enabled: false
28
+
29
+ Style/FrozenStringLiteralComment:
30
+ Enabled: false
31
+
32
+ Metrics/CyclomaticComplexity:
33
+ Max: 10
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.2
data/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # danger-xcprofiler
2
- [![Build Status](https://travis-ci.org/giginet/danger-xcprofiler.svg?branch=master)](https://travis-ci.org/giginet/danger-xcprofiler)
3
- [![Coverage Status](https://coveralls.io/repos/github/giginet/danger-xcprofiler/badge.svg?branch=master)](https://coveralls.io/github/giginet/danger-xcprofiler?branch=master)
2
+ ![GitHub Action](https://github.com/giginet/danger-xcprofiler/actions/workflows/ruby.yml/badge.svg)
4
3
  [![Gem Version](https://badge.fury.io/rb/danger-xcprofiler.svg)](https://badge.fury.io/rb/danger-xcprofiler)
5
4
 
6
5
  [danger](https://github.com/danger/danger) plugin for asserting Swift compilation time.
@@ -25,6 +24,12 @@ Just add this line to your Dangerfile:
25
24
  xcprofiler.report 'MyApp'
26
25
  ```
27
26
 
27
+ Or specify an xcactivitylog path
28
+ ```ruby
29
+ logDir = Dir[File.join('DerivedData/Logs/Build/', '*.xcactivitylog')].first
30
+ xcprofiler.report nil, nil, logDir
31
+ ```
32
+
28
33
  If compilation times of each methods are exceeded the thresholds, `danger` adds inline comment to your PR.
29
34
 
30
35
  Default thresholds is 50ms for warning, 100ms for failure.
@@ -1,8 +1,6 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'xcprofiler/gem_version.rb'
3
+ require 'xcprofiler/gem_version'
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = 'danger-xcprofiler'
@@ -19,18 +17,17 @@ Gem::Specification.new do |spec|
19
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
18
  spec.require_paths = ['lib']
21
19
 
20
+ spec.required_ruby_version = '>= 2.6'
21
+
22
22
  spec.add_dependency 'xcprofiler'
23
23
  spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
24
24
 
25
25
  # General ruby development
26
- spec.add_development_dependency 'bundler', '~> 1.3'
27
- spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'bundler'
27
+ spec.add_development_dependency 'rake'
28
28
 
29
29
  # Testing support
30
- spec.add_development_dependency 'rspec', '~> 3.4'
31
-
32
- # Calculating code coverage
33
- spec.add_development_dependency 'coveralls'
30
+ spec.add_development_dependency 'rspec'
34
31
 
35
32
  # Linting code and docs
36
33
  spec.add_development_dependency 'rubocop'
@@ -1,3 +1,3 @@
1
1
  module DangerXcprofiler
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
@@ -48,9 +48,15 @@ module Danger
48
48
  # Search the latest .xcactivitylog by the passing product_name and profile compilation time
49
49
  # @param [String] product_name Product name for the target project.
50
50
  # @param [String] derived_data_path Path to the directory containing the DerivedData.
51
+ # @param [String] log_path Path to the xcactivitylog to process.
51
52
  # @return [void]
52
- def report(product_name, derived_data_path = nil)
53
- profiler = Xcprofiler::Profiler.by_product_name(product_name, derived_data_path)
53
+ def report(product_name, derived_data_path = nil, log_path = nil)
54
+ profiler = if log_path&.end_with?('.xcactivitylog')
55
+ Xcprofiler::Profiler.by_path(log_path)
56
+ else
57
+ Xcprofiler::Profiler.by_product_name(product_name, derived_data_path)
58
+ end
59
+
54
60
  profiler.reporters = [
55
61
  DangerReporter.new(@dangerfile, thresholds, inline_mode, working_dir, ignored_files)
56
62
  ]
data/spec/spec_helper.rb CHANGED
@@ -1,10 +1,7 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
-
4
1
  require 'pathname'
5
2
  ROOT = Pathname.new(File.expand_path('..', __dir__))
6
- $LOAD_PATH.unshift((ROOT + 'lib').to_s)
7
- $LOAD_PATH.unshift((ROOT + 'spec').to_s)
3
+ $LOAD_PATH.unshift("#{ROOT}lib".to_s)
4
+ $LOAD_PATH.unshift("#{ROOT}spec".to_s)
8
5
 
9
6
  require 'bundler/setup'
10
7
  require 'pry'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-xcprofiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - giginet
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-09 00:00:00.000000000 Z
11
+ date: 2021-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcprofiler
@@ -42,46 +42,32 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.4'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.4'
83
- - !ruby/object:Gem::Dependency
84
- name: coveralls
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - ">="
@@ -185,10 +171,10 @@ executables: []
185
171
  extensions: []
186
172
  extra_rdoc_files: []
187
173
  files:
188
- - ".coveralls.yml"
174
+ - ".github/workflows/ruby.yml"
189
175
  - ".gitignore"
190
176
  - ".rubocop.yml"
191
- - ".travis.yml"
177
+ - ".ruby-version"
192
178
  - Gemfile
193
179
  - Guardfile
194
180
  - LICENSE.txt
@@ -207,7 +193,7 @@ homepage: https://github.com/giginet/danger-xcprofiler
207
193
  licenses:
208
194
  - MIT
209
195
  metadata: {}
210
- post_install_message:
196
+ post_install_message:
211
197
  rdoc_options: []
212
198
  require_paths:
213
199
  - lib
@@ -215,16 +201,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
201
  requirements:
216
202
  - - ">="
217
203
  - !ruby/object:Gem::Version
218
- version: '0'
204
+ version: '2.6'
219
205
  required_rubygems_version: !ruby/object:Gem::Requirement
220
206
  requirements:
221
207
  - - ">="
222
208
  - !ruby/object:Gem::Version
223
209
  version: '0'
224
210
  requirements: []
225
- rubyforge_project:
226
- rubygems_version: 2.7.6
227
- signing_key:
211
+ rubygems_version: 3.2.22
212
+ signing_key:
228
213
  specification_version: 4
229
214
  summary: danger plugin for asserting Swift compilation time.
230
215
  test_files:
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- service_name: travis-ci
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- cache:
3
- directories:
4
- - bundle
5
-
6
- rvm:
7
- - 2.1.3
8
- - 2.3.1
9
-
10
- script:
11
- - bundle exec rake spec