lagunitas 0.0.2 → 0.0.3

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
- SHA1:
3
- metadata.gz: 5a194c09db06f502a74285d90164859150f76845
4
- data.tar.gz: 8985a301c8dc5fb2e74d8318029b68e754923e7d
2
+ SHA256:
3
+ metadata.gz: 56fa97a715dde896b508360808a0bb4b11b668df2a8a8b486905151760456415
4
+ data.tar.gz: '0895bc28b55d105f46de7725e5d9a8e1415ddb4d716f25093573e57a9bec645e'
5
5
  SHA512:
6
- metadata.gz: 0dae877a69f5d5786c9e66830bdd002728114f2d926fcbec0b976ccfb6d9dc4dad0024641d7cf96ac54fd1e3c6884cd48542196ea73f5da1e221580521aa193f
7
- data.tar.gz: b2efd099fb4465c1b8f92aa9119a12e540c258c9fc14ab3b8a124dbd7086c02006094ce085ae1a99e373ac39f014f38f5aba04d3ad6c48ff1611622569817eea
6
+ metadata.gz: 362150ea3ba7b5ace28c31d6181af1bb89422fe1cb9ee8a84a6fd970e849f2716465c3975ffdea1d82769933ceca558cfbed6d143159fd06072e0e73b9097a8c
7
+ data.tar.gz: 880dd41275ac06a631a6029762ee777e0621f4bda82e5c9d758839e227d99a51505dbece10db87db34a4d8ed274cdddf85f1ee68b5805680cbe3a0d4399d9a46
@@ -0,0 +1,34 @@
1
+ name: Ruby
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - '**/*.rb'
6
+ - Gemfile
7
+ - Rakefile
8
+ push:
9
+ branches:
10
+ - main
11
+ jobs:
12
+ lint:
13
+ name: Lint
14
+ runs-on: ubuntu-latest
15
+ env:
16
+ RAILS_ENV: test
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v2
20
+ - name: Setup Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 2.7.2
24
+ - name: Cache gems
25
+ uses: actions/cache@v1
26
+ with:
27
+ path: vendor/bundle
28
+ key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
29
+ - name: Install dependencies
30
+ run: |
31
+ bundle config path vendor/bundle
32
+ bundle install --jobs 4 --retry 3
33
+ - name: Run Rubocop
34
+ run: bundle exec rake lint:ruby
@@ -0,0 +1,28 @@
1
+ name: Test
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - main
7
+ jobs:
8
+ test:
9
+ name: Test
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v2
14
+ - name: Setup Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: 2.7.2
18
+ - name: Cache gems
19
+ uses: actions/cache@v1
20
+ with:
21
+ path: vendor/bundle
22
+ key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
23
+ - name: Install dependencies
24
+ run: |
25
+ bundle config path vendor/bundle
26
+ bundle install --jobs 4 --retry 3
27
+ - name: Run tests
28
+ run: bundle exec rake test
@@ -0,0 +1,26 @@
1
+ name: YAML
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - '**/*.yml'
6
+ - '**/*.yaml'
7
+ push:
8
+ branches:
9
+ - main
10
+ jobs:
11
+ lint:
12
+ name: Lint
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v2
17
+ - name: Setup Python
18
+ uses: actions/setup-python@v2
19
+ with:
20
+ python-version: '3.x'
21
+ - name: Install dependencies
22
+ run: python -m pip install --upgrade pip setuptools wheel yamllint
23
+ - name: Lint
24
+ run: |
25
+ yamllint --version >/dev/null 2>&1 || pip3 install yamllint
26
+ yamllint -c .yamllint.yml .
@@ -0,0 +1,2 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
@@ -0,0 +1,10 @@
1
+ extends: default
2
+ yaml-files:
3
+ - '*.yaml'
4
+ - '*.yml'
5
+ ignore: |
6
+ /vendor/
7
+ rules:
8
+ document-start: disable
9
+ line-length: disable
10
+ truthy: disable
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2014 Sam Soffes, http://soff.es
1
+ Copyright (c) 2013-2020 Sam Soffes, https://soff.es
2
2
 
3
3
  MIT License
4
4
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -7,3 +9,20 @@ Rake::TestTask.new(:test) do |t|
7
9
  t.pattern = 'test/**/*_test.rb'
8
10
  end
9
11
  task default: :test
12
+
13
+ namespace :lint do
14
+ desc 'Lint Ruby'
15
+ task :ruby do
16
+ system 'bundle exec rubocop --parallel --config .rubocop.yml'
17
+ end
18
+
19
+ desc 'Lint YAML'
20
+ task :yaml do
21
+ abort 'yamllint is not installed. Install it with `pip3 install yamllint`.' if `which yamllint`.chomp.empty?
22
+
23
+ system 'yamllint -c .yamllint.yml .'
24
+ end
25
+ end
26
+
27
+ desc 'Run all linters'
28
+ task lint: %i[lint:ruby lint:yaml]
@@ -1,5 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'lagunitas/version'
5
6
 
@@ -12,18 +13,20 @@ Gem::Specification.new do |spec|
12
13
  spec.summary = spec.description
13
14
  spec.homepage = 'https://github.com/soffes/lagunitas'
14
15
  spec.license = 'MIT'
16
+ spec.required_ruby_version = '>= 2.4'
15
17
 
16
- spec.files = `git ls-files`.split($/)
18
+ spec.files = `git ls-files -z`.split("\x0")
17
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
21
  spec.require_paths = ['lib']
20
22
 
21
- spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'bundler', '>= 1.3'
22
24
 
23
- spec.add_dependency 'rubyzip', '>= 1.0.0'
24
25
  spec.add_dependency 'CFPropertyList'
25
26
  spec.add_dependency 'pngdefry', '>= 0.1.0'
27
+ spec.add_dependency 'rubocop', '>= 0.92.0'
28
+ spec.add_dependency 'rubyzip', '>= 1.0.0'
26
29
 
27
- spec.add_development_dependency 'rake'
28
30
  spec.add_development_dependency 'minitest', '>= 5.0'
31
+ spec.add_development_dependency 'rake'
29
32
  end
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'lagunitas/version'
2
4
 
5
+ # Lagunitas module
3
6
  module Lagunitas
4
7
  end
5
8
 
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cfpropertylist'
2
4
  require 'pngdefry'
3
5
 
4
6
  module Lagunitas
7
+ # Representation of an app inside an IPA
5
8
  class App
6
9
  def initialize(path)
7
10
  @path = path
@@ -15,6 +18,10 @@ module Lagunitas
15
18
  info['CFBundleIdentifier']
16
19
  end
17
20
 
21
+ def bundle_name
22
+ info['CFBundleName']
23
+ end
24
+
18
25
  def display_name
19
26
  info['CFBundleDisplayName']
20
27
  end
@@ -41,7 +48,9 @@ module Lagunitas
41
48
  icons << get_image(name)
42
49
  icons << get_image("#{name}@2x")
43
50
  end
44
- icons.delete_if { |i| !i }
51
+ icons.delete_if(&:!)
52
+ rescue NoMethodError # fix a ipa without icons
53
+ []
45
54
  end
46
55
  end
47
56
 
@@ -1,10 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'zip'
2
4
  require 'fileutils'
5
+ require 'securerandom'
3
6
 
4
7
  module Lagunitas
8
+ # Representation of an IPA file
5
9
  class IPA
6
10
  def initialize(path)
7
11
  @path = path
12
+ @contents = nil
8
13
  end
9
14
 
10
15
  def app
@@ -17,6 +22,7 @@ module Lagunitas
17
22
 
18
23
  def cleanup
19
24
  return unless @contents
25
+
20
26
  FileUtils.rm_rf(@contents)
21
27
  @contents = nil
22
28
  end
@@ -25,7 +31,8 @@ module Lagunitas
25
31
 
26
32
  def contents
27
33
  return if @contents
28
- @contents = "tmp/lagunitas-#{SecureRandom.hex}"
34
+
35
+ @contents = "tmp/lagunitas-#{::SecureRandom.hex}"
29
36
 
30
37
  Zip::File.open(@path) do |zip_file|
31
38
  zip_file.each do |f|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Lagunitas
2
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module Lagunitas
@@ -29,7 +31,7 @@ module Lagunitas
29
31
  end
30
32
 
31
33
  def teardown
32
- @ipa.cleanup if @ipa
34
+ @ipa&.cleanup
33
35
  end
34
36
  end
35
37
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module Lagunitas
@@ -11,7 +13,7 @@ module Lagunitas
11
13
  end
12
14
 
13
15
  def teardown
14
- @ipa.cleanup if @ipa
16
+ @ipa&.cleanup
15
17
  end
16
18
  end
17
19
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_helper'
2
4
 
3
5
  module Lagunitas
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler'
3
5
  Bundler.require :test
@@ -6,10 +8,12 @@ require 'minitest/autorun'
6
8
  require 'lagunitas'
7
9
 
8
10
  # Support files
9
- Dir["#{File.expand_path(File.dirname(__FILE__))}/support/*.rb"].each do |file|
11
+ Dir["#{__dir__}/support/*.rb"].sort.each do |file|
10
12
  require file
11
13
  end
12
14
 
13
- class Lagunitas::TestCase < MiniTest::Test
14
- include Lagunitas
15
+ module Lagunitas
16
+ class TestCase < MiniTest::Test
17
+ include Lagunitas
18
+ end
15
19
  end
metadata CHANGED
@@ -1,85 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lagunitas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Soffes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-13 00:00:00.000000000 Z
11
+ date: 2020-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rubyzip
28
+ name: CFPropertyList
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: CFPropertyList
42
+ name: pngdefry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 0.1.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: '0'
54
+ version: 0.1.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: pngdefry
56
+ name: rubocop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.0
61
+ version: 0.92.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.0
68
+ version: 0.92.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: rubyzip
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
75
+ version: 1.0.0
76
+ type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 1.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '5.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: Easy iOS IPAs inspection.
98
112
  email:
99
113
  - sam@soff.es
@@ -101,7 +115,12 @@ executables: []
101
115
  extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
118
+ - ".github/workflows/ruby.yml"
119
+ - ".github/workflows/test.yml"
120
+ - ".github/workflows/yaml.yml"
104
121
  - ".gitignore"
122
+ - ".rubocop.yml"
123
+ - ".yamllint.yml"
105
124
  - Gemfile
106
125
  - LICENSE
107
126
  - Rakefile
@@ -128,15 +147,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
147
  requirements:
129
148
  - - ">="
130
149
  - !ruby/object:Gem::Version
131
- version: '0'
150
+ version: '2.4'
132
151
  required_rubygems_version: !ruby/object:Gem::Requirement
133
152
  requirements:
134
153
  - - ">="
135
154
  - !ruby/object:Gem::Version
136
155
  version: '0'
137
156
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.4.5
157
+ rubygems_version: 3.1.4
140
158
  signing_key:
141
159
  specification_version: 4
142
160
  summary: Easy iOS IPAs inspection.