cocoapods-whitelist 0.6.1 → 0.6.2
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/cocoapods-allowlist/client/allowlist_resolver.rb +2 -3
- data/lib/cocoapods-allowlist/gem_version.rb +1 -1
- data/lib/cocoapods-allowlist/helpers/git.rb +3 -2
- data/lib/cocoapods-allowlist/utils/command.rb +7 -6
- data/spec/spec_helper.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df42fb1e1b8742c776a5336ff5318ba66ce67fb9ee04ec082c807d63d088f2b6
|
|
4
|
+
data.tar.gz: '0825a128530b9e58c7b31d3eaa8eb2aba2f74265c5d64d1337a692b18605dfb8'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 203e55f2c36736bd6132c7c162fb06eb4f7d50578f8bd117f0bf3f9720b6b32d691204067397c89ffdb551006241495ce2cf9c54179843a9b710f5115b478be0
|
|
7
|
+
data.tar.gz: cbbec5f56649f7b3a540f56ffc04d9bb9180055b868782615aee0022ef6ad3d6df2d16a003d0f4f0fe747483b3728845d961e9a76153d9f717d3aaf46f2d05ba
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -38,9 +38,9 @@ rake
|
|
|
38
38
|
### Publish in RubyGems
|
|
39
39
|
1. Build
|
|
40
40
|
```
|
|
41
|
-
gem build cocoapods-
|
|
41
|
+
gem build cocoapods-whitelist.gemspec
|
|
42
42
|
```
|
|
43
43
|
2. Publish
|
|
44
44
|
```
|
|
45
|
-
gem push cocoapods-
|
|
46
|
-
```
|
|
45
|
+
gem push cocoapods-whitelist-{version}.gem
|
|
46
|
+
```
|
|
@@ -51,7 +51,7 @@ class AllowlistResolver
|
|
|
51
51
|
status = e.io.status.join(' ')
|
|
52
52
|
raise "Failed to fetch allowlist from '#{@allowlist_url}'.\n Error: #{status}"
|
|
53
53
|
rescue => e
|
|
54
|
-
raise
|
|
54
|
+
raise e
|
|
55
55
|
ensure
|
|
56
56
|
cleanup
|
|
57
57
|
end
|
|
@@ -74,8 +74,7 @@ class AllowlistResolver
|
|
|
74
74
|
private
|
|
75
75
|
|
|
76
76
|
def create_temp_directory
|
|
77
|
-
@allowlist_directory ||=
|
|
78
|
-
FileUtils.mkdir_p(@allowlist_directory) unless File.exist?(@allowlist_directory)
|
|
77
|
+
@allowlist_directory ||= Dir.mktmpdir('allowlist-')
|
|
79
78
|
end
|
|
80
79
|
|
|
81
80
|
def cleanup
|
|
@@ -4,13 +4,14 @@ require_relative '../utils/command'
|
|
|
4
4
|
class GitHelper
|
|
5
5
|
# Download from a specific branch
|
|
6
6
|
def self.clone_from_branch(url, destination, branch)
|
|
7
|
-
Command.execute("git clone --quiet --depth 1 -b #{branch} --single-branch #{url} #{destination}")
|
|
7
|
+
_stdout, stderr, status = Allowlist::Command.execute("git clone --quiet --depth 1 -b #{branch} --single-branch #{url} #{destination}")
|
|
8
|
+
raise "git clone failed (exit #{status.exitstatus}): #{stderr.strip}" unless status.success?
|
|
8
9
|
end
|
|
9
10
|
|
|
10
11
|
# Get the latest commit hash
|
|
11
12
|
def self.get_latest_commit(directory)
|
|
12
13
|
Dir.chdir(directory) do
|
|
13
|
-
Command.execute("git rev-parse HEAD").strip
|
|
14
|
+
Allowlist::Command.execute("git rev-parse HEAD").strip
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
end
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
require 'open3'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
module Allowlist
|
|
4
|
+
class Command
|
|
5
|
+
# This method is for execute commands in terminal
|
|
6
|
+
def self.execute(command)
|
|
7
|
+
ssh_mux = 'ssh -o ControlMaster=auto -o ControlPath=~/.ssh/meli-mux-%C -o ControlPersist=60'
|
|
8
|
+
Open3.capture3({'GIT_SSH_COMMAND' => ssh_mux}, command)
|
|
9
|
+
end
|
|
8
10
|
end
|
|
9
|
-
|
|
10
11
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -16,6 +16,25 @@ require 'cocoapods_plugin'
|
|
|
16
16
|
|
|
17
17
|
#-----------------------------------------------------------------------------#
|
|
18
18
|
|
|
19
|
+
# Make specs hermetic: replace GitHelper.clone_from_branch so it never
|
|
20
|
+
# hits the network. Tests pass either a local mock JSON path or a remote
|
|
21
|
+
# URL as `url`; in both cases we serve the bundled mock allowlist from
|
|
22
|
+
# `spec/mocks/allowlist.json` at the expected destination.
|
|
23
|
+
require 'fileutils'
|
|
24
|
+
require 'cocoapods-allowlist/helpers/git'
|
|
25
|
+
|
|
26
|
+
class GitHelper
|
|
27
|
+
MOCK_ALLOWLIST_PATH = File.join(ROOT, 'spec', 'mocks', 'allowlist.json').freeze
|
|
28
|
+
|
|
29
|
+
def self.clone_from_branch(url, destination, branch)
|
|
30
|
+
source = File.file?(url) ? url : MOCK_ALLOWLIST_PATH
|
|
31
|
+
FileUtils.mkdir_p(destination)
|
|
32
|
+
FileUtils.cp(source, File.join(destination, 'ios-allowlist.json'))
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
#-----------------------------------------------------------------------------#
|
|
37
|
+
|
|
19
38
|
module Pod
|
|
20
39
|
|
|
21
40
|
# Disable the wrapping so the output is deterministic in the tests.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cocoapods-whitelist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mobile Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-04-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|