@@ -68,6 +68,7 @@ module Danger
68
68
#
69
69
class DangerApkstats < Plugin
70
70
class Error < StandardError ; end
71
+ class MisconfigurationError < Error ; end
71
72
72
73
# @deprecated this field have no effect
73
74
COMMAND_TYPE_MAP = {
@@ -115,8 +116,6 @@ def apk_filepath=(value)
115
116
# @return [String, NilClass] Your base apk filepath.
116
117
attr_reader :apk_filepath
117
118
118
- # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
119
-
120
119
# Get stats of two apk files and calculate diffs between them.
121
120
#
122
121
# @param [String, Pathname] other_apk_filepath your old apk
@@ -162,7 +161,7 @@ def summary
162
161
def calculate_diff ( other_apk_filepath :)
163
162
ensure_apk_filepath!
164
163
165
- base_apk_info = Apkstats ::Entity ::ApkInfo . new ( command : apkanalyzer_command , apk_filepath : apk_filepath ) ,
164
+ base_apk_info = Apkstats ::Entity ::ApkInfo . new ( command : apkanalyzer_command , apk_filepath : apk_filepath )
166
165
other_apk_info = Apkstats ::Entity ::ApkInfo . new ( command : apkanalyzer_command , apk_filepath : other_apk_filepath )
167
166
diff_apk_info = Apkstats ::Entity ::ApkInfoDiff . new ( base : base_apk_info , other : other_apk_info )
168
167
@@ -173,8 +172,6 @@ def calculate_diff(other_apk_filepath:)
173
172
}
174
173
end
175
174
176
- # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
177
-
178
175
# Show the file size of your apk file.
179
176
#
180
177
# @return [Fixnum] return positive value if exists, otherwise -1.
@@ -296,7 +293,7 @@ def on_error(err)
296
293
end
297
294
298
295
def ensure_apk_filepath!
299
- raise "apk apk_filepath must be specified" if apk_filepath . nil? || !File . file? ( apk_filepath )
296
+ raise MisconfigurationError , " apk_filepath must be specified" if apk_filepath . nil? || !File . file? ( apk_filepath )
300
297
end
301
298
302
299
def process
0 commit comments