lg_pod_plugin 1.1.8.1 → 1.1.8.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/lib/command/init.rb +1 -1
- data/lib/lg_pod_plugin/downloader/l_cache.rb +51 -26
- data/lib/lg_pod_plugin/downloader/overload_cache.rb +0 -25
- data/lib/lg_pod_plugin/downloader/request.rb +0 -1
- data/lib/lg_pod_plugin/git/github_archive.rb +3 -0
- data/lib/lg_pod_plugin/git/gitlab_api.rb +3 -4
- data/lib/lg_pod_plugin/installer/install.rb +0 -1
- data/lib/lg_pod_plugin/version.rb +1 -1
- 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: aafc9f0e84eb60f2f5a215573e20d4496446d31ad7fa4e8829c309872ad682cc
|
4
|
+
data.tar.gz: a1d6ef6d263704e67e90de93cd4d756e52e67ad385eaebfb2907691c1f83db4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a002fe8a446c71ebc2d82f2d95f860571a58a68dfecf5816b01258c550e3ba2dceaf4765227f6caed75af4829908a195da4c9efa1875c0fa24e11d9e309f48f
|
7
|
+
data.tar.gz: f143f3a417584ef027c445d7ebaf6130187f4cce2b75d780fc3a4af1f8ac22f27e676bebacd85c5bac6efc805c2ab2d50129b4376b312d03c59a1ba348842ad9
|
data/lib/command/init.rb
CHANGED
@@ -38,7 +38,7 @@ module LgPodPlugin
|
|
38
38
|
refresh_token = ""
|
39
39
|
expires_in = 7879680
|
40
40
|
created_at = Time.now.to_i
|
41
|
-
encrypt_access_token =
|
41
|
+
encrypt_access_token = self.token
|
42
42
|
hash = {"access_token": encrypt_access_token}
|
43
43
|
hash["token_type"] = "Bearer"
|
44
44
|
hash["expires_in"] = expires_in
|
@@ -79,10 +79,10 @@ module LgPodPlugin
|
|
79
79
|
[result, podspecs]
|
80
80
|
end
|
81
81
|
|
82
|
-
def self.root_cache
|
83
|
-
|
84
|
-
|
85
|
-
end
|
82
|
+
# def self.root_cache
|
83
|
+
# cache_path = LFileManager.cache_root_path
|
84
|
+
# return Pod::Downloader::Cache.new(cache_path)
|
85
|
+
# end
|
86
86
|
|
87
87
|
# MARK - 缓存方法
|
88
88
|
def self.path_for_pod(request, slug_opts = {})
|
@@ -94,41 +94,66 @@ module LgPodPlugin
|
|
94
94
|
return Pathname.new(path.to_path + '.podspec.json')
|
95
95
|
end
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
97
|
+
#
|
98
|
+
# def self.get_local_spec(request, target)
|
99
|
+
# result = Pod::Downloader::Response.new
|
100
|
+
# result.location = target
|
101
|
+
# if request.released_pod?
|
102
|
+
# result.spec = request.spec
|
103
|
+
# local_specs = { request.name => request.spec }
|
104
|
+
# return [request, local_specs]
|
105
|
+
# else
|
106
|
+
# local_specs = {}
|
107
|
+
# pods_pecs = Pod::Sandbox::PodspecFinder.new(target).podspecs
|
108
|
+
# pods_pecs[request.name] = request.spec if request.spec
|
109
|
+
# pods_pecs.each do |name, spec|
|
110
|
+
# if request.name == name
|
111
|
+
# result.spec = spec
|
112
|
+
# local_specs[request.name] = spec
|
113
|
+
# end
|
114
|
+
# end
|
115
|
+
# end
|
116
|
+
# [result, local_specs]
|
117
|
+
# end
|
118
|
+
|
119
|
+
def self.group_subspecs_by_platform(spec)
|
120
|
+
specs_by_platform = {}
|
121
|
+
[spec, *spec.recursive_subspecs].each do |ss|
|
122
|
+
ss.available_platforms.each do |platform|
|
123
|
+
specs_by_platform[platform] ||= []
|
124
|
+
specs_by_platform[platform] << ss
|
113
125
|
end
|
114
126
|
end
|
115
|
-
|
127
|
+
specs_by_platform
|
116
128
|
end
|
117
129
|
|
118
130
|
def self.copy_and_clean(source, destination, spec)
|
119
|
-
|
131
|
+
attributes_hash = spec.send(:attributes_hash) || {}
|
132
|
+
name = attributes_hash["name"] ||= ""
|
133
|
+
specs_by_platform = self.group_subspecs_by_platform(spec)
|
134
|
+
destination.parent.mkpath
|
135
|
+
should_copy = source && source.exist? && !source.children.empty?
|
136
|
+
Pod::Downloader::Cache.write_lock(destination) do
|
137
|
+
if should_copy
|
138
|
+
FileUtils.rm_rf(destination)
|
139
|
+
FileUtils.cp_r(source, destination)
|
140
|
+
LgPodPlugin.log_green "-> Copy #{name} from #{source} to #{destination}"
|
141
|
+
end
|
142
|
+
Pod::Installer::PodSourcePreparer.new(spec, destination).prepare!
|
143
|
+
Pod::Sandbox::PodDirCleaner.new(destination, specs_by_platform).clean!
|
144
|
+
end
|
120
145
|
end
|
121
146
|
|
122
147
|
public
|
123
|
-
|
124
148
|
def self.write_spec(spec, path)
|
125
|
-
|
149
|
+
path.dirname.mkpath
|
150
|
+
Pod::Downloader::Cache.write_lock(path) do
|
151
|
+
path.open('w') { |f| f.write spec.to_pretty_json }
|
152
|
+
end
|
126
153
|
end
|
127
154
|
|
128
155
|
# 拷贝 pod 缓存文件到 sandbox
|
129
|
-
|
130
156
|
public
|
131
|
-
|
132
157
|
def self.cache_pod(name, target, options = {}, spec = nil, released_pod = false)
|
133
158
|
checkout_options = Hash.new.deep_merge(options).reject do |key, val|
|
134
159
|
!key || !val
|
@@ -29,31 +29,6 @@ module Pod
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
public
|
33
|
-
def copy_and_clean(source, destination, spec)
|
34
|
-
attributes_hash = spec.send(:attributes_hash) || {}
|
35
|
-
name = attributes_hash["name"] ||= ""
|
36
|
-
specs_by_platform = group_subspecs_by_platform(spec)
|
37
|
-
destination.parent.mkpath
|
38
|
-
Pod::Downloader::Cache.write_lock(destination) do
|
39
|
-
if source && source.exist? && !source.children.empty?
|
40
|
-
FileUtils.rm_rf(destination)
|
41
|
-
FileUtils.cp_r(source, destination)
|
42
|
-
end
|
43
|
-
LgPodPlugin.log_green "-> Copy #{name} from #{source} to #{destination}"
|
44
|
-
Pod::Installer::PodSourcePreparer.new(spec, destination).prepare!
|
45
|
-
Pod::Sandbox::PodDirCleaner.new(destination, specs_by_platform).clean!
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
public
|
50
|
-
def write_spec(spec, path)
|
51
|
-
path.dirname.mkpath
|
52
|
-
Pod::Downloader::Cache.write_lock(path) do
|
53
|
-
path.open('w') { |f| f.write spec.to_pretty_json }
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
32
|
end
|
58
33
|
end
|
59
34
|
end
|
@@ -39,6 +39,7 @@ module LgPodPlugin
|
|
39
39
|
project_name = LUtils.get_git_project_name self.git
|
40
40
|
download_urls = self.download_archive_zip(project_name)
|
41
41
|
download_params = Hash.new
|
42
|
+
download_params["token"] = ""
|
42
43
|
download_params["name"] = self.name
|
43
44
|
download_params["type"] = "github-tag"
|
44
45
|
download_params["path"] = root_path.to_path
|
@@ -51,6 +52,7 @@ module LgPodPlugin
|
|
51
52
|
download_urls = self.download_archive_zip(project_name)
|
52
53
|
download_params = Hash.new
|
53
54
|
download_params["name"] = self.name
|
55
|
+
download_params["token"] = ""
|
54
56
|
download_params["type"] = "github-branch"
|
55
57
|
download_params["path"] = root_path.to_path
|
56
58
|
download_params = download_params.merge(download_urls)
|
@@ -61,6 +63,7 @@ module LgPodPlugin
|
|
61
63
|
project_name = LUtils.get_git_project_name self.git
|
62
64
|
download_urls = self.download_archive_zip(project_name)
|
63
65
|
download_params = Hash.new
|
66
|
+
download_params["token"] = ""
|
64
67
|
download_params["name"] = self.name
|
65
68
|
download_params["type"] = "github-commit"
|
66
69
|
download_params["path"] = root_path.to_path
|
@@ -14,13 +14,12 @@ module LgPodPlugin
|
|
14
14
|
token_file = db_path.join("access_token.json")
|
15
15
|
return self.get_gitlab_access_token_input(uri, user_id, nil, nil) unless token_file.exist?
|
16
16
|
json = JSON.parse(File.read("#{token_file.to_path}"))
|
17
|
-
|
18
|
-
return self.get_gitlab_access_token_input(uri, user_id, nil, nil) if
|
19
|
-
access_token = LUtils.decrypt(encrypt_access_token, "AZMpxzVxzbo3sFDLRZMpxzVxzbo3sFDZ")
|
17
|
+
access_token = json["access_token"]
|
18
|
+
return self.get_gitlab_access_token_input(uri, user_id, nil, nil) if access_token.nil?
|
20
19
|
token_vaild = GitLabAPI.request_user_emails(uri.hostname, access_token)
|
21
20
|
if token_vaild == "invalid token"
|
22
21
|
FileUtils.rm_rf token_file
|
23
|
-
return self.get_gitlab_access_token_input(uri, user_id, nil, nil)
|
22
|
+
return self.get_gitlab_access_token_input(uri, user_id, nil, nil)
|
24
23
|
end
|
25
24
|
user_id = LUserAuthInfo.get_user_id(uri.hostname)
|
26
25
|
now_time = Time.now.to_i
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lg_pod_plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.8.
|
4
|
+
version: 1.1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dongzb01
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|