lg_pod_plugin 1.1.6.7 → 1.1.7.3
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/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 +116 -110
- 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 +29 -18
- 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 +29 -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: 44d4ceb34301dcc5a0312f8591cdbde166e1a4b7e2cb8a885738fa6997192de8
|
4
|
+
data.tar.gz: 0f770eba1a322ed7294d68d7ed81f9aef997f546a0d9c3c61f315cb563824e8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06506e9cd1131a5932ea3e550cc641832f13f194cd9427edfafcff2bcdd93758da909a8f0542c282869be565b23f42b80fee02c2e0ae52515eabefee433bcbb3
|
7
|
+
data.tar.gz: 72be08ac45145844d3c7082bdf1fe53e68b8892ac3bef7b9c58d6bfabe35448c2033290e66aace828a3397490e641926c8a7297c5480eb4b6cb61770da2ebc41
|
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/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,42 @@ module LgPodPlugin
|
|
25
21
|
|
26
22
|
end
|
27
23
|
|
28
|
-
class LPodLatestRefs
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
24
|
+
# class LPodLatestRefs
|
25
|
+
# attr_accessor :id
|
26
|
+
# attr_accessor :name
|
27
|
+
# attr_accessor :tag
|
28
|
+
# attr_accessor :git
|
29
|
+
# attr_accessor :branch
|
30
|
+
# attr_accessor :commit
|
31
|
+
#
|
32
|
+
# def initialize(id, name, git, branch, tag, commit)
|
33
|
+
# self.id = id
|
34
|
+
# self.git = git
|
35
|
+
# self.tag = tag
|
36
|
+
# self.name = name
|
37
|
+
# self.branch = branch
|
38
|
+
# self.commit = commit
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
# def self.get_pod_id(name, git, branch)
|
42
|
+
# key = name + git + branch
|
43
|
+
# return Digest::MD5.hexdigest(key)
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# end
|
51
47
|
|
52
48
|
class LUserAuthInfo
|
53
|
-
REQUIRED_ATTRS ||= %i[id username password host access_token refresh_token expires_in].freeze
|
49
|
+
REQUIRED_ATTRS ||= %i[id username password host access_token refresh_token expires_in update_time].freeze
|
54
50
|
attr_accessor(*REQUIRED_ATTRS)
|
55
51
|
|
56
|
-
def initialize(id = nil, name = nil, pwd = nil, host = nil, token = nil, refresh_token = nil, time = nil)
|
52
|
+
def initialize(id = nil, name = nil, pwd = nil, host = nil, token = nil, refresh_token = nil, time = nil, update_time = nil)
|
57
53
|
self.id = id
|
58
54
|
self.host = host
|
59
55
|
self.password = pwd
|
60
56
|
self.username = name
|
61
57
|
self.expires_in = time
|
62
58
|
self.access_token = token
|
59
|
+
self.update_time = update_time
|
63
60
|
self.refresh_token = refresh_token
|
64
61
|
end
|
65
62
|
|
@@ -110,6 +107,13 @@ module LgPodPlugin
|
|
110
107
|
expires_in TimeStamp NOT NULL DEFAULT CURRENT_TIMESTAMP);"
|
111
108
|
self.db.execute(sql1)
|
112
109
|
|
110
|
+
sel_sql = "select * from sqlite_master where name = '#{K_USER_TABLE}' and sql like '%update_time%'; "
|
111
|
+
resultSetPrincipal = self.db.execute(sel_sql)
|
112
|
+
if resultSetPrincipal.count == 0
|
113
|
+
alter = "ALTER TABLE #{K_USER_TABLE} ADD 'update_time' TimeStamp;"
|
114
|
+
self.db.execute(alter)
|
115
|
+
end
|
116
|
+
|
113
117
|
#添加项目表
|
114
118
|
sql2 = "create table if not exists #{K_USER_PROJECTS}(
|
115
119
|
id varchar(100) primary key not null,
|
@@ -124,26 +128,27 @@ module LgPodPlugin
|
|
124
128
|
);"
|
125
129
|
self.db.execute(sql2)
|
126
130
|
|
127
|
-
#添加项目表
|
128
|
-
sql3 = "create table if not exists #{K_POD_LATEST_REFS}(
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
self.db.execute(sql3)
|
131
|
+
# #添加项目表
|
132
|
+
# sql3 = "create table if not exists #{K_POD_LATEST_REFS}(
|
133
|
+
# id varchar(100) primary key not null,
|
134
|
+
# name varchar(100),
|
135
|
+
# git varchar(100),
|
136
|
+
# branch varchar(100),
|
137
|
+
# tag varchar(100),
|
138
|
+
# sha varchar(100)
|
139
|
+
# );"
|
140
|
+
# self.db.execute(sql3)
|
141
|
+
#
|
142
|
+
# #添加项目表
|
143
|
+
# sql4 = "create table if not exists #{K_POD_SHA_BRANCH}(
|
144
|
+
# id varchar(100) primary key not null,
|
145
|
+
# name varchar(100),
|
146
|
+
# git varchar(100),
|
147
|
+
# branch varchar(100),
|
148
|
+
# sha varchar(100)
|
149
|
+
# );"
|
150
|
+
# self.db.execute(sql4)
|
137
151
|
|
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
152
|
end
|
148
153
|
|
149
154
|
public
|
@@ -151,11 +156,11 @@ module LgPodPlugin
|
|
151
156
|
# pp "user.id => #{user.id}"
|
152
157
|
if self.query_user_info(user.id) != nil
|
153
158
|
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 }
|
159
|
+
"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) 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}
|
155
160
|
)
|
156
161
|
else
|
157
|
-
self.db.execute("INSERT INTO #{K_USER_TABLE} (id, username, password, host, access_token,refresh_token, expires_in)
|
158
|
-
VALUES (?, ?, ?,
|
162
|
+
self.db.execute("INSERT INTO #{K_USER_TABLE} (id, username, password, host, access_token,refresh_token, expires_in, update_time)
|
163
|
+
VALUES (?, ?, ?, ?,?,?,?, ?)", [user.id, user.username, user.password, user.host, user.access_token, user.refresh_token, user.expires_in, user.update_time])
|
159
164
|
end
|
160
165
|
|
161
166
|
end
|
@@ -173,6 +178,7 @@ module LgPodPlugin
|
|
173
178
|
user_info.access_token = row[4]
|
174
179
|
user_info.refresh_token = row[5]
|
175
180
|
user_info.expires_in = row[6]
|
181
|
+
user_info.update_time = row[7]
|
176
182
|
end
|
177
183
|
user_info
|
178
184
|
end
|
@@ -220,67 +226,67 @@ module LgPodPlugin
|
|
220
226
|
ps.execute('n' => project_id)
|
221
227
|
end
|
222
228
|
|
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
|
229
|
+
# def insert_pod_refs(name, git, branch, tag, commit)
|
230
|
+
# id = LPodLatestRefs.get_pod_id(name, git, branch)
|
231
|
+
# pod = LPodLatestRefs.new(id, name, git, branch, tag, commit)
|
232
|
+
# if self.query_pod_refs(id) != nil
|
233
|
+
# self.db.execute_batch(
|
234
|
+
# "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 }
|
235
|
+
# )
|
236
|
+
# else
|
237
|
+
# self.db.execute("INSERT INTO #{K_POD_LATEST_REFS} (id, name, git, branch, tag, sha)
|
238
|
+
# VALUES (?, ?, ?, ?, ?, ?)", [pod.id, pod.name, pod.git, pod.branch, pod.tag, pod.commit])
|
239
|
+
# end
|
240
|
+
# self.insert_pod_sha_with_branch(name, git, commit, branch)
|
241
|
+
# end
|
242
|
+
#
|
243
|
+
# def query_pod_refs(id)
|
244
|
+
# pod_info = nil
|
245
|
+
# self.db.execute("select * from #{K_POD_LATEST_REFS} where id = '#{id}';") do |row|
|
246
|
+
# id = row[0]
|
247
|
+
# name = row[1]
|
248
|
+
# git = row[2]
|
249
|
+
# branch = row[3]
|
250
|
+
# tag = row[4]
|
251
|
+
# commit = row[5]
|
252
|
+
# pod_info = LPodLatestRefs.new(id, name, git, branch, tag, commit)
|
253
|
+
# end
|
254
|
+
# pod_info
|
255
|
+
# end
|
250
256
|
|
251
257
|
# 保存 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
|
258
|
+
# def insert_pod_sha_with_branch(name, git, sha, branch)
|
259
|
+
# return unless name && git && sha
|
260
|
+
# id = Digest::MD5.hexdigest(name + git + sha)
|
261
|
+
# if self.query_branch_with_sha(name, git, sha)[:sha] != nil
|
262
|
+
# self.db.execute_batch(
|
263
|
+
# "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 }
|
264
|
+
# )
|
265
|
+
# else
|
266
|
+
# self.db.execute("INSERT INTO #{K_POD_SHA_BRANCH} (id, name, git, branch, sha)
|
267
|
+
# VALUES (?, ?, ?, ?, ?)", [id, name, git, branch, sha])
|
268
|
+
# end
|
269
|
+
# end
|
264
270
|
|
265
271
|
# 通过 sha 查询对应 branch
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
272
|
+
# def query_branch_with_sha(id = nil, name, git, sha)
|
273
|
+
# hash_map = Hash.new
|
274
|
+
# id = Digest::MD5.hexdigest(name + git + sha) unless id
|
275
|
+
# self.db.execute("select * from #{K_POD_SHA_BRANCH} where id = '#{id}' and name = '#{name}' and git = '#{git}' ;") do |row|
|
276
|
+
# new_id = row[0]
|
277
|
+
# new_sha = row[4]
|
278
|
+
# new_git = row[2]
|
279
|
+
# new_name = row[1]
|
280
|
+
# new_branch = row[3]
|
281
|
+
# hash_map[:id] = new_id
|
282
|
+
# hash_map[:git] = new_git
|
283
|
+
# hash_map[:sha] = new_sha
|
284
|
+
# hash_map[:name] = new_name
|
285
|
+
# hash_map[:branch] = new_branch
|
286
|
+
# end
|
287
|
+
# hash_map
|
288
|
+
# end
|
289
|
+
#
|
284
290
|
end
|
285
291
|
|
286
292
|
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
|
|