headdesk 0.14.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62c7f436a234501a6af9f675f3ae62fa6a8d8d8d31a3260ce131657723cdbcd6
4
- data.tar.gz: 299ca0df2da4633faef31dde2067ea1605c9a5056ff51baf22d4817e5e26b994
3
+ metadata.gz: 5b515a8aecb49ea64462548ee2ae36181b1d106a78d3ea396235bf24ff2ef87d
4
+ data.tar.gz: 594961e4633d5bfcb7e4af07f6e90cfc94e5f03f0f82507c4ac2580cfbce8be7
5
5
  SHA512:
6
- metadata.gz: d1c9a45990430accfd2d59d4dd11f1d6359c95155b596e2a8305a698e095d8c5136dec385e06ea9164e5262c6d5998f850414b4a86547ae2ca9b1b49fa0efb5d
7
- data.tar.gz: c8e713e2d40e996c3f11abfd6735a7c4cac731f74bbc4652ee8495e75127c99afb68559846bc42ca4065af13a752a5df97fcfce96871ce2a475f6d5aa304baef
6
+ metadata.gz: 2c04f5d7f6ec81360149cb165a3f801f619a71c8f5f7fb93427be3547bcdc1733024cb77194acd08ca4431121ebfab2b96772e4d08ecb29ec8dd947868f1e766
7
+ data.tar.gz: 83c0724e4bae5cf7fc234b740504e4450ebd64df81ed8ef63ff11453a50bda6f44d6c630f5c6d83094b167400511beed04494011ed2a32fe0d2caad0a1e2b8a1
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/
9
10
 
10
11
  coverage
11
12
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- headdesk (0.13.0)
4
+ headdesk (0.14.0)
5
5
  awesome_print (~> 1.8)
6
6
  gems (~> 1.1)
7
7
  nokogiri (~> 1.10)
@@ -35,7 +35,7 @@ GEM
35
35
  json (2.1.0)
36
36
  kwalify (0.7.2)
37
37
  mini_portile2 (2.4.0)
38
- nokogiri (1.10.3)
38
+ nokogiri (1.10.4)
39
39
  mini_portile2 (~> 2.4.0)
40
40
  oily_png (1.2.1)
41
41
  chunky_png (~> 1.3.7)
data/README.md CHANGED
@@ -17,9 +17,9 @@ This is output from the check that ensures that the version of the Facebook SDK
17
17
  `headdesk` can also output to JSON.
18
18
 
19
19
  ## Checks
20
- * [api26](docs/api26.md)
21
20
  * [facebook](docs/facebook.md)
22
21
  * [receiver](docs/receiver.md)
22
+ * [target_sdk_version](docs/target_sdk_version.md)
23
23
  * [teak/api21_icon](docs/teak/api21_icon.md)
24
24
  * [teak/configuration](docs/teak/configuration.md)
25
25
 
data/Rakefile CHANGED
@@ -2,3 +2,7 @@
2
2
 
3
3
  require 'bundler/gem_tasks'
4
4
  task default: :spec
5
+
6
+ task :facebook do
7
+ sh 'bundle exec bin/facebook_sdk_versions'
8
+ end
@@ -6,19 +6,35 @@ require 'nokogiri'
6
6
  require 'open-uri'
7
7
  require 'yaml'
8
8
 
9
- html_doc = Nokogiri::HTML(open('https://developers.facebook.com/docs/android/change-log-4x'))
9
+ @facebook_sdk_versions = {}
10
10
 
11
- facebook_sdk_versions = html_doc.xpath('//h2')
12
- .select { |h2| h2.attributes['id'].value =~ /^\d+_\d+_\d+$/ }
13
- .collect do |h2|
14
- major, minor, patch, date = h2.text.match(/^(\d+)\.(\d+)\.?(\d+)? \- (.*)$/).captures
15
- {
11
+ def add_version(str, matcher)
12
+ major, minor, patch, date = str.match(matcher).captures
13
+ version_string = "#{major.to_i || 0}.#{minor.to_i || 0}.#{patch.to_i || 0}"
14
+ @facebook_sdk_versions[version_string] = {
16
15
  major: major.to_i || 0,
17
16
  minor: minor.to_i || 0,
18
17
  patch: patch.to_i || 0,
19
- version: "#{major.to_i || 0}.#{minor.to_i || 0}.#{patch.to_i || 0}",
18
+ version: version_string,
20
19
  date: Date.parse(date)
21
20
  }
22
21
  end
23
22
 
24
- File.write(Headdesk::FACEBOOK_SDK_VERSIONS_YAML, facebook_sdk_versions.to_yaml)
23
+ html_doc = Nokogiri::HTML(open('https://developers.facebook.com/docs/android/change-log-4x'))
24
+
25
+ html_match = /^(\d+)\.(\d+)\.?(\d+)? \- (.*)$/
26
+ html_doc.xpath('//h2')
27
+ .select { |h2| html_match.match?(h2.text) }
28
+ .collect do |h2|
29
+ add_version(h2.text, html_match)
30
+ end
31
+
32
+ changelog_md = open('https://raw.githubusercontent.com/facebook/facebook-android-sdk/master/CHANGELOG.md') { |f| f.read }
33
+
34
+ markdown_match = /^## \[(\d+)\.(\d+)\.?(\d+)?\] \- (.*)$/
35
+ changelog_md.each_line.select { |line| markdown_match.match?(line) }
36
+ .collect do |line|
37
+ add_version(line, markdown_match)
38
+ end
39
+
40
+ File.write(Headdesk::FACEBOOK_SDK_VERSIONS_YAML, @facebook_sdk_versions.values.to_yaml)
@@ -0,0 +1,14 @@
1
+ # target_sdk_version
2
+ Ensures that the APK is built with `targetSdkVersion` at least 28.
3
+
4
+ ## Will Fail If
5
+ * `targetSdkVersion` is less than 28.
6
+
7
+ ## Exports
8
+ None.
9
+
10
+ ## Reason
11
+ As of November 1, 2019 Google Play requires that all apps, and app updates, target Android 9 (API 28).
12
+
13
+ ## Resolution
14
+ Target API 28 or higher.
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Headdesk
4
+ module Checks
5
+ #
6
+ # APKs should all target API 26+
7
+ #
8
+ # :reek:UncommunicativeModuleName
9
+ class TargetSdkVersion
10
+ include Check::APK
11
+
12
+ check_name 'target_sdk_version'
13
+ describe 'targetSdkVersion must be at least 28'
14
+ def call
15
+ fail_check unless: -> { apk.targets_sdk 28 }
16
+ end
17
+ end
18
+ end
19
+ end
@@ -8,12 +8,12 @@
8
8
  :minor: 40
9
9
  :patch: 0
10
10
  :version: 4.40.0
11
- :date: 2019-01-22
11
+ :date: 2019-01-17
12
12
  - :major: 4
13
13
  :minor: 39
14
14
  :patch: 0
15
15
  :version: 4.39.0
16
- :date: 2018-12-05
16
+ :date: 2018-12-03
17
17
  - :major: 4
18
18
  :minor: 38
19
19
  :patch: 1
@@ -294,3 +294,93 @@
294
294
  :patch: 0
295
295
  :version: 4.0.0
296
296
  :date: 2015-03-25
297
+ - :major: 5
298
+ :minor: 13
299
+ :patch: 0
300
+ :version: 5.13.0
301
+ :date: 2019-12-11
302
+ - :major: 5
303
+ :minor: 12
304
+ :patch: 1
305
+ :version: 5.12.1
306
+ :date: 2019-12-08
307
+ - :major: 5
308
+ :minor: 12
309
+ :patch: 0
310
+ :version: 5.12.0
311
+ :date: 2019-12-03
312
+ - :major: 5
313
+ :minor: 11
314
+ :patch: 2
315
+ :version: 5.11.2
316
+ :date: 2019-11-21
317
+ - :major: 5
318
+ :minor: 11
319
+ :patch: 1
320
+ :version: 5.11.1
321
+ :date: 2019-11-21
322
+ - :major: 5
323
+ :minor: 11
324
+ :patch: 0
325
+ :version: 5.11.0
326
+ :date: 2019-11-14
327
+ - :major: 5
328
+ :minor: 9
329
+ :patch: 0
330
+ :version: 5.9.0
331
+ :date: 2019-10-28
332
+ - :major: 5
333
+ :minor: 8
334
+ :patch: 0
335
+ :version: 5.8.0
336
+ :date: 2019-10-08
337
+ - :major: 5
338
+ :minor: 5
339
+ :patch: 2
340
+ :version: 5.5.2
341
+ :date: 2019-10-04
342
+ - :major: 5
343
+ :minor: 5
344
+ :patch: 1
345
+ :version: 5.5.1
346
+ :date: 2019-09-05
347
+ - :major: 5
348
+ :minor: 5
349
+ :patch: 0
350
+ :version: 5.5.0
351
+ :date: 2019-08-30
352
+ - :major: 5
353
+ :minor: 4
354
+ :patch: 0
355
+ :version: 5.4.0
356
+ :date: 2019-08-15
357
+ - :major: 5
358
+ :minor: 2
359
+ :patch: 0
360
+ :version: 5.2.0
361
+ :date: 2019-07-29
362
+ - :major: 5
363
+ :minor: 1
364
+ :patch: 1
365
+ :version: 5.1.1
366
+ :date: 2019-07-21
367
+ - :major: 5
368
+ :minor: 1
369
+ :patch: 0
370
+ :version: 5.1.0
371
+ :date: 2019-06-21
372
+ - :major: 5
373
+ :minor: 0
374
+ :patch: 2
375
+ :version: 5.0.2
376
+ :date: 2019-06-07
377
+ - :major: 5
378
+ :minor: 0
379
+ :patch: 1
380
+ :version: 5.0.1
381
+ :date: 2019-05-16
382
+ - :major: 5
383
+ :minor: 0
384
+ :patch: 0
385
+ :version: 5.0.0
386
+ :date: 2019-04-30
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Headdesk
4
- VERSION = '0.14.0'
4
+ VERSION = '0.15.0'
5
5
  APKTOOL_VERSION = '2.3.4'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: headdesk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Wilson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-18 00:00:00.000000000 Z
11
+ date: 2019-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -213,10 +213,10 @@ files:
213
213
  - bin/facebook_sdk_versions
214
214
  - bin/setup
215
215
  - docs/activity_alias.md
216
- - docs/api26.md
217
216
  - docs/facebook.md
218
217
  - docs/firebase_messaging_event.md
219
218
  - docs/receiver.md
219
+ - docs/target_sdk_version.md
220
220
  - docs/teak/api21_icon.md
221
221
  - docs/teak/configuration.md
222
222
  - exe/headdesk
@@ -232,10 +232,10 @@ files:
232
232
  - lib/headdesk/apktool.rb
233
233
  - lib/headdesk/check.rb
234
234
  - lib/headdesk/checks/activity_alias.rb
235
- - lib/headdesk/checks/api26.rb
236
235
  - lib/headdesk/checks/facebook.rb
237
236
  - lib/headdesk/checks/firebase_messaging_event.rb
238
237
  - lib/headdesk/checks/receiver.rb
238
+ - lib/headdesk/checks/target_sdk_version.rb
239
239
  - lib/headdesk/checks/teak.rb
240
240
  - lib/headdesk/checks/teak/api21_icon.rb
241
241
  - lib/headdesk/checks/teak/teak.rb
@@ -1,17 +0,0 @@
1
- # api26
2
- Ensures that the APK is built with `targetSdkVersion` at least 26.
3
-
4
- ## Will Fail If
5
- * `targetSdkVersion` is less than 26.
6
-
7
- ## Exports
8
- None.
9
-
10
- ## Reason
11
- As of November 1, 2018 Google Play requires that all apps, and app updates, target Android 8 (API 26).
12
-
13
- > Google Play will require that new apps target at least Android 8.0 (API level 26) from August 1, 2018, and that app updates target Android 8.0 from November 1, 2018.
14
- Source: https://developer.android.com/distribute/best-practices/develop/target-sdk
15
-
16
- ## Resolution
17
- Target API 26 or higher.
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Headdesk
4
- module Checks
5
- #
6
- # APKs should all target API 26+
7
- #
8
- # :reek:UncommunicativeModuleName
9
- class Api26
10
- include Check::APK
11
-
12
- check_name 'api26'
13
- describe 'targetSdkVersion must be at least 26'
14
- def call
15
- fail_check unless: -> { apk.targets_sdk 26 }
16
-
17
- klass_def = 'android/support/v4/app/NotificationCompat$Builder'
18
- skip_check unless: -> { apk.class?(klass_def) }
19
- klass = apk.find_class(klass_def)
20
-
21
- describe 'support-v4 version is 26.1+'
22
- fail_check unless: -> { klass.method?('setChannelId') }
23
-
24
- # TODO: AndroidX/JetPack
25
- end
26
- end
27
- end
28
- end