lg_pod_plugin 1.1.6.3 → 1.1.6.5

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: 75b2349a1ddeb538035e926a25be2f3a18589e307c158dce81e3282e9c656e5d
4
- data.tar.gz: 284ee67f49b9d6dba2123aba1c0649f8c525a5528666f772568a81c24c489b87
3
+ metadata.gz: 7af2ac8a760f94c57f82d9005cd1b366a7dc9b51ab09c887e43dff3e0f43b0c4
4
+ data.tar.gz: f120886f336ce31ea35dcc38300a24561878a7a49963017484d26b59eb3e671e
5
5
  SHA512:
6
- metadata.gz: dd8f333635e20d8f19a76bb0077ba52e48dd92d700941b22584ec5c875044ff827dec95eba287f8af1f820ac592140b98d76869f29b5d38e5fd21678e9c4ca08
7
- data.tar.gz: 99c8fe2a58f062dc236862e2af6802afa2d7832a8a3a0a9c4d2c1ba9a1c814c18fb51fd8bde6686e301e4a9d61a1baef1bb77f7c788f51d0ae347c6167c922a6
6
+ metadata.gz: e304fe0bbafee6d7ad797c3bc32e60c4fb050109d29a2d04d27d0a22630a7e9abf024820e54891792c16b8953f0574b0876e4df2b67cf27f22e57af7c89a6352
7
+ data.tar.gz: 13029c1d8e46a6dc0388fc7de8e78b470dbd6f040834d6554bab1c615a4344d7f8584efbf56714c1429262fb6478ec2fa6792cfedef7570b0ad3cd4b354ddfb4
@@ -55,7 +55,6 @@ module LgPodPlugin
55
55
  end
56
56
 
57
57
  def run
58
-
59
58
  begin_time = Time.now.to_i
60
59
  LgPodPlugin::Main.run("install", { :verbose => self.log, :repo_update => self.repo_update, :clean_install => self.clean_install })
61
60
  end_time = Time.now.to_i
@@ -121,35 +121,6 @@ module LgPodPlugin
121
121
  Pod::Downloader::Cache.lock(location, File::LOCK_SH, &block)
122
122
  end
123
123
 
124
- # def self.lock(location, lock_type)
125
- # raise ArgumentError, 'no block given' unless block_given?
126
- # lockfile = "#{location}.lock"
127
- # f = nil
128
- # loop do
129
- # f.close if f
130
- # f = File.open(lockfile, File::CREAT, 0o644)
131
- # f.flock(lock_type)
132
- # break if self.valid_lock?(f, lockfile)
133
- # end
134
- # begin
135
- # yield location
136
- # ensure
137
- # if lock_type == File::LOCK_SH
138
- # f.flock(File::LOCK_EX)
139
- # File.delete(lockfile) if self.valid_lock?(f, lockfile)
140
- # else
141
- # File.delete(lockfile)
142
- # end
143
- # f.close
144
- # end
145
- # end
146
-
147
- # def self.valid_lock?(file, filename)
148
- # file.stat.ino == File.stat(filename).ino
149
- # rescue Errno::ENOENT
150
- # false
151
- # end
152
-
153
124
  public
154
125
  def self.write_spec(spec, path)
155
126
  path.dirname.mkpath
@@ -82,27 +82,11 @@ module LgPodPlugin
82
82
 
83
83
  public
84
84
  def get_lock_params
85
- begin
86
- _release_pods = self.lockfile.release_pods ||= []
87
- _external_source = (self.lockfile.external_sources_data[self.name])
88
- _external_source = {} unless _external_source
89
- _checkout_options = self.lockfile.checkout_options_for_pod_named(self.name)
90
- rescue
91
- _release_pods = {}
92
- _external_source = {}
93
- _checkout_options = {}
94
- end
95
-
96
85
  git = self.checkout_options[:git]
97
86
  tag = self.checkout_options[:tag]
98
87
  commit = self.checkout_options[:commit]
99
88
  branch = self.checkout_options[:branch]
100
89
 
101
- lock_git = _external_source[:git] ||= _checkout_options[:git]
102
- lock_tag = _external_source[:tag] ||= _release_pods[self.name]
103
- lock_branch = _external_source[:branch] ||= ""
104
- lock_commit = _checkout_options[:commit] ||= ""
105
-
106
90
  hash_map = Hash.new
107
91
  hash_map[:git] = git if git
108
92
  if git && tag
@@ -110,53 +94,15 @@ module LgPodPlugin
110
94
  return hash_map
111
95
  elsif git && branch
112
96
  hash_map[:branch] = branch
113
- if lock_commit && !lock_commit.empty? && !LProject.shared.update
114
- pod_info = LSqliteDb.shared.query_branch_with_sha(self.name, git, lock_commit)
115
- lock_branch = pod_info[:branch] if lock_branch.empty?
116
- new_commit = pod_info[:sha] ||= ""
117
- if lock_branch == branch && new_commit == lock_commit
118
- hash_map[:commit] = lock_commit
119
- return hash_map
120
- end
121
- end
122
97
  _, new_commit = git_ls_remote_refs(self.name, git, branch)
123
- if new_commit && !new_commit.empty?
124
- hash_map[:commit] = new_commit
125
- elsif lock_commit && !lock_commit.empty?
126
- hash_map[:commit] = lock_commit
127
- end
98
+ hash_map[:commit] = new_commit if new_commit
128
99
  elsif git && commit
129
100
  hash_map[:commit] = commit
130
101
  return hash_map
131
102
  else
132
- if lock_git && !LProject.shared.update
133
- id = LPodLatestRefs.get_pod_id(self.name, git)
134
- pod_info = LSqliteDb.shared.query_pod_refs(id)
135
- if pod_info&.commit
136
- if pod_info
137
- new_commit = pod_info.commit
138
- else
139
- new_commit = nil
140
- end
141
- if pod_info
142
- new_branch = pod_info.branch
143
- else
144
- new_branch = nil
145
- end
146
- if new_commit
147
- hash_map[:commit] = new_commit
148
- end
149
- if new_branch
150
- hash_map[:branch] = new_branch
151
- end
152
- return hash_map
153
- end
154
- end
155
103
  new_branch, new_commit = git_ls_remote_refs(self.name, git, nil)
156
104
  hash_map[:branch] = new_branch if new_branch
157
- if new_commit && !new_commit.empty?
158
- hash_map[:commit] = new_commit
159
- end
105
+ hash_map[:commit] = new_commit if new_commit
160
106
  end
161
107
  hash_map
162
108
  end
@@ -22,6 +22,7 @@ module LgPodPlugin
22
22
  else
23
23
  request_url += ("/commits/" + "HEAD")
24
24
  end
25
+ LgPodPlugin.log_blue "http reqeust: #{request_url}"
25
26
  begin
26
27
  uri = URI(request_url)
27
28
  res = Net::HTTP.get_response(uri)
@@ -182,7 +182,8 @@ module LgPodPlugin
182
182
  if commit
183
183
  return [commit, branch]
184
184
  else
185
- return self.use_default_refs_heads git, branch
185
+ commit, _ = self.use_default_refs_heads git, branch
186
+ return [commit, branch]
186
187
  end
187
188
  end
188
189
 
@@ -1,5 +1,5 @@
1
1
  require 'json'
2
- require 'aescrypt'
2
+ # require 'aescrypt'
3
3
 
4
4
  module LgPodPlugin
5
5
 
@@ -8,12 +8,14 @@ module LgPodPlugin
8
8
  public
9
9
  def self.async_download_pods(installers)
10
10
  return if installers.empty?
11
- json_text = installers.map(&:download_params).uniq.to_json
12
- arvg = LUtils.encrypt json_text, "AZMpxzVxzbo3sFDLRZMpxzVxzbo3sFDZ"
13
- return unless arvg && !arvg.empty?
11
+ hash = installers.map(&:download_params).uniq
12
+ json_text = JSON.generate(hash)
13
+ file_path = LFileManager.download_director.join(LUtils.md5(json_text)).to_path + ".json"
14
+ # pp file_path
15
+ File.open(file_path, 'w+') { |f| f.write(json_text) }
14
16
  pwd = Pathname.new(File.dirname(__FILE__)).realpath
15
17
  FileUtils.chdir pwd
16
- system("./PodDownload #{arvg}")
18
+ system("./PodDownload #{file_path}")
17
19
  installers.each(&:copy_file_to_caches)
18
20
  end
19
21
 
@@ -69,12 +69,9 @@ module LgPodPlugin
69
69
  git = checkout_options[:git]
70
70
  return unless git
71
71
  cache_podspec = request.lg_spec.spec if request.lg_spec
72
- branch = checkout_options[:branch]
72
+ branch = checkout_options[:branch] ||= request.params[:branch]
73
73
  checkout_options[:name] = name if name
74
- unless branch
75
- branch = self.request.params[:branch] if request.params[:branch]
76
- checkout_options[:branch] = branch if branch
77
- end
74
+ checkout_options[:branch] = branch if branch
78
75
  lg_pod_path = LFileManager.cache_workspace(LProject.shared.workspace)
79
76
  lg_pod_path.mkdir(0700) unless lg_pod_path.exist?
80
77
  checkout_options[:path] = lg_pod_path
@@ -11,7 +11,6 @@ module LgPodPlugin
11
11
  sand_box = LFileManager.download_director
12
12
  sand_box.each_child do |f|
13
13
  ftype = File::ftype(f)
14
- next unless ftype == "directory"
15
14
  next if f.to_path.include?("database")
16
15
  FileUtils.rm_rf f.to_path
17
16
  end
@@ -16,7 +16,7 @@ module LgPodPlugin
16
16
  attr_reader :external_pods
17
17
  attr_reader :need_update_pods
18
18
  attr_accessor :cache_specs
19
- attr_accessor :redirect_url_hash
19
+ # attr_accessor :redirect_url_hash
20
20
  def setup(workspace,podfile_path, update, repo_update)
21
21
  @podfile = Pod::Podfile.from_file(podfile_path)
22
22
  @update = update
@@ -36,7 +36,7 @@ module LgPodPlugin
36
36
  @cache_specs = Hash.new
37
37
  @external_pods = Hash.new.merge!(external_pods)
38
38
  @need_update_pods = Hash.new
39
- @redirect_url_hash = Hash.new
39
+ # @redirect_url_hash = Hash.new
40
40
  return self
41
41
  end
42
42
 
@@ -29,24 +29,25 @@ module LgPodPlugin
29
29
  origin_uri = URI(git)
30
30
  end
31
31
  return if origin_uri.nil?
32
- redirect_url = LProject.shared.redirect_url_hash[origin_uri.host]
33
- if redirect_url
34
- @uri = redirect_url
35
- else
36
- @uri = URI(get_redirect_url(origin_uri.scheme + "://" + origin_uri.host))
37
- LProject.shared.redirect_url_hash[origin_uri.host] = @uri
38
- end
32
+ @uri = origin_uri
33
+ # redirect_url = LProject.shared.redirect_url_hash[origin_uri.host]
34
+ # if redirect_url
35
+ # @uri = redirect_url
36
+ # else
37
+ # @uri = URI(get_redirect_url(origin_uri.scheme + "://" + origin_uri.host))
38
+ # LProject.shared.redirect_url_hash[origin_uri.host] = @uri
39
+ # end
39
40
  @host = @uri.host
40
41
  @scheme = @uri.scheme ||= "https"
41
42
  @hostname = @scheme + "://" + @host
42
43
  end
43
44
 
44
- def get_redirect_url(host)
45
- redirect_url = Net::HTTP.get_response(URI(host))['location']
46
- return host unless redirect_url
47
- uri = URI(redirect_url)
48
- return uri.scheme + "://" + uri.host
49
- end
45
+ # def get_redirect_url(host)
46
+ # redirect_url = Net::HTTP.get_response(URI(host))['location']
47
+ # return host unless redirect_url
48
+ # uri = URI(redirect_url)
49
+ # return uri.scheme + "://" + uri.host
50
+ # end
50
51
 
51
52
  private
52
53
  #判断是否是 IP 地址
@@ -3,20 +3,20 @@ require 'resolv'
3
3
  require "ipaddr"
4
4
  require 'base64'
5
5
  require 'fileutils'
6
- require_relative 'aes-crypt'
6
+ # require_relative 'aes-crypt'
7
7
 
8
8
  module LgPodPlugin
9
9
 
10
10
  class LUtils
11
11
 
12
- def self.encrypt(message, password)
13
- encrypted_data = AESCrypt.encrypt(message, password)
14
- encrypted_data.tr("\n", "")
15
- end
16
-
17
- def self.decrypt(message, password)
18
- AESCrypt.decrypt message, password
19
- end
12
+ # def self.encrypt(message, password)
13
+ # encrypted_data = AESCrypt.encrypt(message, password)
14
+ # encrypted_data.tr("\n", "")
15
+ # end
16
+ #
17
+ # def self.decrypt(message, password)
18
+ # AESCrypt.decrypt message, password
19
+ # end
20
20
 
21
21
  def self.md5(text)
22
22
  return "" unless text
@@ -1,3 +1,3 @@
1
1
  module LgPodPlugin
2
- VERSION = "1.1.6.3"
2
+ VERSION = "1.1.6.5"
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.6.3
4
+ version: 1.1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - dongzb01
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-14 00:00:00.000000000 Z
11
+ date: 2023-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -44,20 +44,6 @@ dependencies:
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '2.0'
47
- - !ruby/object:Gem::Dependency
48
- name: aescrypt
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.0'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '1.0'
61
47
  - !ruby/object:Gem::Dependency
62
48
  name: bacon
63
49
  requirement: !ruby/object:Gem::Requirement