yjcocoa 19.04.09 → 20.07.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/yjcocoa/git/git_branch.rb +33 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1214382f56754d3cc57c560c122e45d461feb41ef2a1a42b40f4d724ae14b805
4
- data.tar.gz: 0f4652aebf2a257a1f063f2f6923254e9490faf3267d6d4909bce7ad4479e10a
3
+ metadata.gz: 40d37f6010c02d5bc410ed53af79da394e7ba2a3c851863b234876545d3fe5be
4
+ data.tar.gz: a396593d587cde35a650f8c34f0abf1d26f027e8e92872cc8475f7bf9b7304a1
5
5
  SHA512:
6
- metadata.gz: 2033608fa63cd78531f1ff67342578cbb63ed73442cf98177444327ef0223aedce85bd95820fd2d1e860e249539bd0b7b1ebc446a38ddc20bdc4455645744426
7
- data.tar.gz: 156029e75711f18b70ffba48577cca89602782e46d310dccd9126bc0ad7b91e180cacd696f9075bec0b81b137c72ea25db505abbab03c37487c0418f745e5a2b
6
+ metadata.gz: 067a7461030bec8e1d45aec69317006037491f3b64f968bda50f9fa614e6155ae9126b8e1e01dbb07cb2e1ed296f7c02d73a27d965bae4a2e5349065972b7c3d
7
+ data.tar.gz: d10af319ad7d5665e861e6e3d3d9833ce45ff92b51a9bb5aeebd431c7a0d9c51018ed355dc46f3266d6379803adae480ebd7c267d68a41a86a637fc86326fa24
@@ -31,6 +31,7 @@ module YJCocoa
31
31
  # property
32
32
  attr_accessor :addBranch
33
33
  attr_accessor :deleteBranchs
34
+ attr_accessor :gits # git array
34
35
 
35
36
  # 初始化
36
37
  def initialize(argv)
@@ -42,18 +43,44 @@ module YJCocoa
42
43
 
43
44
  # businrss
44
45
  def validate!
45
- exit 0 unless self.gitExist?
46
+ super
46
47
  self.banner! unless self.addBranch || self.deleteBranchs
47
48
  end
48
49
 
49
- def run
50
- if self.addBranch
51
- self.gitBranchAdd
52
- puts
50
+ def run
51
+ self.buildGitPaths
52
+ if self.gits.empty?
53
+ if self.gitExist?
54
+ self.gitRun
55
+ end
56
+ else
57
+ self.gits.each { |path|
58
+ self.gitRun(path)
59
+ }
53
60
  end
54
- self.gitBranchDelete if self.deleteBranchs && !self.deleteBranchs.empty?
61
+ end
62
+
63
+ def buildGitPaths
64
+ self.gits = Dir["**/.git"]
65
+ self.gits.map! { |path|
66
+ File.dirname(path)
67
+ }
55
68
  end
56
69
 
70
+ def gitRun(path=".")
71
+ thread = Thread.new {
72
+ Dir.chdir(path) {
73
+ puts "YJCocoa git #{path}/.git".green
74
+ self.gitBranchDelete if self.deleteBranchs && !self.deleteBranchs.empty?
75
+ if self.addBranch
76
+ self.gitBranchAdd
77
+ puts
78
+ end
79
+ }
80
+ }
81
+ thread.join
82
+ end
83
+
57
84
  def gitBranchAdd
58
85
  puts "YJCocoa git add branch #{self.addBranch}".green
59
86
  system("git push --set-upstream origin #{self.addBranch}") if system("git checkout -b #{self.addBranch}")
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.04.09
4
+ version: 20.07.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - 阳君
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-09 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide