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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b92a4e546c65aa5763dbca8c0d44ce618b7049464a6bd3b2cdd6cab0d40d8319
4
- data.tar.gz: a250d44da3534a1e6d7838a85a6c4a29181c1265aff835da5d04bc0b0f82cf4c
3
+ metadata.gz: 7c0e6e6636ccfd5a082792e1b651975da5b1a6e19484ed15dbe5a55238f3b0f2
4
+ data.tar.gz: d5a5dd3a53178fb05a5a585eb4d11c5021004166bed1f39458cbc9e8b9649d5f
5
5
  SHA512:
6
- metadata.gz: e51b1b5d76ee3590650665a52731fbdf11dcea9c2a67f9f9ca1034a4c8b53334690ea60c7d77a38e077bd93d74480cee0fc463f2be564aef57c527da3a61df32
7
- data.tar.gz: 7a37de109ec6ec2409277f93a2e53b5ee8863ce337723d22ff630314736fac0567cc015d0be8b55af6a5f60a0bd45d1eff876b0c52efe92904761bc8b1d69343
6
+ metadata.gz: 40fc60a48b964c9de9f621562f58512deeac842d542a098c299dacd0059a8fb8f75b6e761e0f012fac34fea8a42c123d449a0226937fdcf2ae349e78a72844c9
7
+ data.tar.gz: d37222953e9e5d83df8e84c856daca6e473762200080a4e8b02cc2a6cf71e85e99f2d124fa0a2483d89a522213a7fbf389246d90a93f55adad19d9436edf931a
@@ -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
- begin
55
- print "Input GitLab private token: "
56
- private_token = STDIN.gets.chomp
57
- end until private_token.length > 0
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)
@@ -8,12 +8,12 @@ module Gb
8
8
  self.summary = '遍历所有工程执行命令'
9
9
  self.description = <<-DESC
10
10
  遍历所有工程执行命令.
11
- gb forall -c="git reset --hard"
11
+ gb forall --c="git reset --hard"
12
12
  DESC
13
13
 
14
14
  def self.options
15
15
  [
16
- ["-c", "执行命令"],
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 run_in_workspace
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}`
@@ -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 < users.size
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 < users.size
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
@@ -1,3 +1,3 @@
1
1
  module Gb
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
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.3
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-18 00:00:00.000000000 Z
11
+ date: 2019-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab