distribuo 0.2.0 → 0.2.1

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: 89785f80fa2b414447c3c972b5ec78a42d515c40603a204f8f85c17d47f1c428
4
- data.tar.gz: eb87c2c7e09e44aa1b01e1657ebc71e18505e1c345f77e9088ccbfc68adf3f4b
3
+ metadata.gz: 6c560fcaaa9c112961ea63d26aa3639ea1e98694834a3537f4a63fb1e731c989
4
+ data.tar.gz: 23e2ebb15246c2c195f8efec35bfb54eff1ac9b631b76b31083efa5f556d0cf5
5
5
  SHA512:
6
- metadata.gz: 97822aafbb7f456989d6ecdfd2ea1f9e5ba4326c00b43390325ed1f88c10cd8d9730be26b2baacffe676d7b37066db8e228010b712815d3e0256536e466f7423
7
- data.tar.gz: 28e85f17184d64197d12a6632db9d8e03a35bc4b5ce9a503eebbb66aebd8d1676c0002b4edc250abdbf6cb16c42f5f71691b96b08efc11fbc7428cc820051ade
6
+ metadata.gz: 54038126e0b66236bc3ec6f3d7a6261565e831c6c94e7b5436f7ab18f84b940dc72857cc105b29ddea57491d0e6646f07bfb276a089acba979df5859d999001e
7
+ data.tar.gz: e06f9b8a83a8dce797369d403e02cc4a756f495ea42da5a342590126efd07b53c32e15959f4361dddd18287cbc5c63cc5f1fd294e5d00e3bbb3138eb39839d5b
@@ -32,7 +32,7 @@ module Distribuo
32
32
  f.write build_upload.read.force_encoding('utf-8')
33
33
  attachment_changes['build'].attachable.rewind
34
34
 
35
- ipa = AppParser.parse(f.path)
35
+ ipa = Distribuo::PackageParser.parse(f.path)
36
36
 
37
37
  updates = {}
38
38
  updates[:build_number] = ipa.version unless build_number.present?
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'app_parser'
4
+
5
+ module Distribuo
6
+ module PackageParser
7
+ def self.parse(file_name)
8
+ # Keep app_parser's file validation and Android parser; its IPA parser
9
+ # still passes absolute extraction paths using the Rubyzip 2 API.
10
+ raise ::AppParser::NotFoundError, file_name unless File.exist?(file_name)
11
+
12
+ if ::AppParser.detect_os(file_name) == 'ios'
13
+ Ipa.new(file_name)
14
+ else
15
+ ::AppParser.parse(file_name)
16
+ end
17
+ end
18
+
19
+ class Ipa < ::AppParser::Ipa
20
+ def icon_data(file_name)
21
+ Dir.mktmpdir do |directory|
22
+ find_entry(file_name).extract('src', destination_directory: directory)
23
+ source = File.join(directory, 'src')
24
+ destination = File.join(directory, 'dest')
25
+ Pngdefry.defry(source, destination)
26
+ File.binread(destination)
27
+ end
28
+ end
29
+
30
+ private
31
+
32
+ def search_icons(ipad: false)
33
+ icon_names = info_plist.dig("CFBundleIcons#{'~ipad' if ipad}", 'CFBundlePrimaryIcon', 'CFBundleIconFiles')
34
+ Dir.mktmpdir do |directory|
35
+ Array(icon_names).flat_map do |name|
36
+ find_entries("#{name}*").filter_map do |entry|
37
+ next unless entry.name.include?('~ipad') == ipad
38
+
39
+ filename = File.basename(entry.name)
40
+ entry.extract(filename, destination_directory: directory)
41
+ {dimensions: Pngdefry.dimensions(File.join(directory, filename)), file_name: filename}
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Distribuo
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/distribuo.rb CHANGED
@@ -3,6 +3,7 @@ require 'app_parser'
3
3
  require 'pundit'
4
4
  require 'mensa'
5
5
 
6
+ require 'distribuo/package_parser'
6
7
  require 'distribuo/engine'
7
8
  require 'distribuo/configuration'
8
9
  require 'distribuo/active_record_helpers'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distribuo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom de Grunt
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.3'
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.3'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: image_processing
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -183,6 +183,7 @@ files:
183
183
  - lib/distribuo/active_record_helpers.rb
184
184
  - lib/distribuo/configuration.rb
185
185
  - lib/distribuo/engine.rb
186
+ - lib/distribuo/package_parser.rb
186
187
  - lib/distribuo/version.rb
187
188
  homepage: https://code.entropydecelerator.com/components/distribuo
188
189
  licenses: