brightpearl-cli 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,52 @@
1
+ module BrightpearlCommand
2
+
3
+ class ScriptsColor < ::Convoy::ActionCommand::Base
4
+
5
+ def execute
6
+
7
+ @opts = command_options
8
+ @args = arguments
9
+ opts_validate
10
+ opts_routing
11
+
12
+ end
13
+
14
+ def opts_validate
15
+
16
+ end
17
+
18
+ def opts_routing
19
+
20
+ display_color
21
+
22
+ end
23
+
24
+ def display_color
25
+ shell_code = %{
26
+ for fgbg in 38 48 ; do
27
+ echo
28
+ for color in {0..255} ; do
29
+ printf "\033[${fgbg};5;${color}m ${color}\t\033[0m"
30
+ if [ $((($color + 1) % 16)) == 0 ] ; then
31
+ echo
32
+ fi
33
+ done
34
+ echo
35
+ done
36
+ }
37
+ ruby_line_1 = "\x1B[38;5;9m RUBY \x1B[0m \xe2\x86\x92 \x1B[48;5;235m \\x1B[38;5;\x1B[38;5;190m\xe2\x98\x85\x1B[38;5;256m m \x1B[0m \xe2\x86\x92 \x1B[38;5;9mForeground\x1B[0m"
38
+ ruby_line_2 = "\x1B[38;5;9m \x1B[0m \x1B[48;5;235m \\x1B[48;5;\x1B[38;5;190m\xe2\x98\x85\x1B[38;5;256m m \x1B[0m \xe2\x86\x92 \x1B[38;5;9mBackground\x1B[0m"
39
+ ruby_line_3 = "\x1B[38;5;9m \x1B[0m \x1B[48;5;235m \\x1B[0m \x1B[0m \xe2\x86\x92 \x1B[38;5;9mReset\x1B[0m"
40
+ system(shell_code)
41
+ puts
42
+ puts " USAGE: Replace stars \x1B[38;5;190m\xe2\x98\x85\x1B[0m with color code(s)"
43
+ puts
44
+ puts "\x1B[38;5;39m BASH \x1B[0m \xe2\x86\x92 \x1B[48;5;235m \\033[38;5;\x1B[38;5;190m\xe2\x98\x85\x1B[38;5;256m m \x1B[0m \xe2\x86\x92 \x1B[38;5;39mForeground\x1B[0m | #{ruby_line_1}"
45
+ puts "\x1B[38;5;39m \x1B[0m \x1B[48;5;235m \\033[48;5;\x1B[38;5;190m\xe2\x98\x85\x1B[38;5;256m m \x1B[0m \xe2\x86\x92 \x1B[38;5;39mBackground\x1B[0m | #{ruby_line_2}"
46
+ puts "\x1B[38;5;39m \x1B[0m \x1B[48;5;235m \\033[0m \x1B[0m \xe2\x86\x92 \x1B[38;5;39mReset\x1B[0m | #{ruby_line_3}"
47
+ puts
48
+ end
49
+
50
+ end
51
+
52
+ end
@@ -0,0 +1,15 @@
1
+ module BrightpearlCommand
2
+
3
+ class Setup < ::Convoy::ActionCommand::Base
4
+
5
+ def execute
6
+
7
+ Brightpearl::Config::config_file_edit
8
+ Brightpearl::Config::config_params_get
9
+ Brightpearl::Config::config_params_validate(true)
10
+
11
+ end
12
+
13
+ end
14
+
15
+ end
@@ -0,0 +1,69 @@
1
+ module BrightpearlCommand
2
+
3
+ class Test < ::Convoy::ActionCommand::Base
4
+
5
+ def execute
6
+
7
+ @opts = command_options
8
+ @args = arguments
9
+ opts_validate
10
+ opts_routing
11
+
12
+ end
13
+
14
+ def opts_validate
15
+
16
+ opts_set = 0
17
+ opts_set = opts_set + 1 if @opts[:cucumber]
18
+ opts_set = opts_set + 1 if @opts[:fitnesse]
19
+ opts_set = opts_set + 1 if @opts[:php]
20
+ opts_set = opts_set + 1 if @opts[:ruby]
21
+
22
+ if opts_set >= 2
23
+ puts "You can only run one set of tests at a time. Please set only 1 one of the following flags: \x1B[90m-c, -f, -p, -r\x1B[0m"
24
+ exit
25
+ elsif
26
+ opts_set == 0
27
+ @opts[:php] = true
28
+ end
29
+
30
+ end
31
+
32
+ def opts_routing
33
+
34
+ if @opts[:cucumber]
35
+ run_cucumber
36
+ elsif @opts[:fitnesse]
37
+ run_fitnesse
38
+ elsif @opts[:php]
39
+ run_php
40
+ elsif @opts[:ruby]
41
+ run_ruby
42
+ end
43
+
44
+ end
45
+
46
+ def run_cucumber
47
+
48
+ end
49
+
50
+ def run_fitnesse
51
+
52
+ end
53
+
54
+ def run_php
55
+
56
+ commands = [
57
+ "sshpass -p#{Brightpearl::Config.param(Brightpearl::Config::VM_USER_PASSWORD)} ssh #{Brightpearl::Config.param(Brightpearl::Config::VM_USER)}@#{Brightpearl::Config.param(Brightpearl::Config::VM_IP)} 'cd /brightpearl-source/brightpearl-code/brightpearl/private/tests/ && ./phpunit.sh #{@args.join(' ')}'"
58
+ ]
59
+ Brightpearl::Terminal::command(commands, nil, false)
60
+
61
+ end
62
+
63
+ def run_ruby
64
+
65
+ end
66
+
67
+ end
68
+
69
+ end
@@ -0,0 +1,35 @@
1
+ module BrightpearlCommand
2
+
3
+ class Update < ::Convoy::ActionCommand::Base
4
+
5
+ def execute
6
+
7
+ @opts = command_options
8
+ @args = arguments
9
+ opts_validate
10
+ opts_routing
11
+
12
+ end
13
+
14
+ def opts_validate
15
+
16
+ end
17
+
18
+ def opts_routing
19
+
20
+ update
21
+
22
+ end
23
+
24
+ def update
25
+
26
+ Convoy::Logger.output.puts "Command: #{command_name}"
27
+ Convoy::Logger.output.puts "Options: #{options}"
28
+ Convoy::Logger.output.puts "Command options: #{command_options}"
29
+ Convoy::Logger.output.puts "Arguments: #{arguments}"
30
+
31
+ end
32
+
33
+ end
34
+
35
+ end
metadata ADDED
@@ -0,0 +1,169 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: brightpearl-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Albert Rannetsperger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: columnist
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: convoy
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 1.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: highline
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 1.6.21
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 1.6.21
55
+ - !ruby/object:Gem::Dependency
56
+ name: mysql
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 2.9.1
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 2.9.1
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - '='
70
+ - !ruby/object:Gem::Version
71
+ version: 2.9.1
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 2.9.1
75
+ - !ruby/object:Gem::Dependency
76
+ name: parseconfig
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '='
80
+ - !ruby/object:Gem::Version
81
+ version: 1.0.4
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '='
87
+ - !ruby/object:Gem::Version
88
+ version: 1.0.4
89
+ - !ruby/object:Gem::Dependency
90
+ name: rest-client
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '='
94
+ - !ruby/object:Gem::Version
95
+ version: 1.6.7
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '='
101
+ - !ruby/object:Gem::Version
102
+ version: 1.6.7
103
+ description: A gem created for Brightpearl developers and QAs. Used to help automate
104
+ daily work flows.
105
+ email: albert.rannetsperger@brightpearl.com
106
+ executables:
107
+ - bp
108
+ - brightpearl
109
+ extensions: []
110
+ extra_rdoc_files: []
111
+ files:
112
+ - LICENSE
113
+ - README.md
114
+ - bin/bp
115
+ - bin/brightpearl
116
+ - lib/brightpearl_cli.rb
117
+ - lib/core/api.rb
118
+ - lib/core/config.rb
119
+ - lib/core/enums.rb
120
+ - lib/core/git.rb
121
+ - lib/core/jira.rb
122
+ - lib/core/mysql.rb
123
+ - lib/core/terminal.rb
124
+ - lib/core/tools.rb
125
+ - lib/core/validate.rb
126
+ - lib/routes/build.rb
127
+ - lib/routes/dummy_order.rb
128
+ - lib/routes/git_branch.rb
129
+ - lib/routes/git_checkout.rb
130
+ - lib/routes/git_delete.rb
131
+ - lib/routes/git_merge.rb
132
+ - lib/routes/git_pull.rb
133
+ - lib/routes/git_push.rb
134
+ - lib/routes/git_stash.rb
135
+ - lib/routes/git_update.rb
136
+ - lib/routes/jira.rb
137
+ - lib/routes/less.rb
138
+ - lib/routes/reset.rb
139
+ - lib/routes/review.rb
140
+ - lib/routes/scripts_code_sniffer.rb
141
+ - lib/routes/scripts_color.rb
142
+ - lib/routes/setup.rb
143
+ - lib/routes/tests.rb
144
+ - lib/routes/update.rb
145
+ homepage: http://rubygems.org/gems/brightpearl-cli
146
+ licenses:
147
+ - MIT
148
+ metadata: {}
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '2.0'
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ requirements: []
164
+ rubyforge_project:
165
+ rubygems_version: 2.4.1
166
+ signing_key:
167
+ specification_version: 4
168
+ summary: Brightpearl (Command Line Interface)
169
+ test_files: []