gb 0.1.4 → 0.1.5

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: 7c0e6e6636ccfd5a082792e1b651975da5b1a6e19484ed15dbe5a55238f3b0f2
4
- data.tar.gz: d5a5dd3a53178fb05a5a585eb4d11c5021004166bed1f39458cbc9e8b9649d5f
3
+ metadata.gz: 3b92ad8cd61b9c2d62fb116b18f32d32427991a19ff500143a73ae56bfb83594
4
+ data.tar.gz: 11abb0149753c7034552e921f7cc99def1d8e0ef69d5047c760998fd6306d43e
5
5
  SHA512:
6
- metadata.gz: 40fc60a48b964c9de9f621562f58512deeac842d542a098c299dacd0059a8fb8f75b6e761e0f012fac34fea8a42c123d449a0226937fdcf2ae349e78a72844c9
7
- data.tar.gz: d37222953e9e5d83df8e84c856daca6e473762200080a4e8b02cc2a6cf71e85e99f2d124fa0a2483d89a522213a7fbf389246d90a93f55adad19d9436edf931a
6
+ metadata.gz: 25dc38f5ed524a36c9e73845c846ea78e9f5772c8ce2d6feb9b5d7bd8c9d5dcda30e93b503ebaed158b64104abd1f66e0502591cdb6b0da21b4ded543f3d63a6
7
+ data.tar.gz: 344af45ef1f1baa0b2810a738f5aacb6c4d1cfe8610226d86b59ad6f34d8a63bc0bc104d3d619ec74ff1727202c35e6812f5db0e66426f13717ad37af989f899
@@ -39,7 +39,7 @@ module Gb
39
39
  end
40
40
  end
41
41
 
42
- def run
42
+ def run_in_config
43
43
  # api: https://www.rubydoc.info/gems/gitlab/toplevel
44
44
  # document: https://narkoz.github.io/gitlab/cli
45
45
 
@@ -34,7 +34,7 @@ module Gb
34
34
  end
35
35
  end
36
36
 
37
- def run
37
+ def run_in_config
38
38
  # api: https://www.rubydoc.info/gems/gitlab/toplevel
39
39
  # document: https://narkoz.github.io/gitlab/cli
40
40
 
@@ -29,7 +29,7 @@ module Gb
29
29
  end
30
30
  end
31
31
 
32
- def run
32
+ def run_in_config
33
33
 
34
34
  self.gb_config.projects.each do |project|
35
35
  project_path = File.expand_path(project.name, './')
@@ -44,7 +44,7 @@ module Gb
44
44
  end
45
45
  end
46
46
 
47
- def run_in_workspace
47
+ def run_in_config
48
48
  remote = "origin"
49
49
 
50
50
  # api: https://www.rubydoc.info/gems/gitlab/toplevel
@@ -47,7 +47,7 @@ module Gb
47
47
  # end
48
48
  end
49
49
 
50
- def run_in_workspace
50
+ def run_in_config
51
51
 
52
52
  @working_branch = self.workspace_config.work_branch
53
53
  @remote_branch = self.workspace_config.remote_branch
@@ -194,7 +194,7 @@ module Gb
194
194
  end until @title.length > 0
195
195
  end
196
196
 
197
- if at_user.nil?
197
+ if at_user.nil? && !users.nil?
198
198
  info "Find user for @."
199
199
  puts "0、none".green
200
200
  users.each_with_index do |user, index|
@@ -37,7 +37,7 @@ module Gb
37
37
  end
38
38
  end
39
39
 
40
- def run
40
+ def run_in_config
41
41
  remote = 'origin'
42
42
  workspace_config = WorkSpaceConfig.new(@remote_branch, @working_branch)
43
43
 
@@ -11,7 +11,7 @@ module Gb
11
11
  查看工作分支代码状态.
12
12
  DESC
13
13
 
14
- def run_in_workspace
14
+ def run_in_config
15
15
  workspace_config = self.workspace_config
16
16
  info "current work branch '#{workspace_config.work_branch}'"
17
17
  info "track remote branch '#{workspace_config.remote_branch}'."
@@ -11,7 +11,7 @@ module Gb
11
11
  根据yml配置,更新代码.
12
12
  DESC
13
13
 
14
- def run_in_workspace
14
+ def run_in_config
15
15
 
16
16
  remote = 'origin'
17
17
  workspace_config = self.workspace_config
@@ -11,7 +11,7 @@ module Gb
11
11
  查看当前工作区信息.
12
12
  DESC
13
13
 
14
- def run_in_workspace
14
+ def run_in_config
15
15
 
16
16
  remote = 'origin'
17
17
  workspace_config = self.workspace_config
@@ -1,3 +1,3 @@
1
1
  module Gb
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -12,14 +12,8 @@ module Gb
12
12
  self.ignore_in_command_lookup = true
13
13
  attr_reader :gb_config
14
14
 
15
- def self.options
16
- [
17
- ['--config=[Gb.yml]', 'gb配置, 默认为Gb.yml'],
18
- ].concat(super)
19
- end
20
-
21
15
  def initialize(argv)
22
- @yml = argv.option('config')
16
+ # @yml = argv.option('config')
23
17
  if @yml.nil?
24
18
  @yml = 'Gb.yml'
25
19
  end
@@ -31,31 +25,31 @@ module Gb
31
25
  end
32
26
 
33
27
  def run
34
- workspace_path = "./"
35
- find_workspace = false;
28
+ config_dir = "./"
29
+ find_config = false;
36
30
  begin
37
31
  result = nil
38
- Dir.chdir(workspace_path) do
39
- result = Dir.glob('.gb', File::FNM_DOTMATCH)
32
+ Dir.chdir(config_dir) do
33
+ result = Dir.glob('Gb.yml', File::FNM_DOTMATCH)
40
34
  end
41
35
  if result.length > 0
42
- find_workspace = true
36
+ find_config = true
43
37
  break
44
38
  else
45
- workspace_path = File.expand_path("../", workspace_path)
39
+ config_dir = File.expand_path("../", config_dir)
46
40
  end
47
- end while workspace_path.length > 0 && workspace_path != "/"
41
+ end while config_dir.length > 0 && config_dir != "/"
48
42
 
49
- if find_workspace
50
- Dir.chdir(workspace_path) do
51
- self.run_in_workspace()
43
+ if find_config
44
+ Dir.chdir(config_dir) do
45
+ self.run_in_config()
52
46
  end
53
47
  else
54
48
  raise Error.new("Current path is not gb workspace. please run 'gb start' first.")
55
49
  end
56
50
  end
57
51
 
58
- def run_in_workspace
52
+ def run_in_config
59
53
 
60
54
  end
61
55
 
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
4
+ version: 0.1.5
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-25 00:00:00.000000000 Z
11
+ date: 2019-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab