lg_pod_plugin 1.1.8.1 → 1.1.8.2

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: 64cfe9f5818b1ad35a426e047a1639889db338c028923af2e2cbc9c4e31556da
4
- data.tar.gz: ce53c502a2bbbeb261dfe3dc048a8e423848f7f29633956447c0abe1b474712d
3
+ metadata.gz: aafc9f0e84eb60f2f5a215573e20d4496446d31ad7fa4e8829c309872ad682cc
4
+ data.tar.gz: a1d6ef6d263704e67e90de93cd4d756e52e67ad385eaebfb2907691c1f83db4e
5
5
  SHA512:
6
- metadata.gz: 6a6f5bc095f471f44cb2effd225be4bcf1c10622374adbe7f00d2b7953f0be3b09f763307ba167456169ba862e629e0cdf3e5596228f093461ee98fb35c3b21d
7
- data.tar.gz: e081fa09f5ba85d7a9a581b30a8fabf9e83ce89c200bd020b3a9bdc0a8b6b955cf61b01fd1c0279ea2dbec406f77b6b790fd42397a2989632a3eb8fa918c5f28
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 = LUtils.encrypt(self.token, "AZMpxzVxzbo3sFDLRZMpxzVxzbo3sFDZ")
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
- cache_path = LFileManager.cache_root_path
84
- return Pod::Downloader::Cache.new(cache_path)
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
- def self.get_local_spec(request, target)
98
- result = Pod::Downloader::Response.new
99
- result.location = target
100
- if request.released_pod?
101
- result.spec = request.spec
102
- local_specs = { request.name => request.spec }
103
- return [request, local_specs]
104
- else
105
- local_specs = {}
106
- pods_pecs = Pod::Sandbox::PodspecFinder.new(target).podspecs
107
- pods_pecs[request.name] = request.spec if request.spec
108
- pods_pecs.each do |name, spec|
109
- if request.name == name
110
- result.spec = spec
111
- local_specs[request.name] = spec
112
- end
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
- [result, local_specs]
127
+ specs_by_platform
116
128
  end
117
129
 
118
130
  def self.copy_and_clean(source, destination, spec)
119
- return self.root_cache.copy_and_clean(source, destination, spec)
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
- self.root_cache.write_spec(spec, path)
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
@@ -12,7 +12,6 @@ module LgPodPlugin
12
12
  attr_accessor :config
13
13
  attr_accessor :net_ping
14
14
  attr_accessor :params
15
- # attr_accessor :lockfile
16
15
  attr_accessor :checkout_options
17
16
  def initialize(pod)
18
17
  @name = pod.name
@@ -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
- encrypt_access_token = json["access_token"]
18
- return self.get_gitlab_access_token_input(uri, user_id, nil, nil) if encrypt_access_token.nil?
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) if encrypt_access_token.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
@@ -1,5 +1,4 @@
1
1
  require 'pp'
2
- # require 'git'
3
2
  require 'cgi'
4
3
  require 'cocoapods'
5
4
  require 'cocoapods-core'
@@ -1,3 +1,3 @@
1
1
  module LgPodPlugin
2
- VERSION = "1.1.8.1"
2
+ VERSION = "1.1.8.2"
3
3
  end
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.1
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-02-29 00:00:00.000000000 Z
11
+ date: 2024-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods