yjcocoa 19.01.05 → 19.04.09
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 +5 -5
- data/lib/yjcocoa/git/git.rb +1 -0
- data/lib/yjcocoa/git/git_checkout.rb +71 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 1214382f56754d3cc57c560c122e45d461feb41ef2a1a42b40f4d724ae14b805
|
|
4
|
+
data.tar.gz: 0f4652aebf2a257a1f063f2f6923254e9490faf3267d6d4909bce7ad4479e10a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2033608fa63cd78531f1ff67342578cbb63ed73442cf98177444327ef0223aedce85bd95820fd2d1e860e249539bd0b7b1ebc446a38ddc20bdc4455645744426
|
|
7
|
+
data.tar.gz: 156029e75711f18b70ffba48577cca89602782e46d310dccd9126bc0ad7b91e180cacd696f9075bec0b81b137c72ea25db505abbab03c37487c0418f745e5a2b
|
data/lib/yjcocoa/git/git.rb
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#
|
|
2
|
+
# git_checkout.rb
|
|
3
|
+
# YJCocoa
|
|
4
|
+
#
|
|
5
|
+
# https://github.com/937447974
|
|
6
|
+
# YJ技术支持群:557445088
|
|
7
|
+
#
|
|
8
|
+
# Created by 阳君 on 2019/03/18.
|
|
9
|
+
# Copyright © 2017年 YJCocoa. All rights reserved.
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
module YJCocoa
|
|
13
|
+
|
|
14
|
+
class GitCheckout < Git
|
|
15
|
+
|
|
16
|
+
self.command = 'checkout'
|
|
17
|
+
self.summary = 'git checkout'
|
|
18
|
+
self.description = 'git checkout 当前文件夹下所有 gits'
|
|
19
|
+
|
|
20
|
+
def self.options
|
|
21
|
+
[['--branch', '切换 branch'],]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# property
|
|
25
|
+
attr_accessor :branch
|
|
26
|
+
attr_accessor :gits
|
|
27
|
+
|
|
28
|
+
# 初始化
|
|
29
|
+
def initialize(argv)
|
|
30
|
+
super
|
|
31
|
+
self.branch = argv.option('branch')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# businrss
|
|
35
|
+
def validate!
|
|
36
|
+
self.banner! unless self.branch
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def run
|
|
40
|
+
self.buildGitPaths
|
|
41
|
+
if self.gits.empty?
|
|
42
|
+
if self.gitExist?
|
|
43
|
+
self.gitCheckout
|
|
44
|
+
end
|
|
45
|
+
else
|
|
46
|
+
self.gits.each { |path|
|
|
47
|
+
self.gitCheckout(path)
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def buildGitPaths
|
|
53
|
+
self.gits = Dir["**/.git"]
|
|
54
|
+
self.gits.map! { |path|
|
|
55
|
+
File.dirname(path)
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def gitCheckout(path=".")
|
|
60
|
+
Dir.chdir(path) {
|
|
61
|
+
puts "YJCocoa git checkout #{path}/.git".green
|
|
62
|
+
localChanges = !(`git stash` =~ /No local changes to save/)
|
|
63
|
+
system("git checkout -b #{self.branch}") unless system("git checkout #{self.branch}")
|
|
64
|
+
`git stash pop` if localChanges
|
|
65
|
+
puts
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yjcocoa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 19.
|
|
4
|
+
version: 19.04.09
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 阳君
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-04-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: claide
|
|
@@ -67,6 +67,7 @@ files:
|
|
|
67
67
|
- lib/yjcocoa/git/git.rb
|
|
68
68
|
- lib/yjcocoa/git/git_branch.rb
|
|
69
69
|
- lib/yjcocoa/git/git_cache.rb
|
|
70
|
+
- lib/yjcocoa/git/git_checkout.rb
|
|
70
71
|
- lib/yjcocoa/git/git_pull.rb
|
|
71
72
|
- lib/yjcocoa/git/git_tag.rb
|
|
72
73
|
- lib/yjcocoa/git/git_tag_add.rb
|
|
@@ -102,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
102
103
|
version: '0'
|
|
103
104
|
requirements: []
|
|
104
105
|
rubyforge_project:
|
|
105
|
-
rubygems_version: 2.
|
|
106
|
+
rubygems_version: 2.7.8
|
|
106
107
|
signing_key:
|
|
107
108
|
specification_version: 3
|
|
108
109
|
summary: YJCocoa, the Cocoa library package manager.
|