gb 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/commands/create.rb +10 -5
- data/lib/commands/forall.rb +4 -4
- data/lib/commands/review.rb +2 -2
- data/lib/gb/version.rb +1 -1
- 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: 7c0e6e6636ccfd5a082792e1b651975da5b1a6e19484ed15dbe5a55238f3b0f2
|
4
|
+
data.tar.gz: d5a5dd3a53178fb05a5a585eb4d11c5021004166bed1f39458cbc9e8b9649d5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40fc60a48b964c9de9f621562f58512deeac842d542a098c299dacd0059a8fb8f75b6e761e0f012fac34fea8a42c123d449a0226937fdcf2ae349e78a72844c9
|
7
|
+
data.tar.gz: d37222953e9e5d83df8e84c856daca6e473762200080a4e8b02cc2a6cf71e85e99f2d124fa0a2483d89a522213a7fbf389246d90a93f55adad19d9436edf931a
|
data/lib/commands/create.rb
CHANGED
@@ -14,6 +14,7 @@ module Gb
|
|
14
14
|
def self.options
|
15
15
|
options = [
|
16
16
|
["--config_url=[url]", "指定配置文件url地址"],
|
17
|
+
["--private_token=[token]", "GitLab private token"],
|
17
18
|
].concat(super)
|
18
19
|
options.delete_if do |option|
|
19
20
|
option[0] =~ /^--config=/
|
@@ -23,6 +24,7 @@ module Gb
|
|
23
24
|
|
24
25
|
def initialize(argv)
|
25
26
|
@config_url = argv.option('config_url')
|
27
|
+
@private_token = argv.option('private_token')
|
26
28
|
super
|
27
29
|
end
|
28
30
|
|
@@ -51,12 +53,15 @@ module Gb
|
|
51
53
|
gb_config = GbConfig.load_yml(yml_response)
|
52
54
|
end
|
53
55
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
56
|
+
if @private_token.nil?
|
57
|
+
begin
|
58
|
+
print "Input GitLab private token: "
|
59
|
+
private_token = STDIN.gets.chomp
|
60
|
+
end until private_token.length > 0
|
61
|
+
@private_token = private_token
|
62
|
+
end
|
58
63
|
|
59
|
-
gb_config.gitlab.private_token = private_token
|
64
|
+
gb_config.gitlab.private_token = @private_token
|
60
65
|
|
61
66
|
File.open("./Gb.yml", 'w') do |file|
|
62
67
|
Psych.dump(gb_config.to_dictionary, file)
|
data/lib/commands/forall.rb
CHANGED
@@ -8,12 +8,12 @@ module Gb
|
|
8
8
|
self.summary = '遍历所有工程执行命令'
|
9
9
|
self.description = <<-DESC
|
10
10
|
遍历所有工程执行命令.
|
11
|
-
gb forall
|
11
|
+
gb forall --c="git reset --hard"
|
12
12
|
DESC
|
13
13
|
|
14
14
|
def self.options
|
15
15
|
[
|
16
|
-
["
|
16
|
+
["--c", "执行命令"],
|
17
17
|
].concat(super)
|
18
18
|
end
|
19
19
|
|
@@ -29,13 +29,13 @@ module Gb
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def run
|
33
33
|
|
34
34
|
self.gb_config.projects.each do |project|
|
35
35
|
project_path = File.expand_path(project.name, './')
|
36
36
|
|
37
37
|
if File.exist?(project_path)
|
38
|
-
info "For project '#{project.name}'..."
|
38
|
+
info "'#{@command}' For project '#{project.name}'..."
|
39
39
|
g = Git.open(project_path)
|
40
40
|
Dir.chdir(project_path) do
|
41
41
|
result = `#{@command}`
|
data/lib/commands/review.rb
CHANGED
@@ -171,7 +171,7 @@ module Gb
|
|
171
171
|
user = nil
|
172
172
|
elsif input_user =~ /[[:digit:]]/
|
173
173
|
index = input_user.to_i;
|
174
|
-
if index > 0 && index
|
174
|
+
if index > 0 && index <= users.size
|
175
175
|
user = users[input_user.to_i - 1]
|
176
176
|
else
|
177
177
|
user = nil
|
@@ -213,7 +213,7 @@ module Gb
|
|
213
213
|
else
|
214
214
|
if input_user.length == 0
|
215
215
|
break
|
216
|
-
elsif index
|
216
|
+
elsif index <= users.size
|
217
217
|
user = users[input_user.to_i - 1]
|
218
218
|
else
|
219
219
|
user = nil
|
data/lib/gb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- binluo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|