xcknife 0.11.1 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +168 -0
- data/.travis.yml +1 -1
- data/.vscode/configure.sh +23 -0
- data/.vscode/vscode_ruby.json.template +44 -0
- data/Gemfile +10 -2
- data/Gemfile.lock +43 -15
- data/Rakefile +14 -10
- data/bin/xcknife +2 -0
- data/bin/xcknife-min +12 -15
- data/bin/xcknife-test-dumper +2 -0
- data/example/run_example.rb +10 -8
- data/example/xcknife-exemplar-historical-data.json-stream +3 -3
- data/example/xcknife-exemplar.json-stream +3 -3
- data/lib/xcknife.rb +3 -1
- data/lib/xcknife/events_analyzer.rb +11 -6
- data/lib/xcknife/exceptions.rb +2 -0
- data/lib/xcknife/json_stream_parser_helper.rb +8 -8
- data/lib/xcknife/runner.rb +18 -19
- data/lib/xcknife/stream_parser.rb +39 -30
- data/lib/xcknife/test_dumper.rb +155 -121
- data/lib/xcknife/xcscheme_analyzer.rb +9 -9
- data/lib/xcknife/xctool_cmd_helper.rb +16 -4
- data/xcknife.gemspec +8 -6
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79b1c563a88dfb2d6fb4cf6cefd1c845c320b555804c58c72e8ccbb7525f4f2a
|
4
|
+
data.tar.gz: dd72d8692ff7d834c54b24f4c028ee1b85e8f63978a8b44a0cc315462f21c259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e2d19bd7130d60a1301a125cb7ba88fedb61910732ec7adf63be818872349976801f61747416c3d7a2323bbbe15cffef4207756718ae7bb3ba57687bb76eeb4
|
7
|
+
data.tar.gz: 1b2909467c40f7277bcebd48cde21b321a9432cdc868a928425a06a25dec01f638d7d2bd64f3d5741aac47aa4e4b680681b1a2be3cebb2cef364e93376b007e3
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
|
4
|
+
Layout/LineLength:
|
5
|
+
Max: 200
|
6
|
+
|
7
|
+
Style/Encoding:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Lint/AmbiguousBlockAssociation:
|
11
|
+
Exclude:
|
12
|
+
- "spec/**/*"
|
13
|
+
|
14
|
+
Metrics/AbcSize:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Metrics/MethodLength:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Metrics/ClassLength:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Metrics/ModuleLength:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
Metrics/BlockLength:
|
27
|
+
Max: 30
|
28
|
+
Exclude:
|
29
|
+
- "spec/**/*.rb"
|
30
|
+
|
31
|
+
Metrics/PerceivedComplexity:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/SignalException:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Style/StringLiterals:
|
38
|
+
EnforcedStyle: single_quotes
|
39
|
+
|
40
|
+
Style/TrivialAccessors:
|
41
|
+
ExactNameMatch: true
|
42
|
+
|
43
|
+
Style/RedundantReturn:
|
44
|
+
AllowMultipleReturnValues: true
|
45
|
+
|
46
|
+
# `module_function` is not equivalent as `extend self`
|
47
|
+
Style/ModuleFunction:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Style/ClassAndModuleChildren:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Style/Documentation:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Layout/ClosingHeredocIndentation:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
60
|
+
Enabled: true
|
61
|
+
|
62
|
+
Layout/SpaceAroundMethodCallOperator:
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
Lint/DeprecatedOpenSSLConstant:
|
66
|
+
Enabled: true
|
67
|
+
|
68
|
+
Lint/DuplicateElsifCondition:
|
69
|
+
Enabled: true
|
70
|
+
|
71
|
+
Lint/MixedRegexpCaptureTypes:
|
72
|
+
Enabled: true
|
73
|
+
|
74
|
+
Lint/RaiseException:
|
75
|
+
Enabled: true
|
76
|
+
|
77
|
+
Lint/StructNewOverride:
|
78
|
+
Enabled: true
|
79
|
+
|
80
|
+
Style/AccessorGrouping:
|
81
|
+
Enabled: true
|
82
|
+
|
83
|
+
Style/ArrayCoercion:
|
84
|
+
Enabled: true
|
85
|
+
|
86
|
+
Style/BisectedAttrAccessor:
|
87
|
+
Enabled: true
|
88
|
+
|
89
|
+
Style/CaseLikeIf:
|
90
|
+
Enabled: true
|
91
|
+
|
92
|
+
Style/ExponentialNotation:
|
93
|
+
Enabled: true
|
94
|
+
|
95
|
+
Style/HashAsLastArrayItem:
|
96
|
+
Enabled: true
|
97
|
+
|
98
|
+
Style/HashEachMethods:
|
99
|
+
Enabled: true
|
100
|
+
|
101
|
+
Style/HashLikeCase:
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
Style/HashTransformKeys:
|
105
|
+
Enabled: true
|
106
|
+
|
107
|
+
Style/HashTransformValues:
|
108
|
+
Enabled: true
|
109
|
+
|
110
|
+
Style/RedundantAssignment:
|
111
|
+
Enabled: true
|
112
|
+
|
113
|
+
Style/RedundantFetchBlock:
|
114
|
+
Enabled: true
|
115
|
+
|
116
|
+
Style/RedundantFileExtensionInRequire:
|
117
|
+
Enabled: true
|
118
|
+
|
119
|
+
Style/RedundantRegexpCharacterClass:
|
120
|
+
Enabled: true
|
121
|
+
|
122
|
+
Style/RedundantRegexpEscape:
|
123
|
+
Enabled: true
|
124
|
+
|
125
|
+
Style/SlicingWithRange:
|
126
|
+
Enabled: true
|
127
|
+
|
128
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
129
|
+
Enabled: true
|
130
|
+
|
131
|
+
Lint/DuplicateRescueException:
|
132
|
+
Enabled: true
|
133
|
+
|
134
|
+
Lint/EmptyConditionalBody:
|
135
|
+
Enabled: true
|
136
|
+
|
137
|
+
Lint/FloatComparison:
|
138
|
+
Enabled: true
|
139
|
+
|
140
|
+
Lint/MissingSuper:
|
141
|
+
Enabled: true
|
142
|
+
|
143
|
+
Lint/OutOfRangeRegexpRef:
|
144
|
+
Enabled: true
|
145
|
+
|
146
|
+
Lint/SelfAssignment:
|
147
|
+
Enabled: true
|
148
|
+
|
149
|
+
Lint/TopLevelReturnWithArgument:
|
150
|
+
Enabled: true
|
151
|
+
|
152
|
+
Lint/UnreachableLoop:
|
153
|
+
Enabled: true
|
154
|
+
|
155
|
+
Style/ExplicitBlockArgument:
|
156
|
+
Enabled: true
|
157
|
+
|
158
|
+
Style/GlobalStdStream:
|
159
|
+
Enabled: true
|
160
|
+
|
161
|
+
Style/OptionalBooleanParameter:
|
162
|
+
Enabled: true
|
163
|
+
|
164
|
+
Style/SingleArgumentDig:
|
165
|
+
Enabled: true
|
166
|
+
|
167
|
+
Style/StringConcatenation:
|
168
|
+
Enabled: true
|
data/.travis.yml
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
CWD=$(pwd)
|
4
|
+
|
5
|
+
if [[ "$CWD" == *".vscode"* ]] ; then
|
6
|
+
cd ..
|
7
|
+
fi
|
8
|
+
|
9
|
+
RSPEC_PATH="$(command -v rspec)"
|
10
|
+
BUNDLE_PATH="$(command -v bundle | sed 's/bin/wrappers/')"
|
11
|
+
RDEBUG_PATH=$(cd ./ || exit 1; bundle show ruby-debug-ide)
|
12
|
+
|
13
|
+
if [ -z "$RSPEC_PATH" ] || [ -z "$BUNDLE_PATH" ] || [ -z "$RDEBUG_PATH" ]; then
|
14
|
+
echo "error: Missing required gem, please run 'bundle install'"
|
15
|
+
exit 1
|
16
|
+
fi
|
17
|
+
|
18
|
+
echo "Using configuration paths:"
|
19
|
+
echo "$RSPEC_PATH"
|
20
|
+
echo "$BUNDLE_PATH"
|
21
|
+
echo "$RDEBUG_PATH"
|
22
|
+
|
23
|
+
cat < "./.vscode/vscode_ruby.json.template" | sed "s|RSPEC_PATH|$RSPEC_PATH|g" | sed "s|BUNDLE_PATH|$BUNDLE_PATH|g" | sed "s|RDEBUG_PATH|$RDEBUG_PATH|g" > ./.vscode/launch.json
|
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"version": "0.2.0",
|
3
|
+
"configurations": [
|
4
|
+
{
|
5
|
+
"name": "Run RSpec - all",
|
6
|
+
"type": "Ruby",
|
7
|
+
"request": "launch",
|
8
|
+
"cwd": "${workspaceRoot}",
|
9
|
+
"useBundler": true,
|
10
|
+
"pathToBundler": "BUNDLE_PATH",
|
11
|
+
"program": "RSPEC_PATH",
|
12
|
+
"args": [
|
13
|
+
"--pattern",
|
14
|
+
"${workspaceRoot}/spec/**/*_spec.rb"
|
15
|
+
]
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"name": "Debug RSpec - open spec file",
|
19
|
+
"type": "Ruby",
|
20
|
+
"request": "launch",
|
21
|
+
"cwd": "${workspaceRoot}",
|
22
|
+
"useBundler": true,
|
23
|
+
"pathToBundler": "BUNDLE_PATH",
|
24
|
+
"pathToRDebugIDE": "RDEBUG_PATH",
|
25
|
+
"debuggerPort": "1235",
|
26
|
+
"program": "RSPEC_PATH",
|
27
|
+
"args": [
|
28
|
+
"${file}"
|
29
|
+
]
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"name": "Debug RSpec - open spec file & current line",
|
33
|
+
"type": "Ruby",
|
34
|
+
"request": "launch",
|
35
|
+
"cwd": "${workspaceRoot}",
|
36
|
+
"useBundler": true,
|
37
|
+
"pathToBundler": "BUNDLE_PATH",
|
38
|
+
"pathToRDebugIDE": "RDEBUG_PATH",
|
39
|
+
"debuggerPort": "1235",
|
40
|
+
"program": "RSPEC_PATH",
|
41
|
+
"args": ["${file}:${lineNumber}"]
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
data/Gemfile
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
group :development, :test do
|
4
|
-
gem 'rake', '~>
|
5
|
-
gem 'rspec', '~> 3.
|
6
|
+
gem 'rake', '~> 13.0.1'
|
7
|
+
gem 'rspec', '~> 3.9.0'
|
8
|
+
gem 'rubocop', '~> 0.88'
|
9
|
+
|
10
|
+
group :debug_vscode do
|
11
|
+
gem 'debase'
|
12
|
+
gem 'ruby-debug-ide', '~> 0.7.2'
|
13
|
+
end
|
6
14
|
end
|
7
15
|
|
8
16
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,62 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
xcknife (0.
|
4
|
+
xcknife (0.12.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
ast (2.4.1)
|
10
|
+
debase (0.2.4.1)
|
11
|
+
debase-ruby_core_source (>= 0.10.2)
|
12
|
+
debase-ruby_core_source (0.10.9)
|
9
13
|
diff-lcs (1.3)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
rspec
|
14
|
+
parallel (1.19.2)
|
15
|
+
parser (2.7.1.4)
|
16
|
+
ast (~> 2.4.1)
|
17
|
+
rainbow (3.0.0)
|
18
|
+
rake (13.0.1)
|
19
|
+
regexp_parser (1.7.1)
|
20
|
+
rexml (3.2.4)
|
21
|
+
rspec (3.9.0)
|
22
|
+
rspec-core (~> 3.9.0)
|
23
|
+
rspec-expectations (~> 3.9.0)
|
24
|
+
rspec-mocks (~> 3.9.0)
|
25
|
+
rspec-core (3.9.2)
|
26
|
+
rspec-support (~> 3.9.3)
|
27
|
+
rspec-expectations (3.9.2)
|
18
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
-
rspec-support (~> 3.
|
20
|
-
rspec-mocks (3.
|
29
|
+
rspec-support (~> 3.9.0)
|
30
|
+
rspec-mocks (3.9.1)
|
21
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
-
rspec-support (~> 3.
|
23
|
-
rspec-support (3.
|
32
|
+
rspec-support (~> 3.9.0)
|
33
|
+
rspec-support (3.9.3)
|
34
|
+
rubocop (0.89.1)
|
35
|
+
parallel (~> 1.10)
|
36
|
+
parser (>= 2.7.1.1)
|
37
|
+
rainbow (>= 2.2.2, < 4.0)
|
38
|
+
regexp_parser (>= 1.7)
|
39
|
+
rexml
|
40
|
+
rubocop-ast (>= 0.3.0, < 1.0)
|
41
|
+
ruby-progressbar (~> 1.7)
|
42
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
43
|
+
rubocop-ast (0.3.0)
|
44
|
+
parser (>= 2.7.1.4)
|
45
|
+
ruby-debug-ide (0.7.2)
|
46
|
+
rake (>= 0.8.1)
|
47
|
+
ruby-progressbar (1.10.1)
|
48
|
+
unicode-display_width (1.7.0)
|
24
49
|
|
25
50
|
PLATFORMS
|
26
51
|
ruby
|
27
52
|
|
28
53
|
DEPENDENCIES
|
29
54
|
bundler (~> 1.12)
|
30
|
-
|
31
|
-
|
55
|
+
debase
|
56
|
+
rake (~> 13.0.1)
|
57
|
+
rspec (~> 3.9.0)
|
58
|
+
rubocop (~> 0.88)
|
59
|
+
ruby-debug-ide (~> 0.7.2)
|
32
60
|
xcknife!
|
33
61
|
|
34
62
|
BUNDLED WITH
|
data/Rakefile
CHANGED
@@ -1,22 +1,26 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'fileutils'
|
3
4
|
|
5
|
+
require 'rspec/core/rake_task'
|
4
6
|
RSpec::Core::RakeTask.new(:spec)
|
5
7
|
|
6
|
-
|
8
|
+
require 'rubocop/rake_task'
|
9
|
+
RuboCop::RakeTask.new
|
7
10
|
|
8
|
-
|
11
|
+
task default: %w[spec rubocop]
|
12
|
+
|
13
|
+
desc 'Builds TestDumper.dylib'
|
9
14
|
task :build_test_dumper do
|
10
|
-
target_dir = File.join(File.dirname(__FILE__),
|
15
|
+
target_dir = File.join(File.dirname(__FILE__), 'TestDumper')
|
11
16
|
Dir.chdir(target_dir) do
|
12
|
-
system
|
13
|
-
FileUtils.copy_file(
|
14
|
-
puts
|
17
|
+
system './build.sh'
|
18
|
+
FileUtils.copy_file('./testdumperbuild/Build/Products/Debug-iphonesimulator/TestDumper.framework/TestDumper', './TestDumper.dylib')
|
19
|
+
puts 'TestDumper.dylib was created successfully'
|
15
20
|
end
|
16
21
|
end
|
17
22
|
|
18
|
-
desc
|
19
|
-
task :
|
23
|
+
desc 'Release wih test_dumper'
|
24
|
+
task gem_release: %i[build_test_dumper build] do
|
20
25
|
system 'gem push pkg/xcknife-*.gem'
|
21
26
|
end
|
22
|
-
|
data/bin/xcknife
CHANGED
data/bin/xcknife-min
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
4
|
# Script for cleaning up historical events, so that we only store the ones we need
|
5
5
|
require 'set'
|
@@ -7,25 +7,22 @@ require 'json' unless defined?(::JSON)
|
|
7
7
|
|
8
8
|
INTERESTING_EVENTS = %w[begin-ocunit end-test].to_set
|
9
9
|
def cleanup(input_file_name, output_file_name)
|
10
|
-
if input_file_name.nil?
|
11
|
-
|
12
|
-
end
|
10
|
+
return puts 'Usage: xcknife-min [input] [output]' if input_file_name.nil? || output_file_name.nil?
|
11
|
+
|
13
12
|
lines = IO.readlines(input_file_name)
|
14
13
|
lines_written = 0
|
15
14
|
total = lines.size
|
16
|
-
File.open(output_file_name,
|
15
|
+
File.open(output_file_name, 'w') do |f|
|
17
16
|
lines.each do |line|
|
18
|
-
data = JSON.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
if data["test"]
|
25
|
-
data["test"] = "1"
|
26
|
-
end
|
27
|
-
f.puts(data.to_json)
|
17
|
+
data = JSON.parse(line)
|
18
|
+
next unless INTERESTING_EVENTS.include?(data['event'])
|
19
|
+
|
20
|
+
lines_written += 1
|
21
|
+
%w[output sdk timestamp exceptions result succeeded methodName].each do |k|
|
22
|
+
data.delete(k)
|
28
23
|
end
|
24
|
+
data['test'] = '1' if data['test']
|
25
|
+
f.puts(data.to_json)
|
29
26
|
end
|
30
27
|
end
|
31
28
|
lines_removed = total - lines_written
|