Skip to content

Commit 506452b

Browse files
committed
Make rubocop happy
1 parent 8fabca4 commit 506452b

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_send_app_size_metrics.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ def self.run(params)
1313

1414
# Build the payload base
1515
payload = Fastlane::WPMRT::AppSizeMetricsPayload.new(
16-
'Platform': 'Android',
16+
Platform: 'Android',
1717
'App Name': params[:app_name],
1818
'App Version': params[:app_version_name],
1919
'Version Code': params[:app_version_code],
2020
'Product Flavor': params[:product_flavor],
2121
'Build Type': params[:build_type],
22-
'Source': params[:source],
22+
Source: params[:source]
2323
)
2424
payload.add_metric(name: 'AAB File Size', value: File.size(params[:aab_path]))
2525

@@ -54,12 +54,10 @@ def self.run(params)
5454
end
5555

5656
def self.check_bundletool_installed!
57-
begin
58-
Action.sh('command', '-v', 'bundletool', print_command: false, print_command_output: false)
59-
rescue
60-
UI.user_error!('bundletool is required to build the split APKs. Install it with `brew install bundletool`')
61-
raise
62-
end
57+
Action.sh('command', '-v', 'bundletool', print_command: false, print_command_output: false)
58+
rescue StandardError
59+
UI.user_error!('bundletool is required to build the split APKs. Install it with `brew install bundletool`')
60+
raise
6361
end
6462

6563
def self.find_apkanalyzer_binary!
@@ -159,7 +157,6 @@ def self.available_options
159157
description: 'The path to the .ipa to extract size information from',
160158
type: String,
161159
optional: false,
162-
#default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
163160
verify_block: proc do |value|
164161
UI.user_error!('You must provide an path to an existing `.aab` file') unless File.exist?(value)
165162
end

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ def self.run(params)
1414

1515
# Build the payload base
1616
payload = Fastlane::WPMRT::AppSizeMetricsPayload.new(
17-
'Platform': 'iOS',
17+
Platform: 'iOS',
1818
'App Name': params[:app_name],
1919
'App Version': params[:app_version],
2020
'Build Type': params[:build_type],
21-
'Source': params[:source],
21+
Source: params[:source]
2222
)
2323
payload.add_metric(name: 'File Size', value: File.size(params[:ipa_path]))
2424

spec/android_send_app_size_metrics_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_app_size_action(fake_aab_size:, fake_apks:, expected_payload:, **other_
4242
expect(code).to eq(201)
4343
expect(File).to exist(output_file)
4444
generated_payload = File.read(output_file)
45-
unless other_action_args[:use_gzip_content_encoding] === false
45+
unless other_action_args[:use_gzip_content_encoding] == false
4646
expect do
4747
generated_payload = Zlib.gunzip(generated_payload)
4848
end.not_to raise_error, 'Payload was not valid GZipped data'
@@ -94,7 +94,7 @@ def test_app_size_action(fake_aab_size:, fake_apks:, expected_payload:, **other_
9494
'base-armeabi.apk': [150_000, 50_000],
9595
'base-armeabi_2.apk': [150_002, 50_002],
9696
'base-armeabi_v7a.apk': [150_070, 50_070],
97-
'base-armeabi_v7a_2.apk': [150_072, 50_072],
97+
'base-armeabi_v7a_2.apk': [150_072, 50_072]
9898
},
9999
expected_payload: expected,
100100
app_name: 'wordpress',

spec/ios_send_app_size_metrics_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
describe Fastlane::Actions::IosSendAppSizeMetricsAction do
44
let(:test_data_dir) { File.join(File.dirname(__FILE__), 'test-data', 'app_size_metrics') }
55
let(:fake_ipa_size) { 1337 } # The value used in the `app-thinning.plist` and `ios-metrics-payload.json` fixtures
6-
6+
77
def test_app_size_action(fake_ipa_size:, expected_payload:, **other_action_args)
88
in_tmp_dir do |tmp_dir|
99
# Arrange
@@ -23,7 +23,7 @@ def test_app_size_action(fake_ipa_size:, expected_payload:, **other_action_args)
2323
expect(code).to eq(201)
2424
expect(File).to exist(output_file)
2525
generated_payload = File.read(output_file)
26-
unless other_action_args[:use_gzip_content_encoding] === false
26+
unless other_action_args[:use_gzip_content_encoding] == false
2727
expect do
2828
generated_payload = Zlib.gunzip(generated_payload)
2929
end.not_to raise_error, 'Payload was not valid GZipped data'

0 commit comments

Comments
 (0)