xcknife 0.11.1 → 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e63c27c7af4820f72ed2ef5813306be1dc4d6793fc837bca402d53ac53eff7ff
4
- data.tar.gz: 180ebe00183782dbb1b0b63cdf23ce010ffe31a6cc910b921ff031f32f97d462
3
+ metadata.gz: 79b1c563a88dfb2d6fb4cf6cefd1c845c320b555804c58c72e8ccbb7525f4f2a
4
+ data.tar.gz: dd72d8692ff7d834c54b24f4c028ee1b85e8f63978a8b44a0cc315462f21c259
5
5
  SHA512:
6
- metadata.gz: cb9824f69aef912ab664c29c56ef5b9f00a58765b3361f109917bfd0374d4ac003c3420f76e20f27b820d71a516e07d676bc0718d171cc1c0c1d9849553d9421
7
- data.tar.gz: 50c7119def1b9d0334fcd55677838b346f7ba1971b6cf949fd664190494628a7799aacf1cc45b9977bc099e0675955a29bfdf571059456b309f86a7c0e4bdb7b
6
+ metadata.gz: 7e2d19bd7130d60a1301a125cb7ba88fedb61910732ec7adf63be818872349976801f61747416c3d7a2323bbbe15cffef4207756718ae7bb3ba57687bb76eeb4
7
+ data.tar.gz: 1b2909467c40f7277bcebd48cde21b321a9432cdc868a928425a06a25dec01f638d7d2bd64f3d5741aac47aa4e4b680681b1a2be3cebb2cef364e93376b007e3
data/.gitignore CHANGED
@@ -9,3 +9,5 @@ TestDumper/TestDumper.dylib
9
9
  *.tmp
10
10
  .bin/
11
11
  .bundle/
12
+
13
+ .vscode/launch.json
@@ -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
@@ -3,7 +3,7 @@ sudo: false
3
3
  matrix:
4
4
  include:
5
5
  - os: osx
6
- osx_image: xcode10.2
6
+ osx_image: xcode11.6
7
7
 
8
8
  before_script:
9
9
  - export LANG=en_US.UTF-8
@@ -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', '~> 11.1.1'
5
- gem 'rspec', '~> 3.4.0'
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
@@ -1,34 +1,62 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcknife (0.11.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
- rake (11.1.2)
11
- rspec (3.4.0)
12
- rspec-core (~> 3.4.0)
13
- rspec-expectations (~> 3.4.0)
14
- rspec-mocks (~> 3.4.0)
15
- rspec-core (3.4.4)
16
- rspec-support (~> 3.4.0)
17
- rspec-expectations (3.4.0)
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.4.0)
20
- rspec-mocks (3.4.1)
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.4.0)
23
- rspec-support (3.4.1)
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
- rake (~> 11.1.1)
31
- rspec (~> 3.4.0)
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
- require 'rspec/core/rake_task'
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
- task default: :spec
8
+ require 'rubocop/rake_task'
9
+ RuboCop::RakeTask.new
7
10
 
8
- desc "Builds TestDumper.dylib"
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__), "TestDumper")
15
+ target_dir = File.join(File.dirname(__FILE__), 'TestDumper')
11
16
  Dir.chdir(target_dir) do
12
- system "./build.sh"
13
- FileUtils.copy_file("./testdumperbuild/Build/Products/Debug-iphonesimulator/TestDumper.framework/TestDumper", "./TestDumper.dylib")
14
- puts "TestDumper.dylib was created successfully"
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 "Release wih test_dumper"
19
- task :gem_release => [:build_test_dumper, :build] do
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
-
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  require 'xcknife'
3
5
 
4
6
  XCKnife::Runner.invoke
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
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? or output_file_name.nil?
11
- return puts "Usage: xcknife-min [input] [output]"
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, "w") do |f|
15
+ File.open(output_file_name, 'w') do |f|
17
16
  lines.each do |line|
18
- data = JSON.load(line)
19
- if INTERESTING_EVENTS.include?(data["event"])
20
- lines_written += 1
21
- %w[output sdk timestamp exceptions result succeeded methodName].each do |k|
22
- data.delete(k)
23
- end
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