lg_pod_plugin 1.1.6.7 → 1.1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/command/command.rb +1 -0
- data/lib/command/doctor.rb +31 -0
- data/lib/command/init.rb +1 -1
- data/lib/command/install.rb +1 -1
- data/lib/command/update.rb +1 -1
- data/lib/lg_pod_plugin/config/l_config.rb +4 -5
- data/lib/lg_pod_plugin/db/database.rb +82 -112
- data/lib/lg_pod_plugin/downloader/downloader.rb +7 -6
- data/lib/lg_pod_plugin/downloader/l_cache.rb +11 -2
- data/lib/lg_pod_plugin/downloader/overload_cache.rb +329 -0
- data/lib/lg_pod_plugin/downloader/request.rb +32 -32
- data/lib/lg_pod_plugin/git/gitlab_api.rb +41 -25
- data/lib/lg_pod_plugin/installer/PodDownload +0 -0
- data/lib/lg_pod_plugin/installer/install.rb +1 -4
- data/lib/lg_pod_plugin/installer/main.rb +0 -1
- data/lib/lg_pod_plugin/installer/project.rb +2 -7
- data/lib/lg_pod_plugin/pod/release-pod.rb +11 -42
- data/lib/lg_pod_plugin/version.rb +1 -1
- data/lib/lg_pod_plugin.rb +1 -0
- metadata +43 -119
- data/lib/sqlite3-1.5.3-arm64-darwin/API_CHANGES.md +0 -49
- data/lib/sqlite3-1.5.3-arm64-darwin/CHANGELOG.md +0 -462
- data/lib/sqlite3-1.5.3-arm64-darwin/CONTRIBUTING.md +0 -24
- data/lib/sqlite3-1.5.3-arm64-darwin/ChangeLog.cvs +0 -88
- data/lib/sqlite3-1.5.3-arm64-darwin/README.md +0 -235
- data/lib/sqlite3-1.5.3-arm64-darwin/dependencies.yml +0 -14
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/aggregator.c +0 -274
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/aggregator.h +0 -12
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/backup.c +0 -168
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/backup.h +0 -15
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/database.c +0 -853
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/database.h +0 -17
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/exception.c +0 -98
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/exception.h +0 -8
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/extconf.rb +0 -251
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/sqlite3.c +0 -163
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/sqlite3_ruby.h +0 -48
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/statement.c +0 -442
- data/lib/sqlite3-1.5.3-arm64-darwin/ext/sqlite3/statement.h +0 -16
- data/lib/sqlite3-1.5.3-arm64-darwin/faq/faq.md +0 -431
- data/lib/sqlite3-1.5.3-arm64-darwin/faq/faq.rb +0 -145
- data/lib/sqlite3-1.5.3-arm64-darwin/faq/faq.yml +0 -426
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/2.6/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/2.7/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/3.0/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/3.1/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/3.2/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/constants.rb +0 -50
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/database.rb +0 -741
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/errors.rb +0 -35
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/pragmas.rb +0 -595
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/resultset.rb +0 -187
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/statement.rb +0 -145
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/translator.rb +0 -118
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/value.rb +0 -57
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3/version.rb +0 -23
- data/lib/sqlite3-1.5.3-arm64-darwin/lib/sqlite3.rb +0 -15
- data/lib/sqlite3-1.5.3-arm64-darwin/test/helper.rb +0 -27
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_backup.rb +0 -33
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_collation.rb +0 -82
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_database.rb +0 -545
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_database_flags.rb +0 -95
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_database_readonly.rb +0 -36
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_database_readwrite.rb +0 -41
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_deprecated.rb +0 -44
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_encoding.rb +0 -155
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_integration.rb +0 -507
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_integration_aggregate.rb +0 -336
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_integration_open_close.rb +0 -30
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_integration_pending.rb +0 -115
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_integration_resultset.rb +0 -142
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_integration_statement.rb +0 -194
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_result_set.rb +0 -37
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_sqlite3.rb +0 -30
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_statement.rb +0 -263
- data/lib/sqlite3-1.5.3-arm64-darwin/test/test_statement_execute.rb +0 -35
- data/lib/sqlite3-1.5.3-x86_64-darwin/API_CHANGES.md +0 -49
- data/lib/sqlite3-1.5.3-x86_64-darwin/CHANGELOG.md +0 -462
- data/lib/sqlite3-1.5.3-x86_64-darwin/CONTRIBUTING.md +0 -24
- data/lib/sqlite3-1.5.3-x86_64-darwin/ChangeLog.cvs +0 -88
- data/lib/sqlite3-1.5.3-x86_64-darwin/README.md +0 -235
- data/lib/sqlite3-1.5.3-x86_64-darwin/dependencies.yml +0 -14
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/aggregator.c +0 -274
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/aggregator.h +0 -12
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/backup.c +0 -168
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/backup.h +0 -15
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/database.c +0 -853
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/database.h +0 -17
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/exception.c +0 -98
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/exception.h +0 -8
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/extconf.rb +0 -251
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/sqlite3.c +0 -163
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/sqlite3_ruby.h +0 -48
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/statement.c +0 -442
- data/lib/sqlite3-1.5.3-x86_64-darwin/ext/sqlite3/statement.h +0 -16
- data/lib/sqlite3-1.5.3-x86_64-darwin/faq/faq.md +0 -431
- data/lib/sqlite3-1.5.3-x86_64-darwin/faq/faq.rb +0 -145
- data/lib/sqlite3-1.5.3-x86_64-darwin/faq/faq.yml +0 -426
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/2.6/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/2.7/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/3.0/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/3.1/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/3.2/sqlite3_native.bundle +0 -0
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/constants.rb +0 -50
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/database.rb +0 -741
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/errors.rb +0 -35
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/pragmas.rb +0 -595
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/resultset.rb +0 -187
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/statement.rb +0 -145
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/translator.rb +0 -118
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/value.rb +0 -57
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3/version.rb +0 -23
- data/lib/sqlite3-1.5.3-x86_64-darwin/lib/sqlite3.rb +0 -15
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/helper.rb +0 -27
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_backup.rb +0 -33
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_collation.rb +0 -82
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_database.rb +0 -545
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_database_flags.rb +0 -95
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_database_readonly.rb +0 -36
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_database_readwrite.rb +0 -41
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_deprecated.rb +0 -44
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_encoding.rb +0 -155
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_integration.rb +0 -507
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_integration_aggregate.rb +0 -336
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_integration_open_close.rb +0 -30
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_integration_pending.rb +0 -115
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_integration_resultset.rb +0 -142
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_integration_statement.rb +0 -194
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_result_set.rb +0 -37
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_sqlite3.rb +0 -30
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_statement.rb +0 -263
- data/lib/sqlite3-1.5.3-x86_64-darwin/test/test_statement_execute.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4b61db7b5001df6188133eaf111f4570d0580fe4e71bc3e89863f2245d9c3ff
|
4
|
+
data.tar.gz: 14afb884ec6e4247b37f95b0002c2dd19098c75cf464fe07d3c79565f83916a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2ee449bb57c15cc6d9cd7d5566aa91af414c34a3c2aabc1a2e858650447b93df9bba3d705d248beffed8bee615b31cfc2db935c525b6eed2178658f7ab2a655
|
7
|
+
data.tar.gz: c3f587b3ed1ccb1ca27a902db900346767bb012e082f45a6f1aa8a60b17d6da913fa6cf926645b966020fc813517470a1b85d621f51a3849b255683da87bdcde
|
data/lib/command/command.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'claide'
|
3
|
+
require_relative 'command'
|
4
|
+
|
5
|
+
module LgPodPlugin
|
6
|
+
class Command
|
7
|
+
class Doctor < Command
|
8
|
+
self.abstract_command = false
|
9
|
+
self.summary = 'Manipulate the CocoaPods cache'
|
10
|
+
|
11
|
+
self.description = <<-DESC
|
12
|
+
Manipulate the download cache for pods, like printing the cache content
|
13
|
+
or cleaning the pods cache.
|
14
|
+
DESC
|
15
|
+
|
16
|
+
def initialize(argv)
|
17
|
+
# pp argv
|
18
|
+
super
|
19
|
+
end
|
20
|
+
|
21
|
+
def run
|
22
|
+
pwd = Pathname.new(File.dirname(__FILE__)).realpath
|
23
|
+
exexPath = pwd.parent.join("lg_pod_plugin/installer")
|
24
|
+
FileUtils.chdir exexPath
|
25
|
+
pp "sudo xattr -rd com.apple.quarantine ./PodDownload"
|
26
|
+
result = %x(sudo xattr -rd com.apple.quarantine ./PodDownload)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/command/init.rb
CHANGED
@@ -52,7 +52,7 @@ module LgPodPlugin
|
|
52
52
|
File.open(token_file.to_path, 'w+') { |f| f.write(str) }
|
53
53
|
LSqliteDb.shared.init_database
|
54
54
|
user_id = LUserAuthInfo.get_user_id(self.host)
|
55
|
-
user_model = LUserAuthInfo.new(user_id, "", "", self.host, self.token, "", (created_at + expires_in))
|
55
|
+
user_model = LUserAuthInfo.new(user_id, "", "", self.host, self.token, "", (created_at + expires_in), created_at, 1)
|
56
56
|
LSqliteDb.shared.insert_user_info(user_model)
|
57
57
|
LgPodPlugin.log_green "设置私人访问令牌成功"
|
58
58
|
end
|
data/lib/command/install.rb
CHANGED
data/lib/command/update.rb
CHANGED
@@ -17,16 +17,15 @@ module LgPodPlugin
|
|
17
17
|
|
18
18
|
public
|
19
19
|
def self.get_config(git, uri)
|
20
|
-
return nil unless uri&.
|
20
|
+
return nil unless uri&.hostname
|
21
21
|
return nil unless LUtils.is_gitlab_uri(git, uri.hostname)
|
22
22
|
user_id = LUserAuthInfo.get_user_id(uri.hostname)
|
23
23
|
user_info = LSqliteDb.shared.query_user_info(user_id)
|
24
|
-
|
25
|
-
|
24
|
+
if user_info != nil
|
25
|
+
user_info = GitLabAPI.check_gitlab_access_token_valid(uri, user_info)
|
26
|
+
else
|
26
27
|
user_info = GitLabAPI.get_gitlab_access_token(uri, user_id)
|
27
|
-
return nil unless user_info
|
28
28
|
end
|
29
|
-
user_info = GitLabAPI.check_gitlab_access_token_valid(uri, user_info)
|
30
29
|
return nil unless user_info
|
31
30
|
config = LConfig.new
|
32
31
|
config.host = uri.hostname
|
@@ -1,10 +1,6 @@
|
|
1
1
|
require 'singleton'
|
2
|
-
arch = %x(ruby -v)
|
3
|
-
|
4
|
-
require_relative '../../sqlite3-1.5.3-arm64-darwin/lib/sqlite3'
|
5
|
-
else
|
6
|
-
require_relative '../../sqlite3-1.5.3-x86_64-darwin/lib/sqlite3'
|
7
|
-
end
|
2
|
+
# arch = %x(ruby -v)
|
3
|
+
require 'sqlite3'
|
8
4
|
module LgPodPlugin
|
9
5
|
|
10
6
|
class ProjectModel
|
@@ -25,41 +21,19 @@ module LgPodPlugin
|
|
25
21
|
|
26
22
|
end
|
27
23
|
|
28
|
-
class LPodLatestRefs
|
29
|
-
attr_accessor :id
|
30
|
-
attr_accessor :name
|
31
|
-
attr_accessor :tag
|
32
|
-
attr_accessor :git
|
33
|
-
attr_accessor :branch
|
34
|
-
attr_accessor :commit
|
35
|
-
|
36
|
-
def initialize(id, name, git, branch, tag, commit)
|
37
|
-
self.id = id
|
38
|
-
self.git = git
|
39
|
-
self.tag = tag
|
40
|
-
self.name = name
|
41
|
-
self.branch = branch
|
42
|
-
self.commit = commit
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.get_pod_id(name, git, branch)
|
46
|
-
key = name + git + branch
|
47
|
-
return Digest::MD5.hexdigest(key)
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
24
|
class LUserAuthInfo
|
53
|
-
REQUIRED_ATTRS ||= %i[id username password host access_token refresh_token expires_in].freeze
|
25
|
+
REQUIRED_ATTRS ||= %i[id username password host access_token refresh_token expires_in update_time type].freeze
|
54
26
|
attr_accessor(*REQUIRED_ATTRS)
|
55
27
|
|
56
|
-
def initialize(id = nil, name = nil, pwd = nil, host = nil, token = nil, refresh_token = nil, time = nil)
|
28
|
+
def initialize(id = nil, name = nil, pwd = nil, host = nil, token = nil, refresh_token = nil, time = nil, update_time = nil, type = 0)
|
57
29
|
self.id = id
|
30
|
+
self.type = type
|
58
31
|
self.host = host
|
59
32
|
self.password = pwd
|
60
33
|
self.username = name
|
61
34
|
self.expires_in = time
|
62
35
|
self.access_token = token
|
36
|
+
self.update_time = update_time
|
63
37
|
self.refresh_token = refresh_token
|
64
38
|
end
|
65
39
|
|
@@ -110,6 +84,20 @@ module LgPodPlugin
|
|
110
84
|
expires_in TimeStamp NOT NULL DEFAULT CURRENT_TIMESTAMP);"
|
111
85
|
self.db.execute(sql1)
|
112
86
|
|
87
|
+
sel_sql = "select * from sqlite_master where name = '#{K_USER_TABLE}' and sql like '%update_time%'; "
|
88
|
+
resultSetPrincipal = self.db.execute(sel_sql)
|
89
|
+
if resultSetPrincipal.count == 0
|
90
|
+
alter = "ALTER TABLE #{K_USER_TABLE} ADD 'update_time' TimeStamp;"
|
91
|
+
self.db.execute(alter)
|
92
|
+
end
|
93
|
+
|
94
|
+
user_sel_sql2 = "select * from sqlite_master where name = '#{K_USER_TABLE}' and sql like '%type%'; "
|
95
|
+
resultSetPrincipal2 = self.db.execute(user_sel_sql2)
|
96
|
+
if resultSetPrincipal2.count == 0
|
97
|
+
alter = "ALTER TABLE #{K_USER_TABLE} ADD 'type' INT;"
|
98
|
+
self.db.execute(alter)
|
99
|
+
end
|
100
|
+
|
113
101
|
#添加项目表
|
114
102
|
sql2 = "create table if not exists #{K_USER_PROJECTS}(
|
115
103
|
id varchar(100) primary key not null,
|
@@ -124,26 +112,6 @@ module LgPodPlugin
|
|
124
112
|
);"
|
125
113
|
self.db.execute(sql2)
|
126
114
|
|
127
|
-
#添加项目表
|
128
|
-
sql3 = "create table if not exists #{K_POD_LATEST_REFS}(
|
129
|
-
id varchar(100) primary key not null,
|
130
|
-
name varchar(100),
|
131
|
-
git varchar(100),
|
132
|
-
branch varchar(100),
|
133
|
-
tag varchar(100),
|
134
|
-
sha varchar(100)
|
135
|
-
);"
|
136
|
-
self.db.execute(sql3)
|
137
|
-
|
138
|
-
#添加项目表
|
139
|
-
sql4 = "create table if not exists #{K_POD_SHA_BRANCH}(
|
140
|
-
id varchar(100) primary key not null,
|
141
|
-
name varchar(100),
|
142
|
-
git varchar(100),
|
143
|
-
branch varchar(100),
|
144
|
-
sha varchar(100)
|
145
|
-
);"
|
146
|
-
self.db.execute(sql4)
|
147
115
|
end
|
148
116
|
|
149
117
|
public
|
@@ -151,11 +119,11 @@ module LgPodPlugin
|
|
151
119
|
# pp "user.id => #{user.id}"
|
152
120
|
if self.query_user_info(user.id) != nil
|
153
121
|
self.db.execute_batch(
|
154
|
-
"UPDATE #{K_USER_TABLE} SET username = (:username), password = (:password), host = (:host), access_token = (:access_token), expires_in = (:expires_in), refresh_token = (:refresh_token) where (id = :id)", { "username" => user.username, "password" => user.password, "host" => user.host, "access_token" => user.access_token, :expires_in => user.expires_in, :id => user.id, :refresh_token => user.refresh_token }
|
122
|
+
"UPDATE #{K_USER_TABLE} SET username = (:username), password = (:password), host = (:host), access_token = (:access_token), expires_in = (:expires_in), refresh_token = (:refresh_token), update_time = (:update_time), type = (:type) where (id = :id)", { "username" => user.username, "password" => user.password, "host" => user.host, "access_token" => user.access_token, :expires_in => user.expires_in, :id => user.id, :refresh_token => user.refresh_token , :update_time => user.update_time, :type => user.type}
|
155
123
|
)
|
156
124
|
else
|
157
|
-
self.db.execute("INSERT INTO #{K_USER_TABLE} (id, username, password, host, access_token,refresh_token, expires_in)
|
158
|
-
VALUES (?, ?, ?,
|
125
|
+
self.db.execute("INSERT INTO #{K_USER_TABLE} (id, username, password, host, access_token,refresh_token, expires_in, update_time, type)
|
126
|
+
VALUES (?, ?, ?, ?,?,?,?, ?, ?)", [user.id, user.username, user.password, user.host, user.access_token, user.refresh_token, user.expires_in, user.update_time, user.type])
|
159
127
|
end
|
160
128
|
|
161
129
|
end
|
@@ -173,6 +141,8 @@ module LgPodPlugin
|
|
173
141
|
user_info.access_token = row[4]
|
174
142
|
user_info.refresh_token = row[5]
|
175
143
|
user_info.expires_in = row[6]
|
144
|
+
user_info.update_time = row[7]
|
145
|
+
user_info.type = row[8]
|
176
146
|
end
|
177
147
|
user_info
|
178
148
|
end
|
@@ -220,67 +190,67 @@ module LgPodPlugin
|
|
220
190
|
ps.execute('n' => project_id)
|
221
191
|
end
|
222
192
|
|
223
|
-
def insert_pod_refs(name, git, branch, tag, commit)
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
end
|
236
|
-
|
237
|
-
def query_pod_refs(id)
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
end
|
193
|
+
# def insert_pod_refs(name, git, branch, tag, commit)
|
194
|
+
# id = LPodLatestRefs.get_pod_id(name, git, branch)
|
195
|
+
# pod = LPodLatestRefs.new(id, name, git, branch, tag, commit)
|
196
|
+
# if self.query_pod_refs(id) != nil
|
197
|
+
# self.db.execute_batch(
|
198
|
+
# "UPDATE #{K_POD_LATEST_REFS} SET name = (:name), git = (:git), branch = (:branch), tag = (:tag), sha = (:sha) where (id = :id)", { "name" => pod.name, "git" => pod.git, "sha" => pod.commit, "branch" => pod.branch, :tag => pod.tag, :id => pod.id }
|
199
|
+
# )
|
200
|
+
# else
|
201
|
+
# self.db.execute("INSERT INTO #{K_POD_LATEST_REFS} (id, name, git, branch, tag, sha)
|
202
|
+
# VALUES (?, ?, ?, ?, ?, ?)", [pod.id, pod.name, pod.git, pod.branch, pod.tag, pod.commit])
|
203
|
+
# end
|
204
|
+
# self.insert_pod_sha_with_branch(name, git, commit, branch)
|
205
|
+
# end
|
206
|
+
#
|
207
|
+
# def query_pod_refs(id)
|
208
|
+
# pod_info = nil
|
209
|
+
# self.db.execute("select * from #{K_POD_LATEST_REFS} where id = '#{id}';") do |row|
|
210
|
+
# id = row[0]
|
211
|
+
# name = row[1]
|
212
|
+
# git = row[2]
|
213
|
+
# branch = row[3]
|
214
|
+
# tag = row[4]
|
215
|
+
# commit = row[5]
|
216
|
+
# pod_info = LPodLatestRefs.new(id, name, git, branch, tag, commit)
|
217
|
+
# end
|
218
|
+
# pod_info
|
219
|
+
# end
|
250
220
|
|
251
221
|
# 保存 sha, branch 到数据库
|
252
|
-
def insert_pod_sha_with_branch(name, git, sha, branch)
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
end
|
222
|
+
# def insert_pod_sha_with_branch(name, git, sha, branch)
|
223
|
+
# return unless name && git && sha
|
224
|
+
# id = Digest::MD5.hexdigest(name + git + sha)
|
225
|
+
# if self.query_branch_with_sha(name, git, sha)[:sha] != nil
|
226
|
+
# self.db.execute_batch(
|
227
|
+
# "UPDATE #{K_POD_SHA_BRANCH} SET name = (:name), git = (:git), branch = (:branch), sha = (:sha) where (id = :id)", { "name" => name, "git" => git, "branch" => branch, :id => id, :sha => sha }
|
228
|
+
# )
|
229
|
+
# else
|
230
|
+
# self.db.execute("INSERT INTO #{K_POD_SHA_BRANCH} (id, name, git, branch, sha)
|
231
|
+
# VALUES (?, ?, ?, ?, ?)", [id, name, git, branch, sha])
|
232
|
+
# end
|
233
|
+
# end
|
264
234
|
|
265
235
|
# 通过 sha 查询对应 branch
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
236
|
+
# def query_branch_with_sha(id = nil, name, git, sha)
|
237
|
+
# hash_map = Hash.new
|
238
|
+
# id = Digest::MD5.hexdigest(name + git + sha) unless id
|
239
|
+
# self.db.execute("select * from #{K_POD_SHA_BRANCH} where id = '#{id}' and name = '#{name}' and git = '#{git}' ;") do |row|
|
240
|
+
# new_id = row[0]
|
241
|
+
# new_sha = row[4]
|
242
|
+
# new_git = row[2]
|
243
|
+
# new_name = row[1]
|
244
|
+
# new_branch = row[3]
|
245
|
+
# hash_map[:id] = new_id
|
246
|
+
# hash_map[:git] = new_git
|
247
|
+
# hash_map[:sha] = new_sha
|
248
|
+
# hash_map[:name] = new_name
|
249
|
+
# hash_map[:branch] = new_branch
|
250
|
+
# end
|
251
|
+
# hash_map
|
252
|
+
# end
|
253
|
+
#
|
284
254
|
end
|
285
255
|
|
286
256
|
end
|
@@ -32,10 +32,10 @@ module LgPodPlugin
|
|
32
32
|
checkout_options[:branch] = branch if branch
|
33
33
|
end
|
34
34
|
commit = checkout_options[:commit]
|
35
|
-
unless commit
|
36
|
-
|
37
|
-
|
38
|
-
end
|
35
|
+
# unless commit
|
36
|
+
# commit = self.request.params[:commit] if self.request.params[:commit]
|
37
|
+
# checkout_options[:commit] = commit if commit
|
38
|
+
# end
|
39
39
|
if branch
|
40
40
|
LgPodPlugin.log_green "Using `#{name}` (#{branch})"
|
41
41
|
elsif tag
|
@@ -49,8 +49,8 @@ module LgPodPlugin
|
|
49
49
|
LgPodPlugin.log_green "Using `#{name}`"
|
50
50
|
end
|
51
51
|
hash_map = self.request.get_cache_key_params
|
52
|
-
self.request.checkout_options.delete(:branch) if commit
|
53
|
-
self.request.checkout_options[:commit] = commit if commit
|
52
|
+
# self.request.checkout_options.delete(:branch) if commit
|
53
|
+
# self.request.checkout_options[:commit] = commit if commit
|
54
54
|
# 发现本地有缓存, 不需要更新缓存
|
55
55
|
pod_is_exist, destination, cache_pod_spec = LCache.new.pod_cache_exist(name, hash_map, podspec, self.request.released_pod)
|
56
56
|
if pod_is_exist
|
@@ -58,6 +58,7 @@ module LgPodPlugin
|
|
58
58
|
return nil
|
59
59
|
else
|
60
60
|
LgPodPlugin.log_green "find the new commit of `#{name}`, Git downloading now."
|
61
|
+
|
61
62
|
# 本地 git 下载 pod 目录
|
62
63
|
download_params = self.pre_download_git_repository(checkout_options)
|
63
64
|
if download_params && download_params.is_a?(Hash)
|
@@ -13,7 +13,16 @@ module LgPodPlugin
|
|
13
13
|
|
14
14
|
public
|
15
15
|
def pod_cache_exist(name, options, spec = nil, released_pod = false)
|
16
|
+
# 参数为空不执行下载任务, 交给 cocoapods 处理下载
|
17
|
+
if options.nil?
|
18
|
+
return [true, nil, nil]
|
19
|
+
end
|
20
|
+
|
16
21
|
destination, cache_pod_spec = self.find_pod_cache name, options, spec, released_pod
|
22
|
+
lock_temp_file = destination.to_path+ ".lock"
|
23
|
+
if File.exist?(lock_temp_file)
|
24
|
+
FileUtils.rm_rf lock_temp_file
|
25
|
+
end
|
17
26
|
if (File.exist?(destination) && !destination.children.empty?) && cache_pod_spec.exist?
|
18
27
|
return [true, destination, cache_pod_spec]
|
19
28
|
else
|
@@ -29,8 +38,8 @@ module LgPodPlugin
|
|
29
38
|
hash_map.delete(:version)
|
30
39
|
end
|
31
40
|
request = LCache.download_request(name, hash_map, spec, released_pod)
|
32
|
-
destination = LCache.path_for_pod(request
|
33
|
-
cache_pod_spec = LCache.path_for_spec(request
|
41
|
+
destination = LCache.path_for_pod(request)
|
42
|
+
cache_pod_spec = LCache.path_for_spec(request)
|
34
43
|
[destination, cache_pod_spec]
|
35
44
|
end
|
36
45
|
|