kookeeper 1.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. metadata +11 -110
  3. data/.github/ISSUE_TEMPLATE.md +0 -20
  4. data/.gitignore +0 -50
  5. data/.travis.yml +0 -19
  6. data/CODE_OF_CONDUCT.md +0 -46
  7. data/CONTRIBUTING.md +0 -70
  8. data/Gemfile +0 -10
  9. data/Gemfile.lock +0 -125
  10. data/LICENSE +0 -21
  11. data/README.md +0 -113
  12. data/Rakefile +0 -2
  13. data/big_keeper.gemspec +0 -49
  14. data/bin/big +0 -14
  15. data/bin/setup +0 -8
  16. data/docs/en-US/FEATURE.md +0 -0
  17. data/docs/en-US/README.md +0 -54
  18. data/docs/zh-CN/BIGKEEPER_FILE.md +0 -84
  19. data/docs/zh-CN/FEATURE&HOTFIX.md +0 -88
  20. data/docs/zh-CN/IMAGE.md +0 -0
  21. data/docs/zh-CN/PODFILE.md +0 -43
  22. data/docs/zh-CN/README.md +0 -113
  23. data/docs/zh-CN/RECOMMEND.md +0 -22
  24. data/docs/zh-CN/RELEASE.md +0 -60
  25. data/docs/zh-CN/SPEC.md +0 -39
  26. data/lib/big_keeper/command/client.rb +0 -50
  27. data/lib/big_keeper/command/feature&hotfix/delete.rb +0 -40
  28. data/lib/big_keeper/command/feature&hotfix/finish.rb +0 -54
  29. data/lib/big_keeper/command/feature&hotfix/list.rb +0 -63
  30. data/lib/big_keeper/command/feature&hotfix/publish.rb +0 -56
  31. data/lib/big_keeper/command/feature&hotfix/pull.rb +0 -26
  32. data/lib/big_keeper/command/feature&hotfix/push.rb +0 -27
  33. data/lib/big_keeper/command/feature&hotfix/rebase.rb +0 -32
  34. data/lib/big_keeper/command/feature&hotfix/start.rb +0 -74
  35. data/lib/big_keeper/command/feature&hotfix/switch.rb +0 -46
  36. data/lib/big_keeper/command/feature&hotfix/update.rb +0 -66
  37. data/lib/big_keeper/command/feature&hotfix.rb +0 -167
  38. data/lib/big_keeper/command/image/image.rb +0 -0
  39. data/lib/big_keeper/command/image.rb +0 -28
  40. data/lib/big_keeper/command/init.rb +0 -36
  41. data/lib/big_keeper/command/pod/podfile.rb +0 -72
  42. data/lib/big_keeper/command/pod.rb +0 -55
  43. data/lib/big_keeper/command/release/finish.rb +0 -36
  44. data/lib/big_keeper/command/release/home.rb +0 -92
  45. data/lib/big_keeper/command/release/module.rb +0 -65
  46. data/lib/big_keeper/command/release/publish.rb +0 -4
  47. data/lib/big_keeper/command/release/start.rb +0 -78
  48. data/lib/big_keeper/command/release.rb +0 -100
  49. data/lib/big_keeper/command/spec/add.rb +0 -9
  50. data/lib/big_keeper/command/spec/analyze.rb +0 -88
  51. data/lib/big_keeper/command/spec/delete.rb +0 -9
  52. data/lib/big_keeper/command/spec/list.rb +0 -19
  53. data/lib/big_keeper/command/spec/search.rb +0 -9
  54. data/lib/big_keeper/command/spec/sync.rb +0 -12
  55. data/lib/big_keeper/command/spec.rb +0 -78
  56. data/lib/big_keeper/dependency/dep_gradle_operator.rb +0 -74
  57. data/lib/big_keeper/dependency/dep_operator.rb +0 -48
  58. data/lib/big_keeper/dependency/dep_pod_operator.rb +0 -130
  59. data/lib/big_keeper/dependency/dep_service.rb +0 -14
  60. data/lib/big_keeper/dependency/dep_type.rb +0 -33
  61. data/lib/big_keeper/model/gitflow_type.rb +0 -43
  62. data/lib/big_keeper/model/library_model.rb +0 -116
  63. data/lib/big_keeper/model/operate_type.rb +0 -30
  64. data/lib/big_keeper/model/podfile_model.rb +0 -33
  65. data/lib/big_keeper/service/git_service.rb +0 -211
  66. data/lib/big_keeper/service/module_service.rb +0 -224
  67. data/lib/big_keeper/service/stash_service.rb +0 -45
  68. data/lib/big_keeper/util/bigkeeper_parser.rb +0 -260
  69. data/lib/big_keeper/util/cache_operator.rb +0 -118
  70. data/lib/big_keeper/util/code_operator.rb +0 -37
  71. data/lib/big_keeper/util/command_line_util.rb +0 -9
  72. data/lib/big_keeper/util/file_operator.rb +0 -33
  73. data/lib/big_keeper/util/git_operator.rb +0 -242
  74. data/lib/big_keeper/util/gitflow_operator.rb +0 -51
  75. data/lib/big_keeper/util/gradle_content_generator.rb +0 -26
  76. data/lib/big_keeper/util/gradle_file_operator.rb +0 -339
  77. data/lib/big_keeper/util/gradle_module_operator.rb +0 -70
  78. data/lib/big_keeper/util/info_plist_operator.rb +0 -46
  79. data/lib/big_keeper/util/leancloud_logger.rb +0 -84
  80. data/lib/big_keeper/util/list_generator.rb +0 -101
  81. data/lib/big_keeper/util/lockfile_parser.rb +0 -143
  82. data/lib/big_keeper/util/logger.rb +0 -47
  83. data/lib/big_keeper/util/pod_operator.rb +0 -70
  84. data/lib/big_keeper/util/podfile_detector.rb +0 -102
  85. data/lib/big_keeper/util/podfile_module.rb +0 -63
  86. data/lib/big_keeper/util/podfile_operator.rb +0 -125
  87. data/lib/big_keeper/util/verify_operator.rb +0 -17
  88. data/lib/big_keeper/util/version_config_operator.rb +0 -29
  89. data/lib/big_keeper/util/xcode_operator.rb +0 -15
  90. data/lib/big_keeper/version.rb +0 -3
  91. data/lib/big_keeper.rb +0 -81
  92. data/resources/banner.png +0 -0
  93. data/resources/command.png +0 -0
  94. data/resources/keynote/big-keeper-readme-analyze.key +0 -0
  95. data/resources/keynote/big-keeper-readme-example.key +0 -0
  96. data/resources/keynote/big-keeper-readme-feature.key +0 -0
  97. data/resources/keynote/big-keeper-readme-release.key +0 -0
  98. data/resources/readme/big-keeper-readme.001.png +0 -0
  99. data/resources/template/Bigkeeper +0 -23
@@ -1,40 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- require 'big_keeper/util/podfile_operator'
4
- require 'big_keeper/util/gitflow_operator'
5
- require 'big_keeper/util/bigkeeper_parser'
6
- require 'big_keeper/util/logger'
7
- require 'big_keeper/util/pod_operator'
8
-
9
- require 'big_keeper/dependency/dep_service'
10
-
11
- require 'big_keeper/dependency/dep_type'
12
-
13
- require 'big_keeper/service/stash_service'
14
- require 'big_keeper/service/module_service'
15
-
16
-
17
- module BigKeeper
18
- def self.delete(path, user, name, type)
19
- begin
20
- # Parse Bigkeeper file
21
- BigkeeperParser.parse("#{path}/Bigkeeper")
22
- branch_name = "#{GitflowType.name(type)}/#{name}"
23
- version = 'all version'
24
-
25
- modules = BigkeeperParser.module_names
26
- modules.each do |module_name|
27
- module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
28
-
29
- if FileOperator.definitely_exists?(module_full_path)
30
- StashService.new.pop_stash(module_full_path, branch_name, module_name)
31
- GitService.new.verify_del(module_full_path, branch_name, module_name, type)
32
- end
33
- end
34
-
35
- StashService.new.pop_stash(path, branch_name, 'Home')
36
- GitService.new.verify_del(path, branch_name, 'Home', type)
37
- ensure
38
- end
39
- end
40
- end
@@ -1,54 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- require 'big_keeper/util/podfile_operator'
4
- require 'big_keeper/util/logger'
5
- require 'big_keeper/util/pod_operator'
6
- require 'big_keeper/util/xcode_operator'
7
- require 'big_keeper/util/cache_operator'
8
- require 'big_keeper/util/bigkeeper_parser'
9
- require 'big_keeper/model/operate_type'
10
- require 'big_keeper/dependency/dep_service'
11
-
12
- require 'big_keeper/dependency/dep_type'
13
-
14
-
15
- module BigKeeper
16
-
17
- def self.finish(path, user, type)
18
- begin
19
- # Parse Bigkeeper file
20
- BigkeeperParser.parse("#{path}/Bigkeeper")
21
-
22
- branch_name = GitOperator.new.current_branch(path)
23
- Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
24
-
25
- # Cache git modules
26
- if ModuleCacheOperator.new(path).all_path_modules.empty?
27
- Logger.error("Branch '#{branch_name}' is already finished, exit.")
28
- end
29
-
30
- ModuleCacheOperator.new(path).cache_git_modules(ModuleCacheOperator.new(path).all_path_modules)
31
-
32
- modules = ModuleCacheOperator.new(path).remain_git_modules
33
- # Rebase modules and modify module as git
34
- modules.each do |module_name|
35
- ModuleService.new.finish(path, user, module_name, branch_name, type)
36
- end
37
-
38
- Logger.highlight("Finish branch '#{branch_name}' for 'Home'")
39
-
40
- # Delete all path modules
41
- ModuleCacheOperator.new(path).cache_path_modules([], [], [])
42
-
43
- # Install
44
- DepService.dep_operator(path, user).install(modules, OperateType::FINISH, false)
45
-
46
- # Open home workspace
47
- DepService.dep_operator(path, user).open
48
-
49
- # Push home changes to remote
50
- GitService.new.verify_push(path, "finish branch #{branch_name}", branch_name, 'Home')
51
- ensure
52
- end
53
- end
54
- end
@@ -1,63 +0,0 @@
1
- #!/usr/bin/ruby
2
- require 'big_keeper/util/bigkeeper_parser'
3
- require 'big_keeper/util/list_generator'
4
- require 'big_keeper/service/module_service'
5
-
6
-
7
- module BigKeeper
8
- def self.list(path, user, type, options)
9
- BigkeeperParser.parse("#{path}/Bigkeeper")
10
- home_path = File.expand_path(path)
11
- #get home project branches
12
- branches = GitService.new.branchs_with_type(home_path, type)
13
- #get modules list
14
- is_print_log = false if options[:json]
15
- #get search version
16
- version = options[:version]
17
- cache_path = File.expand_path("#{path}/.bigkeeper")
18
- json_path = "#{cache_path}/branches.json"
19
- begin
20
- #get cache file path
21
- FileUtils.mkdir_p(cache_path) unless File.exist?(cache_path)
22
- file = File.new(json_path, 'w', :encoding => 'UTF-8')
23
- begin
24
- #get all modules info
25
- module_list_dic = get_module_info(path, user, type, version, branches, is_print_log)
26
- file << module_list_dic.to_json
27
- file.close
28
- end
29
- #print list
30
- generate_list_with_option(options, json_path, version, branches)
31
- ensure
32
- file.close
33
- end
34
- end
35
-
36
- def self.get_module_info(path, user, type, version, home_branches, is_print_log)
37
- #get module list
38
- modules = BigkeeperParser.module_names
39
- git_operator = GitOperator.new
40
- module_info_list = []
41
- modules.each do |module_name|
42
- module_full_path = BigkeeperParser.module_full_path(path, user, module_name)
43
- #local project verify
44
- if !File.exist? module_full_path
45
- Logger.default("No local repository for module '#{module_name}', clone it...") if is_print_log
46
- module_git = BigkeeperParser.module_git(module_name)
47
- git_operator.clone(File.expand_path("#{module_full_path}/../"), module_git)
48
- end
49
- #每个模块详细信息
50
- module_branch_info = ModuleService.new.module_info(module_full_path, home_branches, user, type, module_name, version)
51
- module_info_list << module_branch_info
52
- end
53
- module_info_list
54
- end
55
-
56
- def self.generate_list_with_option(options, file_path, version, home_branches)
57
- if options[:json]
58
- ListGenerator.generate_json(file_path, home_branches, version)
59
- else
60
- ListGenerator.generate_tree(file_path, home_branches, version)
61
- end
62
- end
63
- end
@@ -1,56 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- require 'big_keeper/util/podfile_operator'
4
- require 'big_keeper/util/logger'
5
- require 'big_keeper/util/pod_operator'
6
- require 'big_keeper/util/xcode_operator'
7
- require 'big_keeper/util/cache_operator'
8
- require 'big_keeper/util/bigkeeper_parser'
9
- require 'big_keeper/model/operate_type'
10
- require 'big_keeper/dependency/dep_service'
11
-
12
- require 'big_keeper/dependency/dep_type'
13
-
14
-
15
- module BigKeeper
16
-
17
- def self.publish(path, user, type)
18
- begin
19
- # Parse Bigkeeper file
20
- BigkeeperParser.parse("#{path}/Bigkeeper")
21
-
22
- branch_name = GitOperator.new.current_branch(path)
23
- Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
24
-
25
- path_modules = ModuleCacheOperator.new(path).current_path_modules
26
- Logger.error("You have unfinished modules #{path_modules}, Use 'finish' first please.") unless path_modules.empty?
27
-
28
- # Push modules changes to remote then rebase
29
- modules = ModuleCacheOperator.new(path).current_git_modules
30
- modules.each do |module_name|
31
- ModuleService.new.pre_publish(path, user, module_name, branch_name, type)
32
- end
33
-
34
- # Install
35
- DepService.dep_operator(path, user).install(modules, OperateType::PUBLISH, false)
36
-
37
- # Modify module as git
38
- modules.each do |module_name|
39
- ModuleService.new.publish(path, user, module_name, branch_name, type)
40
- end
41
-
42
- Logger.highlight("Publish branch '#{branch_name}' for 'Home'")
43
-
44
- # Recover home
45
- DepService.dep_operator(path, user).recover
46
-
47
- # Push home changes to remote
48
- GitService.new.verify_push(path, "publish branch #{branch_name}", branch_name, 'Home')
49
- # Rebase Home
50
- GitService.new.verify_rebase(path, GitflowType.base_branch(type), 'Home')
51
-
52
- `open #{BigkeeperParser.home_pulls()}`
53
- ensure
54
- end
55
- end
56
- end
@@ -1,26 +0,0 @@
1
- require 'big_keeper/util/logger'
2
- require 'big_keeper/util/cache_operator'
3
-
4
- require 'big_keeper/dependency/dep_service'
5
-
6
- module BigKeeper
7
- def self.pull(path, user, type)
8
- begin
9
- # Parse Bigkeeper file
10
- BigkeeperParser.parse("#{path}/Bigkeeper")
11
- branch_name = GitOperator.new.current_branch(path)
12
-
13
- Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
14
-
15
- modules = ModuleCacheOperator.new(path).current_path_modules
16
-
17
- modules.each do |module_name|
18
- ModuleService.new.pull(path, user, module_name, branch_name, type)
19
- end
20
-
21
- Logger.highlight("Pull branch '#{branch_name}' for 'Home'...")
22
- GitOperator.new.pull(path)
23
- ensure
24
- end
25
- end
26
- end
@@ -1,27 +0,0 @@
1
- require 'big_keeper/util/logger'
2
- require 'big_keeper/util/cache_operator'
3
-
4
- require 'big_keeper/dependency/dep_service'
5
-
6
- module BigKeeper
7
-
8
- def self.push(path, user, comment, type)
9
- begin
10
- # Parse Bigkeeper file
11
- BigkeeperParser.parse("#{path}/Bigkeeper")
12
- branch_name = GitOperator.new.current_branch(path)
13
-
14
- Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
15
-
16
- modules = ModuleCacheOperator.new(path).current_path_modules
17
-
18
- modules.each do |module_name|
19
- ModuleService.new.push(path, user, module_name, branch_name, type, comment)
20
- end
21
-
22
- Logger.highlight("Push branch '#{branch_name}' for 'Home'...")
23
- GitService.new.verify_push(path, comment, branch_name, 'Home')
24
- ensure
25
- end
26
- end
27
- end
@@ -1,32 +0,0 @@
1
- require 'big_keeper/util/logger'
2
- require 'big_keeper/util/cache_operator'
3
-
4
- require 'big_keeper/dependency/dep_service'
5
-
6
- module BigKeeper
7
- def self.rebase(path, user, type)
8
- begin
9
- # Parse Bigkeeper file
10
- BigkeeperParser.parse("#{path}/Bigkeeper")
11
- branch_name = GitOperator.new.current_branch(path)
12
-
13
- Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
14
-
15
- modules = ModuleCacheOperator.new(path).current_path_modules
16
-
17
- modules.each do |module_name|
18
- ModuleService.new.rebase(path, user, module_name, branch_name, type)
19
- end
20
-
21
- Logger.highlight("Rebase '#{GitflowType.base_branch(type)}' "\
22
- "to branch '#{branch_name}' for 'Home'...")
23
-
24
- # Rebase Home
25
- Logger.error("You have some changes in branch '#{branch_name}' "\
26
- "for 'Home'. Use 'push' first please") if GitOperator.new.has_changes(path)
27
-
28
- GitService.new.verify_rebase(path, GitflowType.base_branch(type), 'Home')
29
- ensure
30
- end
31
- end
32
- end
@@ -1,74 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- require 'big_keeper/util/podfile_operator'
4
- require 'big_keeper/util/gitflow_operator'
5
- require 'big_keeper/util/bigkeeper_parser'
6
- require 'big_keeper/util/logger'
7
- require 'big_keeper/util/pod_operator'
8
- require 'big_keeper/util/xcode_operator'
9
- require 'big_keeper/util/cache_operator'
10
- require 'big_keeper/model/operate_type'
11
- require 'big_keeper/dependency/dep_service'
12
-
13
- require 'big_keeper/dependency/dep_type'
14
-
15
- require 'big_keeper/service/stash_service'
16
- require 'big_keeper/service/module_service'
17
-
18
-
19
- module BigKeeper
20
- def self.start(path, version, user, name, modules, type)
21
- begin
22
- # Parse Bigkeeper file
23
- BigkeeperParser.parse("#{path}/Bigkeeper")
24
-
25
- version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
26
- full_name = "#{version}_#{user}_#{name}"
27
- branch_name = "#{GitflowType.name(type)}/#{full_name}"
28
-
29
- GitService.new.verify_home_branch(path, branch_name, OperateType::START)
30
-
31
- stash_modules = ModuleCacheOperator.new(path).all_path_modules
32
-
33
- # Stash current branch
34
- StashService.new.stash_all(path, branch_name, user, stash_modules)
35
-
36
- # Verify input modules
37
- modules = BigkeeperParser.verify_modules(modules)
38
-
39
- Logger.highlight("Add branch '#{branch_name}' for 'Home'...")
40
- # Start home feature
41
- GitService.new.start(path, full_name, type)
42
-
43
- # Clean module cache
44
- ModuleCacheOperator.new(path).clean_modules
45
-
46
- # Cache all path modules
47
- ModuleCacheOperator.new(path).cache_path_modules(modules, modules, [])
48
- modules = ModuleCacheOperator.new(path).remain_path_modules
49
-
50
- # Backup home
51
- DepService.dep_operator(path, user).backup
52
-
53
- # Start modules feature and modify module as path
54
- modules.each do |module_name|
55
- ModuleService.new.add(path, user, module_name, full_name, type)
56
- end
57
-
58
- # install
59
- DepService.dep_operator(path, user).install(modules, OperateType::START, true)
60
-
61
- # Open home workspace
62
- DepService.dep_operator(path, user).open
63
-
64
- # Push home changes to remote
65
- Logger.highlight("Push branch '#{branch_name}' for 'Home'...")
66
- GitService.new.verify_push(
67
- path,
68
- "init #{GitflowType.name(type)} #{full_name}",
69
- branch_name,
70
- 'Home')
71
- ensure
72
- end
73
- end
74
- end
@@ -1,46 +0,0 @@
1
- #!/usr/bin/ruby
2
- require 'big_stash/stash_operator'
3
- require 'big_keeper/util/logger'
4
- require 'big_keeper/util/pod_operator'
5
- require 'big_keeper/util/xcode_operator'
6
- require 'big_keeper/model/operate_type'
7
- require 'big_keeper/dependency/dep_service'
8
-
9
- module BigKeeper
10
- def self.switch_to(path, version, user, full_name, type)
11
- begin
12
- # Parse Bigkeeper file
13
- BigkeeperParser.parse("#{path}/Bigkeeper")
14
-
15
- version = BigkeeperParser.version if version == 'Version in Bigkeeper file'
16
- branch_name = "#{GitflowType.name(type)}/#{full_name}"
17
-
18
- GitService.new.verify_home_branch(path, branch_name, OperateType::SWITCH)
19
-
20
- stash_modules = ModuleCacheOperator.new(path).all_path_modules
21
-
22
- # Stash current branch
23
- StashService.new.stash_all(path, branch_name, user, stash_modules)
24
-
25
- # Switch to new feature
26
- GitOperator.new.checkout(path, branch_name)
27
- GitOperator.new.pull(path)
28
-
29
- # Apply home stash
30
- StashService.new.pop_stash(path, branch_name, 'Home')
31
-
32
- modules = ModuleCacheOperator.new(path).all_path_modules
33
-
34
- modules.each do |module_name|
35
- ModuleService.new.switch_to(path, user, module_name, branch_name, type)
36
- end
37
-
38
- # Install
39
- DepService.dep_operator(path, user).install(modules, OperateType::SWITCH, false)
40
-
41
- # Open home workspace
42
- DepService.dep_operator(path, user).open
43
- ensure
44
- end
45
- end
46
- end
@@ -1,66 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- require 'big_keeper/util/podfile_operator'
4
- require 'big_keeper/util/gitflow_operator'
5
- require 'big_keeper/util/bigkeeper_parser'
6
- require 'big_keeper/util/logger'
7
- require 'big_keeper/util/pod_operator'
8
- require 'big_keeper/util/xcode_operator'
9
- require 'big_keeper/util/cache_operator'
10
- require 'big_keeper/model/operate_type'
11
- require 'big_keeper/dependency/dep_service'
12
-
13
- require 'big_keeper/dependency/dep_type'
14
-
15
- require 'big_keeper/service/stash_service'
16
- require 'big_keeper/service/module_service'
17
-
18
-
19
- module BigKeeper
20
- def self.update(path, user, modules, type)
21
- begin
22
- # Parse Bigkeeper file
23
- BigkeeperParser.parse("#{path}/Bigkeeper")
24
- branch_name = GitOperator.new.current_branch(path)
25
-
26
- Logger.error("Not a #{GitflowType.name(type)} branch, exit.") unless branch_name.include? GitflowType.name(type)
27
-
28
- full_name = branch_name.gsub(/#{GitflowType.name(type)}\//, '')
29
-
30
- current_modules = ModuleCacheOperator.new(path).current_path_modules
31
-
32
- # Verify input modules
33
- modules = BigkeeperParser.verify_modules(modules)
34
-
35
- Logger.highlight("Start to update modules for branch '#{branch_name}'...")
36
-
37
- add_modules = modules - current_modules
38
- del_modules = current_modules - modules
39
-
40
- # Clean module cache
41
- ModuleCacheOperator.new(path).clean_modules
42
- ModuleCacheOperator.new(path).cache_path_modules(modules, add_modules, del_modules)
43
- remain_path_modules = ModuleCacheOperator.new(path).remain_path_modules
44
-
45
- if add_modules.empty? and del_modules.empty?
46
- Logger.default("There is nothing changed with modules #{modules}.")
47
- else
48
- # Modify podfile as path and Start modules feature
49
- remain_path_modules.each do |module_name|
50
- ModuleService.new.add(path, user, module_name, full_name, type)
51
- end
52
-
53
- del_modules.each do |module_name|
54
- ModuleService.new.del(path, user, module_name, full_name, type)
55
- end
56
- end
57
-
58
- # Install
59
- DepService.dep_operator(path, user).install(modules, OperateType::UPDATE, false)
60
-
61
- # Open home workspace
62
- DepService.dep_operator(path, user).open
63
- ensure
64
- end
65
- end
66
- end
@@ -1,167 +0,0 @@
1
- require 'big_keeper/command/feature&hotfix/start'
2
- require 'big_keeper/command/feature&hotfix/finish'
3
- require 'big_keeper/command/feature&hotfix/switch'
4
- require 'big_keeper/command/feature&hotfix/update'
5
- require 'big_keeper/command/feature&hotfix/pull'
6
- require 'big_keeper/command/feature&hotfix/push'
7
- require 'big_keeper/command/feature&hotfix/rebase'
8
- require 'big_keeper/command/feature&hotfix/publish'
9
- require 'big_keeper/command/feature&hotfix/delete'
10
- require 'big_keeper/command/feature&hotfix/list'
11
- require 'big_keeper/util/leancloud_logger'
12
-
13
- module BigKeeper
14
- def self.feature_and_hotfix_command(type)
15
- desc "Gitflow #{GitflowType.name(type)} operations"
16
- command GitflowType.command(type) do |c|
17
- c.desc "Start a new #{GitflowType.name(type)} with name for given modules and main project"
18
- c.command :start do |start|
19
- start.action do |global_options, options, args|
20
- path = File.expand_path(global_options[:path])
21
- version = global_options[:ver]
22
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
23
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/start")
24
-
25
- help_now!('user name is required') if user and user.empty?
26
- help_now!("#{GitflowType.name(type)} name is required") if args.length < 1
27
- name = args[0]
28
- modules = args[(1...args.length)] if args.length > 1
29
- start(path, version, user, name, modules, type)
30
- end
31
- end
32
-
33
- c.desc "Update modules for the #{GitflowType.name(type)} with name"
34
- c.command :update do |update|
35
- update.action do |global_options, options, args|
36
- path = File.expand_path(global_options[:path])
37
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
38
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/update")
39
-
40
- help_now!('user name is required') if user and user.empty?
41
- modules = args[(0...args.length)] if args.length > 0
42
- update(path, user, modules, type)
43
- end
44
- end
45
-
46
- c.desc "Switch to the #{GitflowType.name(type)} with name"
47
- c.command :switch do |switch|
48
- switch.action do |global_options, options, args|
49
- path = File.expand_path(global_options[:path])
50
- version = global_options[:ver]
51
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
52
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/switch")
53
-
54
- help_now!('user name is required') if user and user.empty?
55
- help_now!("#{GitflowType.name(type)} name is required") if args.length < 1
56
- name = args[0]
57
- switch_to(path, version, user, name, type)
58
- end
59
- end
60
-
61
- c.desc "Pull remote changes for current #{GitflowType.name(type)}"
62
- c.command :pull do |pull|
63
- pull.action do |global_options, options, args|
64
- path = File.expand_path(global_options[:path])
65
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
66
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/pull")
67
-
68
- help_now!('user name is required') if user and user.empty?
69
- pull(path, user, type)
70
- end
71
- end
72
-
73
- c.desc "Push local changes to remote for current #{GitflowType.name(type)}"
74
- c.command :push do |push|
75
- push.action do |global_options, options, args|
76
- path = File.expand_path(global_options[:path])
77
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
78
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/push")
79
-
80
- help_now!('user name is required') if user and user.empty?
81
- help_now!('comment message is required') if args.length < 1
82
- help_now!(%Q(comment message should be wrappered with '' or "")) if args.length > 1
83
- comment = args[0]
84
- push(path, user, comment, type)
85
- end
86
- end
87
-
88
- c.desc "Rebase '#{GitflowType.base_branch(type)}' to current #{GitflowType.name(type)}"
89
- c.command :rebase do |rebase|
90
- rebase.action do |global_options, options, args|
91
- path = File.expand_path(global_options[:path])
92
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
93
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/rebase")
94
-
95
- help_now!('user name is required') if user and user.empty?
96
- rebase(path, user, type)
97
- end
98
- end
99
-
100
- c.desc "Finish current #{GitflowType.name(type)}"
101
- c.command :finish do |finish|
102
- finish.action do |global_options, options, args|
103
- path = File.expand_path(global_options[:path])
104
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
105
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/finish")
106
-
107
- help_now!('user name is required') if user and user.empty?
108
- finish(path, user, type)
109
- end
110
- end
111
-
112
- c.desc "Publish current #{GitflowType.name(type)}"
113
- c.command :publish do |publish|
114
- publish.action do |global_options, options, args|
115
- path = File.expand_path(global_options[:path])
116
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
117
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/publish")
118
-
119
- help_now!('user name is required') if user and user.empty?
120
- publish(path, user, type)
121
- end
122
- end
123
-
124
- c.desc "Delete #{GitflowType.name(type)} with name"
125
- c.command :delete do |delete|
126
- delete.action do |global_options, options, args|
127
- path = File.expand_path(global_options[:path])
128
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
129
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/delete")
130
-
131
- help_now!('user name is required') if user and user.empty?
132
- help_now!("#{GitflowType.name(type)} name is required") if args.length < 1
133
- name = args[0]
134
- delete(path, user, name, type)
135
- end
136
- end
137
-
138
- c.desc "List all the #{GitflowType.name(type)}s"
139
- c.command :list do |list|
140
- list.flag %i[v version] , default_value: 'all versions'
141
- list.desc "Print list of TREE format."
142
- list.command :tree do |tree|
143
- tree.action do |global_options, options, args|
144
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/list/tree")
145
-
146
- Logger.highlight("Generating #{GitflowType.name(type)} tree of all version...") if args.length < 1
147
- path = File.expand_path(global_options[:path])
148
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
149
- list(path, user, type, options)
150
- end
151
- end
152
-
153
- list.desc "Print list of JSON format."
154
- list.command :json do |json|
155
- json.action do |global_options, options, args|
156
- LeanCloudLogger.instance.set_command("#{GitflowType.command(type)}/list/json")
157
-
158
- options[:json] = true
159
- path = File.expand_path(global_options[:path])
160
- user = global_options[:user].gsub(/[^0-9A-Za-z]/, '').downcase
161
- list(path, user, type, options)
162
- end
163
- end
164
- end
165
- end
166
- end
167
- end
File without changes