danger-xcprofiler 0.1.0 → 0.2.0
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 +4 -4
- data/.coveralls.yml +1 -0
- data/.gitignore +53 -4
- data/README.md +2 -0
- data/danger-xcprofiler.gemspec +3 -0
- data/lib/xcprofiler/danger_reporter.rb +8 -1
- data/lib/xcprofiler/gem_version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/spec/xcprofiler_spec.rb +6 -8
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58787f96f3db5f505748ca1532c89bc7686fc084
|
4
|
+
data.tar.gz: fbe9fd4ef7f9e6e970b2a4ac2e86af6ae8639967
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17e3d2e656fac5bb7ae49c74ac8a51427f71abf96a4cee082c7e1515c40dab02aa284d37bcd6ab85949e652d19d2b8803af09b109f72b2608b7411e0cb2328d3
|
7
|
+
data.tar.gz: ee1878fb82f7845d4540d3661d199e62f1735b25d0f730e291a2ead922f7f7846e41769777b6e5b9b3f2ef4b9d6710a752b2caac3ac94ad8feed195042279e0b
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
CHANGED
@@ -1,5 +1,54 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
|
1
|
+
### https://raw.github.com/github/gitignore//Ruby.gitignore
|
2
|
+
|
3
|
+
*.gem
|
4
|
+
*.rbc
|
5
|
+
/.config
|
6
|
+
/coverage/
|
7
|
+
/InstalledFiles
|
8
|
+
/pkg/
|
9
|
+
/spec/reports/
|
10
|
+
/spec/examples.txt
|
11
|
+
/test/tmp/
|
12
|
+
/test/version_tmp/
|
13
|
+
/tmp/
|
14
|
+
|
15
|
+
# Used by dotenv library to load environment variables.
|
16
|
+
# .env
|
17
|
+
|
18
|
+
## Specific to RubyMotion:
|
19
|
+
.dat*
|
20
|
+
.repl_history
|
21
|
+
build/
|
22
|
+
*.bridgesupport
|
23
|
+
build-iPhoneOS/
|
24
|
+
build-iPhoneSimulator/
|
25
|
+
|
26
|
+
## Specific to RubyMotion (use of CocoaPods):
|
27
|
+
#
|
28
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
29
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
30
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
31
|
+
#
|
32
|
+
# vendor/Pods/
|
33
|
+
|
34
|
+
## Documentation cache and generated files:
|
35
|
+
/.yardoc/
|
36
|
+
/_yardoc/
|
37
|
+
/doc/
|
38
|
+
/rdoc/
|
39
|
+
|
40
|
+
## Environment normalization:
|
41
|
+
/.bundle/
|
42
|
+
/vendor/bundle
|
43
|
+
/lib/bundler/man/
|
44
|
+
|
45
|
+
# for a library or gem, you might want to ignore these files since the code is
|
46
|
+
# intended to run in multiple environments; otherwise, check them in:
|
4
47
|
Gemfile.lock
|
5
|
-
.
|
48
|
+
# .ruby-version
|
49
|
+
# .ruby-gemset
|
50
|
+
|
51
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
52
|
+
.rvmrc
|
53
|
+
|
54
|
+
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# danger-xcprofiler
|
2
2
|
[](https://travis-ci.org/giginet/danger-xcprofiler)
|
3
|
+
[](https://coveralls.io/github/giginet/danger-xcprofiler?branch=master)
|
4
|
+
[](https://badge.fury.io/rb/danger-xcprofiler)
|
3
5
|
|
4
6
|
[danger](https://github.com/danger/danger) plugin for asserting Swift compilation time.
|
5
7
|
|
data/danger-xcprofiler.gemspec
CHANGED
@@ -29,6 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
# Testing support
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3.4'
|
31
31
|
|
32
|
+
# Calculating code coverage
|
33
|
+
spec.add_development_dependency 'coveralls'
|
34
|
+
|
32
35
|
# Linting code and docs
|
33
36
|
spec.add_development_dependency 'rubocop', '~> 0.41'
|
34
37
|
spec.add_development_dependency 'yard', '~> 0.8'
|
@@ -18,7 +18,8 @@ module Danger
|
|
18
18
|
options[:file] = relative_path(execution.path)
|
19
19
|
options[:line] = execution.line
|
20
20
|
end
|
21
|
-
message =
|
21
|
+
message = message(execution)
|
22
|
+
|
22
23
|
if execution.time >= @thresholds[:fail]
|
23
24
|
@dangerfile.fail(message, options)
|
24
25
|
elsif execution.time >= @thresholds[:warn]
|
@@ -29,6 +30,12 @@ module Danger
|
|
29
30
|
|
30
31
|
private
|
31
32
|
|
33
|
+
def message(execution)
|
34
|
+
message = "`#{execution.method_name}` takes #{execution.time} ms to build"
|
35
|
+
return message if @inline_mode
|
36
|
+
"[#{execution.filename}] #{message}"
|
37
|
+
end
|
38
|
+
|
32
39
|
def relative_path(path)
|
33
40
|
working_dir = Pathname.new(@working_dir)
|
34
41
|
Pathname.new(path).relative_path_from(working_dir).to_s
|
data/spec/spec_helper.rb
CHANGED
data/spec/xcprofiler_spec.rb
CHANGED
@@ -13,8 +13,8 @@ module Danger
|
|
13
13
|
let(:profiler) { Xcprofiler::Profiler.new(derived_data) }
|
14
14
|
let(:location) { 'path/to/Source.swift:20:30' }
|
15
15
|
let(:method_name) { 'doSomething()' }
|
16
|
-
let(:time0) {
|
17
|
-
let(:time1) {
|
16
|
+
let(:time0) { 99.9 }
|
17
|
+
let(:time1) { 100 }
|
18
18
|
let(:execution0) { Xcprofiler::Execution.new(time0, location, method_name) }
|
19
19
|
let(:execution1) { Xcprofiler::Execution.new(time1, location, method_name) }
|
20
20
|
|
@@ -45,8 +45,6 @@ module Danger
|
|
45
45
|
end
|
46
46
|
|
47
47
|
context 'with very slow execution' do
|
48
|
-
let(:time0) { 99.9 }
|
49
|
-
let(:time1) { 100 }
|
50
48
|
it 'asserts failure' do
|
51
49
|
@xcprofiler.report(product_name)
|
52
50
|
expect(@dangerfile).to have_received(:fail).with('`doSomething()` takes 100.0 ms to build',
|
@@ -96,16 +94,16 @@ module Danger
|
|
96
94
|
let(:time1) { 50 }
|
97
95
|
it 'asserts warning' do
|
98
96
|
@xcprofiler.report(product_name)
|
99
|
-
expect(@dangerfile).to have_received(:warn)
|
97
|
+
expect(@dangerfile).to have_received(:warn)
|
98
|
+
.with('[Source.swift] `doSomething()` takes 50.0 ms to build', {})
|
100
99
|
end
|
101
100
|
end
|
102
101
|
|
103
102
|
context 'with very slow execution' do
|
104
|
-
let(:time0) { 99.9 }
|
105
|
-
let(:time1) { 100 }
|
106
103
|
it 'asserts failure' do
|
107
104
|
@xcprofiler.report(product_name)
|
108
|
-
expect(@dangerfile).to have_received(:fail)
|
105
|
+
expect(@dangerfile).to have_received(:fail)
|
106
|
+
.with('[Source.swift] `doSomething()` takes 100.0 ms to build', {})
|
109
107
|
end
|
110
108
|
end
|
111
109
|
end
|
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
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- giginet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcprofiler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.4'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rubocop
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,6 +185,7 @@ executables: []
|
|
171
185
|
extensions: []
|
172
186
|
extra_rdoc_files: []
|
173
187
|
files:
|
188
|
+
- ".coveralls.yml"
|
174
189
|
- ".gitignore"
|
175
190
|
- ".rubocop.yml"
|
176
191
|
- ".travis.yml"
|
@@ -208,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
223
|
version: '0'
|
209
224
|
requirements: []
|
210
225
|
rubyforge_project:
|
211
|
-
rubygems_version: 2.5.
|
226
|
+
rubygems_version: 2.5.1
|
212
227
|
signing_key:
|
213
228
|
specification_version: 4
|
214
229
|
summary: danger plugin for asserting Swift compilation time.
|