xccache 0.0.1a3 → 0.0.1.rc14987908371
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/xccache/core/git.rb +5 -1
- data/lib/xccache/storage/git.rb +4 -2
- 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: a0bde9f30b45d9bb5fa1d57f746027a52966b3dbd8e346df12ea7192352b4771
|
4
|
+
data.tar.gz: 9c00c24e25538a0a7e57d0fb5b523562529f2bef84a5e0dd3db2dcc48b5a2d06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66ede00254ddaf3471eaf2626a8f69548bdaf3afaa5b2fa25ced9b410212b7b63e96dfd2f1252f70b81f894cf39fa2dbe0e04938e37f834ccdce4c4cd08022bb
|
7
|
+
data.tar.gz: bc0a0ebf9d586e20c8a8af039d3481afa301543d5b4d717f365861e5bbd4cabc644dd6bbf512c1264abff8c833866fb970cc76885a22ea4c96378f99f30c2571
|
data/lib/xccache/core/git.rb
CHANGED
@@ -18,7 +18,11 @@ module XCCache
|
|
18
18
|
status("--porcelain", capture: true, log_cmd: false)[0].empty?
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
def init?
|
22
|
+
!root.glob(".git").empty?
|
23
|
+
end
|
24
|
+
|
25
|
+
%i[init checkout fetch pull push clean add commit branch remote switch status].each do |name|
|
22
26
|
define_method(name) do |*args, **kwargs|
|
23
27
|
run(name, *args, **kwargs)
|
24
28
|
end
|
data/lib/xccache/storage/git.rb
CHANGED
@@ -7,7 +7,8 @@ module XCCache
|
|
7
7
|
def initialize(options = {})
|
8
8
|
super
|
9
9
|
if (@remote = options[:remote])
|
10
|
-
|
10
|
+
schemes = ["http://", "https://", "git@"]
|
11
|
+
@remote = File.expand_path(@remote) unless schemes.any? { |x| @remote.start_with?(x) }
|
11
12
|
ensure_remote
|
12
13
|
end
|
13
14
|
@branch = options[:branch]
|
@@ -27,7 +28,7 @@ module XCCache
|
|
27
28
|
|
28
29
|
git.add(".")
|
29
30
|
git.commit("-m \"Update cache at #{Time.new}\"")
|
30
|
-
git.push("origin #{branch}")
|
31
|
+
git.push("-u origin #{branch}")
|
31
32
|
end
|
32
33
|
|
33
34
|
private
|
@@ -37,6 +38,7 @@ module XCCache
|
|
37
38
|
end
|
38
39
|
|
39
40
|
def ensure_remote
|
41
|
+
git.init unless git.init?
|
40
42
|
existing = git.remote("get-url origin || true", capture: true, log_cmd: false)[0].strip
|
41
43
|
return if @remote == existing
|
42
44
|
return git.remote("add origin #{@remote}") if existing.empty?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xccache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1.rc14987908371
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thuyen Trinh
|
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: 1.3.1
|
164
164
|
requirements: []
|
165
|
-
rubygems_version: 3.2.
|
165
|
+
rubygems_version: 3.2.33
|
166
166
|
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: A Ruby gem
|