big_keeper 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +50 -0
  3. data/Gemfile +6 -0
  4. data/Gemfile.lock +106 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +41 -0
  7. data/Rakefile +2 -0
  8. data/big_keeper.gemspec +40 -0
  9. data/bin/big-keeper +14 -0
  10. data/bin/setup +8 -0
  11. data/docs/en-US/FEATURE.md +0 -0
  12. data/docs/zh-CN/BIGKEEPER_FILE.md +62 -0
  13. data/docs/zh-CN/FEATURE.md +88 -0
  14. data/docs/zh-CN/README.md +76 -0
  15. data/lib/big_keeper/command/feature_finish.rb +47 -0
  16. data/lib/big_keeper/command/feature_pull.rb +23 -0
  17. data/lib/big_keeper/command/feature_push.rb +39 -0
  18. data/lib/big_keeper/command/feature_start.rb +60 -0
  19. data/lib/big_keeper/command/feature_switch.rb +43 -0
  20. data/lib/big_keeper/command/feature_update.rb +60 -0
  21. data/lib/big_keeper/command/hotfix_start.rb +0 -0
  22. data/lib/big_keeper/command/podfile_lock.rb +16 -0
  23. data/lib/big_keeper/command/release_home.rb +51 -0
  24. data/lib/big_keeper/command/release_module.rb +27 -0
  25. data/lib/big_keeper/command/start_module_release.sh +44 -0
  26. data/lib/big_keeper/model/gitflow_type.rb +19 -0
  27. data/lib/big_keeper/model/operate_type.rb +19 -0
  28. data/lib/big_keeper/model/podfile_type.rb +44 -0
  29. data/lib/big_keeper/service/git_service.rb +75 -0
  30. data/lib/big_keeper/service/module_service.rb +90 -0
  31. data/lib/big_keeper/service/stash_service.rb +42 -0
  32. data/lib/big_keeper/util/bigkeeper_parser.rb +167 -0
  33. data/lib/big_keeper/util/git_operator.rb +95 -0
  34. data/lib/big_keeper/util/gitflow_operator.rb +40 -0
  35. data/lib/big_keeper/util/info_plist_operator.rb +46 -0
  36. data/lib/big_keeper/util/podfile_detector.rb +140 -0
  37. data/lib/big_keeper/util/podfile_operator.rb +111 -0
  38. data/lib/big_keeper/version.rb +3 -0
  39. data/lib/big_keeper.rb +151 -0
  40. data/resources/readme/big-keeper-readme.001.png +0 -0
  41. data/resources/readme/big-keeper-readme.002.png +0 -0
  42. data/resources/readme/big-keeper-readme.003.png +0 -0
  43. data/resources/readme/big-keeper-readme.004.png +0 -0
  44. data/resources/readme/big-keeper-readme.005.png +0 -0
  45. data/resources/readme/big-keeper-readme.006.png +0 -0
  46. data/resources/readme/big-keeper-readme.007.png +0 -0
  47. metadata +191 -0
data/lib/big_keeper.rb ADDED
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'big_keeper/version'
4
+
5
+ require 'big_keeper/util/bigkeeper_parser'
6
+ require 'big_keeper/util/git_operator'
7
+
8
+ require 'big_keeper/model/gitflow_type'
9
+
10
+ require 'big_keeper/command/feature_start'
11
+ require 'big_keeper/command/feature_finish'
12
+ require 'big_keeper/command/feature_switch'
13
+ require 'big_keeper/command/feature_update'
14
+ require 'big_keeper/command/feature_pull'
15
+ require 'big_keeper/command/feature_push'
16
+ require 'big_keeper/command/release_home'
17
+ require 'big_keeper/command/release_module'
18
+
19
+ require 'big_keeper/service/git_service'
20
+
21
+ require 'gli'
22
+
23
+ include GLI::App
24
+
25
+ module BigKeeper
26
+ # Your code goes here...
27
+ program_desc 'Efficiency improvement for iOS modular development, iOSer using this tool can make modular development easier.'
28
+
29
+ flag %i[p path], default_value: './'
30
+ flag %i[v ver], default_value: 'Version in Bigkeeper file'
31
+
32
+ path = ''
33
+ version = ''
34
+
35
+ pre do |global_options, _command, options, args|
36
+ path = File.expand_path(global_options[:path])
37
+ version = global_options[:ver]
38
+ end
39
+
40
+ desc 'Feature operations'
41
+ command :feature do |c|
42
+
43
+ c.flag %i[u user], default_value: GitOperator.new.user
44
+ user = GitOperator.new.user
45
+ c.pre do |global_options, _command, options, args|
46
+ user = global_options[:user]
47
+ end
48
+
49
+ c.desc 'Start a new feature with name for given modules and main project'
50
+ c.command :start do |start|
51
+ start.action do |global_options, options, args|
52
+ help_now!('feature name is required') if args.length < 1
53
+ name = args[0]
54
+ modules = args[(1...args.length)] if args.length > 1
55
+ feature_start(path, version, user, name, modules)
56
+ end
57
+ end
58
+
59
+ c.desc 'Update moduels for the feature with name'
60
+ c.command :update do |update|
61
+ update.action do |global_options, options, args|
62
+ modules = args[(0...args.length)] if args.length > 0
63
+ feature_update(path, user, modules)
64
+ end
65
+ end
66
+
67
+ c.desc 'Switch to the feature with name'
68
+ c.command :switch do |switch|
69
+ switch.action do |global_options, options, args|
70
+ help_now!('feature name is required') if args.length < 1
71
+ name = args[0]
72
+ feature_switch(path, version, user, name)
73
+ end
74
+ end
75
+
76
+ c.desc 'Pull remote changes for current feature'
77
+ c.command :pull do |pull|
78
+ pull.action do |global_options, options, args|
79
+ feature_pull(path, user)
80
+ end
81
+ end
82
+
83
+ c.desc 'Push local changes to remote for current feature'
84
+ c.command :push do |push|
85
+ push.action do |global_options, options, args|
86
+ help_now!('comment message is required') if args.length < 1
87
+ comment = args[0]
88
+ feature_push(path, user, comment)
89
+ end
90
+ end
91
+
92
+ c.desc 'Finish current feature'
93
+ c.command :finish do |finish|
94
+ finish.action do |global_options, options, args|
95
+ feature_finish(path, user)
96
+ end
97
+ end
98
+
99
+ c.desc 'List all the features'
100
+ c.command :list do |list|
101
+ list.action do
102
+ branchs = GitService.new.branchs_with_type(File.expand_path(path), GitflowType::FEATURE)
103
+ branchs.each do |branch|
104
+ p branch
105
+ end
106
+ end
107
+ end
108
+ end
109
+
110
+ desc 'Release operations'
111
+ command :release do |c|
112
+
113
+ c.flag %i[u user], default_value: GitOperator.new.user
114
+ user = GitOperator.new.user
115
+ c.pre do |global_options, _command, options, args|
116
+ user = global_options[:user]
117
+ end
118
+
119
+ c.desc 'Release home project operations'
120
+ c.command :home do |home|
121
+ home.desc 'Start release home project'
122
+ home.command :start do |start|
123
+ start.action do |global_options, options, args|
124
+ # path(optional): path of the Bigkeeper file in project
125
+ # version(optional): if null, will read verson in Bigkeeper file
126
+ # e.g: ruby big_keeper.rb -p /Users/SFM/Downloads/BigKeeperMain-master
127
+ # /Bigkeeper -v 3.0.0 release home start
128
+ release_home_start(path, version, user)
129
+ end
130
+ end
131
+
132
+ home.desc 'Finish release home project'
133
+ home.command :finish do |finish|
134
+ finish.action do |global_options, options, args|
135
+ release_home_finish(path, version)
136
+ end
137
+ end
138
+
139
+ home.desc 'Start release module'
140
+ home.command :module do |finish|
141
+ finish.action do |global_options, options, args|
142
+ help_now!('module name is required') if args.length != 1
143
+ module_name = args[0]
144
+ start_module_release(path, module_name)
145
+ end
146
+ end
147
+ end
148
+ end
149
+
150
+ exit run(ARGV)
151
+ end
metadata ADDED
@@ -0,0 +1,191 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: big_keeper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - mmoaay
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-11-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: gli
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.16'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.16'
55
+ - !ruby/object:Gem::Dependency
56
+ name: big_stash
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: cocoapods
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: plist
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.50.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 0.50.0
111
+ description: Efficiency improvement for iOS modular development, iOSer using this
112
+ tool can make modular development easier.
113
+ email:
114
+ - mmoaay@sina.com
115
+ executables:
116
+ - big-keeper
117
+ - setup
118
+ extensions: []
119
+ extra_rdoc_files: []
120
+ files:
121
+ - ".gitignore"
122
+ - Gemfile
123
+ - Gemfile.lock
124
+ - LICENSE.txt
125
+ - README.md
126
+ - Rakefile
127
+ - big_keeper.gemspec
128
+ - bin/big-keeper
129
+ - bin/setup
130
+ - docs/en-US/FEATURE.md
131
+ - docs/zh-CN/BIGKEEPER_FILE.md
132
+ - docs/zh-CN/FEATURE.md
133
+ - docs/zh-CN/README.md
134
+ - lib/big_keeper.rb
135
+ - lib/big_keeper/command/feature_finish.rb
136
+ - lib/big_keeper/command/feature_pull.rb
137
+ - lib/big_keeper/command/feature_push.rb
138
+ - lib/big_keeper/command/feature_start.rb
139
+ - lib/big_keeper/command/feature_switch.rb
140
+ - lib/big_keeper/command/feature_update.rb
141
+ - lib/big_keeper/command/hotfix_start.rb
142
+ - lib/big_keeper/command/podfile_lock.rb
143
+ - lib/big_keeper/command/release_home.rb
144
+ - lib/big_keeper/command/release_module.rb
145
+ - lib/big_keeper/command/start_module_release.sh
146
+ - lib/big_keeper/model/gitflow_type.rb
147
+ - lib/big_keeper/model/operate_type.rb
148
+ - lib/big_keeper/model/podfile_type.rb
149
+ - lib/big_keeper/service/git_service.rb
150
+ - lib/big_keeper/service/module_service.rb
151
+ - lib/big_keeper/service/stash_service.rb
152
+ - lib/big_keeper/util/bigkeeper_parser.rb
153
+ - lib/big_keeper/util/git_operator.rb
154
+ - lib/big_keeper/util/gitflow_operator.rb
155
+ - lib/big_keeper/util/info_plist_operator.rb
156
+ - lib/big_keeper/util/podfile_detector.rb
157
+ - lib/big_keeper/util/podfile_operator.rb
158
+ - lib/big_keeper/version.rb
159
+ - resources/readme/big-keeper-readme.001.png
160
+ - resources/readme/big-keeper-readme.002.png
161
+ - resources/readme/big-keeper-readme.003.png
162
+ - resources/readme/big-keeper-readme.004.png
163
+ - resources/readme/big-keeper-readme.005.png
164
+ - resources/readme/big-keeper-readme.006.png
165
+ - resources/readme/big-keeper-readme.007.png
166
+ homepage: https://github.com/BigKeeper/big-keeper
167
+ licenses:
168
+ - MIT
169
+ metadata:
170
+ allowed_push_host: https://rubygems.org
171
+ post_install_message:
172
+ rdoc_options: []
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ requirements: []
186
+ rubyforge_project:
187
+ rubygems_version: 2.5.1
188
+ signing_key:
189
+ specification_version: 4
190
+ summary: Efficiency improvement for iOS modular development.
191
+ test_files: []