brightpearl-cli 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -13
  2. data/bin/bp +1 -1
  3. data/bin/brightpearl +1 -1
  4. data/lib/brightpearl_cli.rb +161 -168
  5. data/lib/core/api.rb +1 -1
  6. data/lib/core/config.rb +10 -133
  7. data/lib/core/config_unique.rb +113 -0
  8. data/lib/core/encrypter.rb +6 -6
  9. data/lib/core/enums.rb +1 -1
  10. data/lib/core/git.rb +123 -108
  11. data/lib/core/git_delete.rb +89 -0
  12. data/lib/core/jira.rb +2 -2
  13. data/lib/core/mysql.rb +14 -14
  14. data/lib/core/pom.rb +129 -0
  15. data/lib/core/terminal.rb +28 -8
  16. data/lib/core/tools.rb +6 -6
  17. data/lib/core/utils_files.rb +92 -0
  18. data/lib/core/utils_routes.rb +25 -0
  19. data/lib/core/utils_strings.rb +45 -0
  20. data/lib/core/validate.rb +1 -1
  21. data/lib/routes/build.rb +16 -17
  22. data/lib/routes/dummy_order.rb +5 -5
  23. data/lib/routes/fix.rb +49 -0
  24. data/lib/routes/git_branch.rb +6 -6
  25. data/lib/routes/git_checkout.rb +42 -33
  26. data/lib/routes/git_delete.rb +8 -62
  27. data/lib/routes/git_merge.rb +198 -111
  28. data/lib/routes/git_pull.rb +11 -11
  29. data/lib/routes/git_push.rb +21 -12
  30. data/lib/routes/git_stash.rb +13 -8
  31. data/lib/routes/git_update.rb +17 -22
  32. data/lib/routes/jira.rb +3 -3
  33. data/lib/routes/production_logs.rb +12 -12
  34. data/lib/routes/reset.rb +1 -1
  35. data/lib/routes/review.rb +6 -5
  36. data/lib/routes/scripts_api_docs.rb +5 -5
  37. data/lib/routes/scripts_branch_cleaner.rb +58 -79
  38. data/lib/routes/scripts_color.rb +1 -1
  39. data/lib/routes/scripts_pom_fixer.rb +5 -62
  40. data/lib/routes/scripts_sonar.rb +82 -0
  41. data/lib/routes/setup.rb +6 -6
  42. data/lib/routes/tail.rb +5 -5
  43. data/lib/routes/test.rb +3 -3
  44. data/lib/routes/update.rb +1 -1
  45. metadata +16 -9
  46. data/lib/routes/scripts_code_sniffer.rb +0 -36
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MDFiZjAwM2JmOGQ3ODg3NGU2YjBiYzgwZDhjY2NmMDNkOWNmYmNjMg==
5
- data.tar.gz: !binary |-
6
- NTUyYTc5NjU3OWM4M2ZlYmI3MjZlMDRlZGFhNTQ2M2UyZWFiZTBjOQ==
2
+ SHA1:
3
+ metadata.gz: 7e62f96bd62e33c685f380440bb83e2e3084dd7e
4
+ data.tar.gz: 27121619a930fdd47a75bc3c6a0795eafbd15a50
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MDIxZjU2ZjRhZGMwOGVmNTU5NzU1YjM1NmExNjhjZjY1MTdhZDYzNGE3NGQx
10
- MTY5YzNjZjg5YjcyM2NlZGNjOGU2ODdkMDgyZGE1YzZjODE3ZWZiNDk1ZWE4
11
- MWIwNzM4NzdjOGZiMDhkZGJhOGVjM2ZlMjk0OTBiZDY3YmY5NmE=
12
- data.tar.gz: !binary |-
13
- NzhjYmM3MjM2OTE2Nzg0MDllYzAzMTU3YTg0ZWFjMWE3MjQ2OWVlZjA3OTM5
14
- ODljZjJjOTQwYjcyODhhYmExZDE3MTM4ZjU5YmNiMWQxMDg4NTA4MmE5MmQ0
15
- Y2ExNmM4NmMwNGQyYzJlNjQ3YzA5ZDNlZDNlYmZhYTRiZTVkNjI=
6
+ metadata.gz: cf9c73d3b135654e023487b8ad0981075348701406e29b59d0b657c01f539e863c0e42faeb9b4e00b381b8e4ae5d46358c42325b7b5b916fe121cf739551b7ca
7
+ data.tar.gz: 8c7579a8bba1cfdf2cc505f78d62363bb05eaac2ea449291fb52711999f1207ef6004817fe8c6fdade54e6c24f89ffa2bd362043c7c02b87f6e4de4e7e1df5b9
data/bin/bp CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'brightpearl_cli'
4
4
 
5
- Brightpearl::execute
5
+ App::execute
data/bin/brightpearl CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  require 'brightpearl_cli'
4
4
 
5
- Brightpearl::execute
5
+ App::execute
@@ -2,17 +2,23 @@ require 'convoy'
2
2
  require 'yaml'
3
3
 
4
4
  require 'core/api'
5
- require 'core/config'
6
- require 'core/encrypter'
5
+ require 'core/config_unique'
7
6
  require 'core/enums'
8
7
  require 'core/git'
8
+ require 'core/git_delete'
9
9
  require 'core/jira'
10
10
  require 'core/mysql'
11
- require 'core/terminal'
11
+ require 'core/pom'
12
12
  require 'core/tools'
13
13
  require 'core/validate'
14
+
15
+ require 'core/config'
16
+ require 'core/encrypter'
17
+ require 'core/terminal'
18
+
14
19
  require 'routes/build'
15
20
  require 'routes/dummy_order'
21
+ require 'routes/fix'
16
22
  require 'routes/git_branch'
17
23
  require 'routes/git_checkout'
18
24
  require 'routes/git_delete'
@@ -27,7 +33,7 @@ require 'routes/reset'
27
33
  require 'routes/review'
28
34
  require 'routes/scripts_api_docs'
29
35
  require 'routes/scripts_branch_cleaner'
30
- require 'routes/scripts_code_sniffer'
36
+ require 'routes/scripts_sonar'
31
37
  require 'routes/scripts_color'
32
38
  require 'routes/scripts_pom_fixer'
33
39
  require 'routes/setup'
@@ -35,14 +41,14 @@ require 'routes/update'
35
41
  require 'routes/tail'
36
42
  require 'routes/test'
37
43
 
38
- module Brightpearl
44
+ module App
39
45
 
40
46
  def self.execute
41
47
 
42
48
  begin
43
49
 
44
50
  unless !ARGV.any? || ARGV[0] == 'setup' || ARGV[0] == 'x'
45
- Brightpearl::Config.initialize
51
+ App::Config.initialize
46
52
  end
47
53
 
48
54
  Convoy::App.create do |brightpearl|
@@ -50,58 +56,62 @@ module Brightpearl
50
56
  # COLOR OF TITLE TEXT
51
57
  title_color = 255
52
58
 
53
- # TRUE/FALSE DEPENDING ON WHETHER USER IN ON BETA OR NOT.
54
- beta_only = Brightpearl::Config.param(Brightpearl::Config::BETA) == 'true' ? true : false
55
-
56
- brightpearl.version '1.3.0'
59
+ brightpearl.version '1.4.0'
57
60
  brightpearl.summary "\x1B[38;5;166mBRIGHTPEARL-CLI\x1B[0m \x1B[38;5;240m\xe2\x80\x94 BETA\x1B[0m"
58
- brightpearl.description "\x1B[38;5;#{title_color}mA command line utility for Brightpearl developers and QAs.\nUsed for automating daily work flows & completing repetitive tasks quicker with less errors.\nDesigned to work from anywhere on your workstation.\n\nUse #{Brightpearl::Terminal::format_command('brightpearl')}\x1B[38;5;#{title_color}m or #{Brightpearl::Terminal::format_command('bp')}\x1B[38;5;#{title_color}m to run.\x1B[0m"
59
-
60
- if beta_only
61
-
62
- # BUILD
63
- brightpearl.command :build, :aliases => [:b] do |build|
64
- build.summary 'Build (and deploy) Java services'
65
- build.options do |opts|
66
- opts.opt :serviceOnly, 'Build service only (default)', :short => '-s', :long => '--service-only', :type => :boolean
67
- opts.opt :apiOnly, 'Build API only', :short => '-a', :long => '--api-only', :type => :boolean
68
- opts.opt :both, 'Build both', :short => '-b', :long => '--both', :type => :boolean
69
- opts.opt :deploy, 'Deploy to SkyFactory', :short => '-d', :long => '--deploy', :type => :boolean
70
- end
71
- build.action do |opts, args|
72
- BrightpearlCommand::Build.new(opts, args).execute
73
- end
61
+ brightpearl.description "\x1B[38;5;#{title_color}mA command line utility for Brightpearl developers and QAs.\nUsed for automating daily work flows & completing repetitive tasks quicker with less errors.\nDesigned to work from anywhere on your workstation.\n\nUse #{App::Terminal::format_command('brightpearl')}\x1B[38;5;#{title_color}m or #{App::Terminal::format_command('bp')}\x1B[38;5;#{title_color}m to run.\x1B[0m"
62
+
63
+ # BUILD
64
+ brightpearl.command :build, :aliases => [:b] do |build|
65
+ build.summary 'Build (and deploy) Java services'
66
+ build.options do |opts|
67
+ opts.opt :serviceOnly, 'Build service only (default)', :short => '-s', :long => '--service-only', :type => :boolean
68
+ opts.opt :apiOnly, 'Build API only', :short => '-a', :long => '--api-only', :type => :boolean
69
+ opts.opt :both, 'Build both', :short => '-b', :long => '--both', :type => :boolean
70
+ opts.opt :deploy, 'Deploy to SkyFactory', :short => '-d', :long => '--deploy', :type => :boolean
71
+ end
72
+ build.action do |opts, args|
73
+ AppCommand::Build.new(opts, args).execute
74
74
  end
75
+ end
75
76
 
76
- # DUMMY
77
- brightpearl.command :dummy, :aliases => [:d] do |dummy|
78
-
79
- dummy.summary 'Insert dummy data into the App'
80
-
81
- # DUMMY ORDER
82
- dummy.command :order, :aliases => [:o] do |dummy_order|
83
- dummy_order.summary 'Create dummy orders'
84
- dummy_order.options do |opts|
85
- opts.opt :salesOrder, 'Create sales order', :short => '-s', :long => '--sales-order', :type => :boolean
86
- opts.opt :salesCredit, 'Create sales credit', :short => '-S', :long => '--sales-credit', :type => :boolean
87
- opts.opt :purchaseOrder, 'Create purchase order', :short => '-p', :long => '--purchase-order', :type => :boolean
88
- opts.opt :purchaseCredit, 'Create purchase credit', :short => '-P', :long => '--purchase-credit', :type => :boolean
89
- opts.opt :times, 'Specify number of orders (maximum 50)', :short => '-x', :long => '--times', :type => :int
90
- end
91
- dummy_order.action do |opts, args|
92
- BrightpearlCommand::DummyOrder.new(opts, args).execute
93
- end
94
- end
77
+ # DUMMY
78
+ brightpearl.command :dummy, :aliases => [:d] do |dummy|
79
+
80
+ dummy.summary 'Insert dummy data into the App'
95
81
 
96
- # CREATE (DEFAULT)
97
- dummy.action do
98
- system('bp d -h')
82
+ # DUMMY ORDER
83
+ dummy.command :order, :aliases => [:o] do |dummy_order|
84
+ dummy_order.summary 'Create dummy orders'
85
+ dummy_order.options do |opts|
86
+ opts.opt :salesOrder, 'Create sales order', :short => '-s', :long => '--sales-order', :type => :boolean
87
+ opts.opt :salesCredit, 'Create sales credit', :short => '-S', :long => '--sales-credit', :type => :boolean
88
+ opts.opt :purchaseOrder, 'Create purchase order', :short => '-p', :long => '--purchase-order', :type => :boolean
89
+ opts.opt :purchaseCredit, 'Create purchase credit', :short => '-P', :long => '--purchase-credit', :type => :boolean
90
+ opts.opt :times, 'Specify number of orders (maximum 50)', :short => '-x', :long => '--times', :type => :int
99
91
  end
92
+ dummy_order.action do |opts, args|
93
+ AppCommand::DummyOrder.new(opts, args).execute
94
+ end
95
+ end
100
96
 
97
+ # CREATE (DEFAULT)
98
+ dummy.action do
99
+ system('bp d -h')
101
100
  end
102
101
 
103
102
  end
104
103
 
104
+ # FIX
105
+ brightpearl.command :fix, :aliases => [:f] do |fix|
106
+ fix.summary 'Quick fixes for common problems'
107
+ fix.options do |opts|
108
+ opts.opt :clear_sessions, 'Clear sessions (to fix login problem)', :short => '-1', :long => '--clear-sessions', :type => :boolean
109
+ end
110
+ fix.action do |opts, args|
111
+ AppCommand::Fix.new(opts, args).execute
112
+ end
113
+ end
114
+
105
115
  # GIT
106
116
 
107
117
  brightpearl.command :git, :aliases => [:g] do |git|
@@ -119,12 +129,12 @@ module Brightpearl
119
129
  opts.opt :detailed, 'Show a more detailed output w/Jira data, etc. (takes longer)', :short => '-D', :long => '--detailed', :type => :boolean
120
130
  end
121
131
  git_branch.action do |opts, args|
122
- BrightpearlCommand::GitBranch.new(opts, args).execute
132
+ AppCommand::GitBranch.new(opts, args).execute
123
133
  end
124
134
  end
125
135
 
126
136
  # GIT CHECKOUT
127
- git.command :checkout, :aliases => [:c] do |git_checkout|
137
+ git.command :checkout, :aliases => [:c, :co] do |git_checkout|
128
138
  git_checkout.summary 'Create & checkout branches'
129
139
  git_checkout.options do |opts|
130
140
  opts.opt :branch, 'Create a branch locally', :short => '-b', :long => '--branch', :type => :boolean
@@ -133,7 +143,7 @@ module Brightpearl
133
143
  opts.opt :updatePush, 'Same as --update but will also push to origin', :short => '-U', :long => '--update-push', :type => :boolean
134
144
  end
135
145
  git_checkout.action do |opts, args|
136
- BrightpearlCommand::GitCheckout.new(opts, args).execute
146
+ AppCommand::GitCheckout.new(opts, args).execute
137
147
  end
138
148
  end
139
149
 
@@ -146,43 +156,43 @@ module Brightpearl
146
156
  opts.opt :delete_both, 'Delete both local & remote branches', :short => '-b', :long => '--delete-both', :type => :boolean
147
157
  end
148
158
  git_delete.action do |opts, args|
149
- BrightpearlCommand::GitDelete.new(opts, args).execute
159
+ AppCommand::GitDelete.new(opts, args).execute
150
160
  end
151
161
  end
152
162
 
153
163
  # GIT MERGE
154
164
  git.command :merge, :aliases => [:m] do |git_merge|
155
165
  git_merge.summary 'Merge branch(es)'
156
- d = "Accepts one #{Brightpearl::Terminal::format_action('mandatory')} primary argument \xe2\x80\x94 the name of the source branch."
157
- d << "\nAccepts one #{Brightpearl::Terminal::format_action('optional')} secondary argument \xe2\x80\x94 the name of the target branch."
166
+ d = "Accepts one #{App::Terminal::format_action('mandatory')} primary argument \xe2\x80\x94 the name of the source branch."
167
+ d << "\nAccepts one #{App::Terminal::format_action('optional')} secondary argument \xe2\x80\x94 the name of the target branch."
158
168
  d << "\n"
159
- d << "\nIf no secondary argument is given, target branch will be #{Brightpearl::Terminal::format_branch('current-branch')}"
169
+ d << "\nIf no secondary argument is given, target branch will be #{App::Terminal::format_branch('current-branch')}"
160
170
  d << "\n"
161
- d << "\n #{Brightpearl::Terminal::format_command('bp g m source_branch')} \x1B[0m"
162
- d << "\n #{Brightpearl::Terminal::format_command('bp g m source_branch target_branch')} \x1B[0m"
171
+ d << "\n #{App::Terminal::format_command('bp g m source_branch')} \x1B[0m"
172
+ d << "\n #{App::Terminal::format_command('bp g m source_branch target_branch')} \x1B[0m"
163
173
  d << "\n"
164
174
  d << "\nTo merge multiple branches use a comma-separated string (without spaces):"
165
175
  d << "\n"
166
- d << "\n #{Brightpearl::Terminal::format_command('bp g m sb1,sb2,sb3')}"
167
- d << "\n #{Brightpearl::Terminal::format_command('bp g m sb1,sb2,sb3 target_branch')}"
176
+ d << "\n #{App::Terminal::format_command('bp g m sb1,sb2,sb3')}"
177
+ d << "\n #{App::Terminal::format_command('bp g m sb1,sb2,sb3 target_branch')}"
168
178
  d << "\n"
169
- d << "\nAlternatively, use the #{Brightpearl::Terminal::format_flag('o', false)} and #{Brightpearl::Terminal::format_flag('f', false)} flags to specify your source branches using a temporary file:"
179
+ d << "\nAlternatively, use the #{App::Terminal::format_flag('o', false)} and #{App::Terminal::format_flag('f', false)} flags to specify your source branches using a temporary file:"
170
180
  d << "\n"
171
- d << "\n #{Brightpearl::Terminal::format_flag('o', false)} opens #{Brightpearl::Terminal::format_directory(Brightpearl::Enum::GIT_MERGE_DEFAULT_FILE)}"
172
- d << "\n #{Brightpearl::Terminal::format_flag('f', false)} parses the contents of #{Brightpearl::Terminal::format_directory(Brightpearl::Enum::GIT_MERGE_DEFAULT_FILE)} as source branches (one branch per line)"
181
+ d << "\n #{App::Terminal::format_flag('o', false)} opens #{App::Terminal::format_directory(App::Enum::GIT_MERGE_DEFAULT_FILE)}"
182
+ d << "\n #{App::Terminal::format_flag('f', false)} parses the contents of #{App::Terminal::format_directory(App::Enum::GIT_MERGE_DEFAULT_FILE)} as source branches (one branch per line)"
173
183
  d << "\n"
174
- d << "\n #{Brightpearl::Terminal::format_command('bp g m -o')} \x1B[0m"
175
- d << "\n #{Brightpearl::Terminal::format_command('bp g m -f')} \x1B[0m"
176
- d << "\n #{Brightpearl::Terminal::format_command('bp g m -f target_branch')} \x1B[0m"
184
+ d << "\n #{App::Terminal::format_command('bp g m -o')} \x1B[0m"
185
+ d << "\n #{App::Terminal::format_command('bp g m -f')} \x1B[0m"
186
+ d << "\n #{App::Terminal::format_command('bp g m -f target_branch')} \x1B[0m"
177
187
  git_merge.description d
178
188
  git_merge.options do |opts|
179
- opts.opt :open_file, "Creates (and opens) #{Brightpearl::Terminal::format_directory(Brightpearl::Enum::GIT_MERGE_DEFAULT_FILE)}", :short => '-o', :long => '--open-file', :type => :boolean
189
+ opts.opt :open_file, "Creates (and opens) #{App::Terminal::format_directory(App::Enum::GIT_MERGE_DEFAULT_FILE)}", :short => '-o', :long => '--open-file', :type => :boolean
180
190
  opts.opt :from_file, 'Get branch names from file (1 branch per line)', :short => '-f', :long => '--from-file', :type => :boolean
181
- opts.opt :delete_source_branches_local, 'Delete all source branches (locally).', :short => '-d', :long => '--delete-local', :type => :boolean
182
- opts.opt :delete_source_branches_remote, 'Delete all source branches (remotely).', :short => '-D', :long => '--delete-remote', :type => :boolean
191
+ opts.opt :delete_source_branches_local, "Delete all source branches (locally) in #{App::Terminal::format_directory(App::Enum::GIT_MERGE_DEFAULT_FILE)}", :short => '-d', :long => '--delete-local', :type => :boolean
192
+ opts.opt :delete_source_branches_remote, "Delete all source branches (remotely) in #{App::Terminal::format_directory(App::Enum::GIT_MERGE_DEFAULT_FILE)}", :short => '-D', :long => '--delete-remote', :type => :boolean
183
193
  end
184
194
  git_merge.action do |opts, args|
185
- BrightpearlCommand::GitMerge.new(opts, args).execute
195
+ AppCommand::GitMerge.new(opts, args).execute
186
196
  end
187
197
  end
188
198
 
@@ -190,7 +200,7 @@ module Brightpearl
190
200
  git.command :pull, :aliases => [:p] do |git_pull|
191
201
  git_pull.summary 'Pull from origin'
192
202
  git_pull.action do |opts, args|
193
- BrightpearlCommand::GitPull.new(opts, args).execute
203
+ AppCommand::GitPull.new(opts, args).execute
194
204
  end
195
205
  end
196
206
 
@@ -198,7 +208,7 @@ module Brightpearl
198
208
  git.command :push, :aliases => [:P] do |git_push|
199
209
  git_push.summary 'Push to origin'
200
210
  git_push.action do |opts, args|
201
- BrightpearlCommand::GitPush.new(opts, args).execute
211
+ AppCommand::GitPush.new(opts, args).execute
202
212
  end
203
213
  end
204
214
 
@@ -206,7 +216,7 @@ module Brightpearl
206
216
  git.command :stash, :aliases => [:S] do |git_stash|
207
217
  git_stash.summary 'Show your current stashes'
208
218
  git_stash.action do |opts, args|
209
- BrightpearlCommand::GitStash.new(opts, args).execute
219
+ AppCommand::GitStash.new(opts, args).execute
210
220
  end
211
221
  end
212
222
 
@@ -217,7 +227,7 @@ module Brightpearl
217
227
  opts.opt :push, 'Push updates to origin', :short => '-P', :long => '--push', :type => :boolean
218
228
  end
219
229
  git_update.action do |opts, args|
220
- BrightpearlCommand::GitUpdate.new(opts, args).execute
230
+ AppCommand::GitUpdate.new(opts, args).execute
221
231
  end
222
232
  end
223
233
 
@@ -228,41 +238,33 @@ module Brightpearl
228
238
 
229
239
  end
230
240
 
231
- if beta_only
232
-
233
- # JIRA
234
- brightpearl.command :jira, :aliases => [:j] do |jira|
235
- jira.summary 'Access the Jira API'
236
-
237
- # JIRA CARD
238
- jira.command :card, :aliases => [:c] do |jira_card|
239
- jira_card.summary 'Get detailed information about a card'
240
- jira_card.action do |opts, args|
241
- BrightpearlCommand::JiraCard.new(opts, args).execute
242
- end
243
- end
241
+ # JIRA
242
+ brightpearl.command :jira, :aliases => [:j] do |jira|
243
+ jira.summary 'Access the Jira API'
244
244
 
245
- # JIRA (DEFAULT)
246
- jira.action do
247
- system('bp j -h')
245
+ # JIRA CARD
246
+ jira.command :card, :aliases => [:c] do |jira_card|
247
+ jira_card.summary 'Get detailed information about a card'
248
+ jira_card.action do |opts, args|
249
+ AppCommand::JiraCard.new(opts, args).execute
248
250
  end
249
251
  end
250
252
 
253
+ # JIRA (DEFAULT)
254
+ jira.action do
255
+ system('bp j -h')
256
+ end
251
257
  end
252
258
 
253
- if beta_only
254
-
255
- # RESET
256
- brightpearl.command :reset, :aliases => [:R] do |reset|
257
- reset.summary 'Reset various things within the App'
258
- reset.options do |opts|
259
- opts.opt :fitnesseDump, 'Reset the Fitnesse Dump on your VM', :short => '-f', :long => '--fitnesse-dump', :type => :boolean
260
- end
261
- reset.action do |opts, args|
262
- BrightpearlCommand::Reset.new(opts, args).execute
263
- end
259
+ # RESET
260
+ brightpearl.command :reset, :aliases => [:R] do |reset|
261
+ reset.summary 'Reset various things within the App'
262
+ reset.options do |opts|
263
+ opts.opt :fitnesseDump, 'Reset the Fitnesse Dump on your VM', :short => '-f', :long => '--fitnesse-dump', :type => :boolean
264
+ end
265
+ reset.action do |opts, args|
266
+ AppCommand::Reset.new(opts, args).execute
264
267
  end
265
-
266
268
  end
267
269
 
268
270
  # PRODUCTION
@@ -280,7 +282,7 @@ module Brightpearl
280
282
  opts.opt :compare, 'Compare logs between 2 versions (requires 2 parameters -- source & target version)', :short => '-c', :long => '--compare', :type => :boolean
281
283
  end
282
284
  production_logs.action do |opts, args|
283
- BrightpearlCommand::ProductionLogs.new(opts, args).execute
285
+ AppCommand::ProductionLogs.new(opts, args).execute
284
286
  end
285
287
  end
286
288
 
@@ -292,16 +294,12 @@ module Brightpearl
292
294
 
293
295
  end
294
296
 
295
- if beta_only
296
-
297
- # REVIEW
298
- brightpearl.command :review, :aliases => [:r] do |review|
299
- review.summary 'Perform a quick code review'
300
- review.action do |opts, args|
301
- BrightpearlCommand::Review.new(opts, args).execute
302
- end
297
+ # REVIEW
298
+ brightpearl.command :review, :aliases => [:r] do |review|
299
+ review.summary 'Perform a quick code review'
300
+ review.action do |opts, args|
301
+ AppCommand::Review.new(opts, args).execute
303
302
  end
304
-
305
303
  end
306
304
 
307
305
  # SCRIPTS
@@ -309,52 +307,51 @@ module Brightpearl
309
307
 
310
308
  scripts.summary 'Quick & dirty scripts'
311
309
 
312
- if beta_only
313
-
314
- # SCRIPTS API DOCS
315
- scripts.command :api_docs, :aliases => [:a] do |scripts_api_docs|
316
- scripts_api_docs.summary 'Build API docs'
317
- scripts_api_docs.action do |opts, args|
318
- BrightpearlCommand::ScriptsApiDocs.new(opts, args).execute
319
- end
310
+ # SCRIPTS API DOCS
311
+ scripts.command :api_docs, :aliases => [:a] do |scripts_api_docs|
312
+ scripts_api_docs.summary 'Build API docs'
313
+ scripts_api_docs.action do |opts, args|
314
+ AppCommand::ScriptsApiDocs.new(opts, args).execute
320
315
  end
316
+ end
321
317
 
322
- # SCRIPTS BRANCH CLEANER
323
- scripts.command :branch_cleaner, :aliases => [:b] do |scripts_branch_cleaner|
324
- scripts_branch_cleaner.summary 'Identify (and remove) old branches'
325
- scripts_branch_cleaner.options do |opts|
326
- opts.opt :scanLocal, 'Find local branches to remove', :short => '-l', :long => '--scan-local', :type => :boolean
327
- opts.opt :scanRemote, 'Find remote branches to remove', :short => '-r', :long => '--scan-remote', :type => :boolean
328
- opts.opt :anyName, "Find branches with any last committer, not just: #{Brightpearl::Config.param(Brightpearl::Config::GIT_USERNAME)}", :short => '-a', :long => '--any-name', :type => :boolean
329
- end
330
- scripts_branch_cleaner.action do |opts, args|
331
- BrightpearlCommand::ScriptsBranchCleaner.new(opts, args).execute
332
- end
318
+ # SCRIPTS BRANCH CLEANER
319
+ scripts.command :branch_cleaner, :aliases => [:b] do |scripts_branch_cleaner|
320
+ scripts_branch_cleaner.summary 'Identify (and remove) old branches'
321
+ scripts_branch_cleaner.options do |opts|
322
+ opts.opt :scanLocal, 'Find local branches to remove', :short => '-l', :long => '--scan-local', :type => :boolean
323
+ opts.opt :scanRemote, 'Find remote branches to remove', :short => '-r', :long => '--scan-remote', :type => :boolean
324
+ opts.opt :anyName, "Find branches with any last committer, not just: #{App::Config.param(App::Config::GIT_USERNAME)}", :short => '-a', :long => '--any-name', :type => :boolean
333
325
  end
334
-
335
- # SCRIPTS PHP CODE-SNIFFER
336
- scripts.command :code_sniffer, :aliases => [:c] do |scripts_code_sniffer|
337
- scripts_code_sniffer.summary 'Run PHP CodeSniffer'
338
- scripts_code_sniffer.action do |opts, args|
339
- BrightpearlCommand::ScriptsCodeSniffer.new(opts, args).execute
340
- end
326
+ scripts_branch_cleaner.action do |opts, args|
327
+ AppCommand::ScriptsBranchCleaner.new(opts, args).execute
341
328
  end
329
+ end
342
330
 
331
+ # SCRIPTS PHP SONAR
332
+ scripts.command :sonar, :aliases => [:s] do |scripts_sonar|
333
+ scripts_sonar.summary 'Run PHP Sonar (CodeSniffer)'
334
+ scripts_sonar.action do |opts, args|
335
+ AppCommand::ScriptsSonar.new(opts, args).execute
336
+ end
343
337
  end
344
338
 
345
339
  # SCRIPTS COLOR
346
- scripts.command :color, :aliases => [:C] do |scripts_color|
340
+ scripts.command :color, :aliases => [:c] do |scripts_color|
347
341
  scripts_color.summary 'Shows a list of bash/ruby color codes (256-bit)'
348
342
  scripts_color.action do |opts, args|
349
- BrightpearlCommand::ScriptsColor.new(opts, args).execute
343
+ AppCommand::ScriptsColor.new(opts, args).execute
350
344
  end
351
345
  end
352
346
 
353
347
  # SCRIPTS POM-FIXER
354
348
  scripts.command :pom_fixer, :aliases => [:p] do |scripts_pom_fixer|
355
349
  scripts_pom_fixer.summary 'Finds and fixes feature-tagged POM files.'
350
+ scripts_pom_fixer.options do |opts|
351
+ opts.opt :forMaster, 'Remove branch tags completely (do before merging to master)', :short => '-m', :long => '--for-master', :type => :boolean
352
+ end
356
353
  scripts_pom_fixer.action do |opts, args|
357
- BrightpearlCommand::ScriptsPomFixer.new(opts, args).execute
354
+ AppCommand::ScriptsPomFixer.new(opts, args).execute
358
355
  end
359
356
  end
360
357
 
@@ -365,45 +362,41 @@ module Brightpearl
365
362
 
366
363
  end
367
364
 
368
- if beta_only
369
-
370
- # TAIL
371
- brightpearl.command :tail, :aliases => [:T] do |tail|
372
- tail.summary 'Tail various logs (all catalina.out by default)'
373
- tail.action do |opts, args|
374
- BrightpearlCommand::Tail.new(opts, args).execute
375
- end
365
+ # TAIL
366
+ brightpearl.command :tail, :aliases => [:T] do |tail|
367
+ tail.summary 'Tail various logs (all catalina.out by default)'
368
+ tail.action do |opts, args|
369
+ AppCommand::Tail.new(opts, args).execute
376
370
  end
371
+ end
377
372
 
378
- # TEST
379
- brightpearl.command :test, :aliases => [:t] do |test|
380
- test.summary 'Run various tests (PHPUnit by default)'
381
- test.options do |opts|
382
- opts.opt :cucumber, 'Run Cucumber tests', :short => '-c', :long => '--cucumber', :type => :boolean
383
- opts.opt :fitnesse, 'Run FitNesse tests', :short => '-f', :long => '--fitnesse', :type => :boolean
384
- opts.opt :php, 'Run PHPUnit tests (default)', :short => '-p', :long => '--php-unit', :type => :boolean
385
- opts.opt :ruby, 'Run Ruby UI tests', :short => '-r', :long => '--ruby-ui', :type => :boolean
386
- end
387
- test.action do |opts, args|
388
- BrightpearlCommand::Test.new(opts, args).execute
389
- end
373
+ # TEST
374
+ brightpearl.command :test, :aliases => [:t] do |test|
375
+ test.summary 'Run various tests (PHPUnit by default)'
376
+ test.options do |opts|
377
+ opts.opt :cucumber, 'Run Cucumber tests', :short => '-c', :long => '--cucumber', :type => :boolean
378
+ opts.opt :fitnesse, 'Run FitNesse tests', :short => '-f', :long => '--fitnesse', :type => :boolean
379
+ opts.opt :php, 'Run PHPUnit tests (default)', :short => '-p', :long => '--php-unit', :type => :boolean
380
+ opts.opt :ruby, 'Run Ruby UI tests', :short => '-r', :long => '--ruby-ui', :type => :boolean
390
381
  end
391
-
392
- # UPDATE
393
- brightpearl.command :update, :aliases => [:u] do |update|
394
- update.summary 'Check for updates'
395
- update.action do |opts, args|
396
- BrightpearlCommand::Update.new(opts, args).execute
397
- end
382
+ test.action do |opts, args|
383
+ AppCommand::Test.new(opts, args).execute
398
384
  end
385
+ end
399
386
 
387
+ # UPDATE
388
+ brightpearl.command :update, :aliases => [:u] do |update|
389
+ update.summary 'Check for updates'
390
+ update.action do |opts, args|
391
+ AppCommand::Update.new(opts, args).execute
392
+ end
400
393
  end
401
394
 
402
395
  # X - SETUP
403
396
  brightpearl.command :setup, :aliases => [:x] do |setup|
404
397
  setup.summary 'Setup your configuration file'
405
398
  setup.action do |opts, args|
406
- BrightpearlCommand::Setup.new(opts, args).execute
399
+ AppCommand::Setup.new(opts, args).execute
407
400
  end
408
401
  end
409
402
 
data/lib/core/api.rb CHANGED
@@ -1,4 +1,4 @@
1
- module Brightpearl
1
+ module App
2
2
 
3
3
  class API
4
4