gerrit 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gerrit/cli.rb +12 -2
- data/lib/gerrit/command/help.rb +3 -0
- data/lib/gerrit/command/setup.rb +18 -0
- data/lib/gerrit/error_handler.rb +3 -0
- data/lib/gerrit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3043c0156abae2e06e72d8193b952e910801ebec
|
4
|
+
data.tar.gz: 21ef00a5f5cb37ee44f0b1d6c626a89c494d6863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a795d812fbb1bc438d713a417dfb853ab500a95ff47caf9615596224ffd7b989a5e50f3d8fe7bbe58cdaa71204ebf2da1352e64617d042431bef9d46cb9b002
|
7
|
+
data.tar.gz: 7cae28572e2b8c35fd8872bdfc446772832bdf18f587cb80b5b6b135d869bea2721f01e03ab1aa31e8e57d8160fc1b0d3d096bb4ff148ec7188b79c3b961b06a
|
data/lib/gerrit/cli.rb
CHANGED
@@ -8,6 +8,7 @@ module Gerrit
|
|
8
8
|
# @see http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
|
9
9
|
module ExitCodes
|
10
10
|
OK = 0 # Successful execution
|
11
|
+
ERROR = 1 # Generic error
|
11
12
|
USAGE = 64 # User error (bad command line or invalid input)
|
12
13
|
SOFTWARE = 70 # Internal software error (bug)
|
13
14
|
CONFIG = 78 # Configuration error (invalid file or options)
|
@@ -44,11 +45,20 @@ module Gerrit
|
|
44
45
|
# @param arguments [Array<String>]
|
45
46
|
# @raise [Gerrit::Errors::GerritError] when any exceptional circumstance occurs
|
46
47
|
def run_command(config, arguments)
|
47
|
-
|
48
|
-
arguments = ['list'] if arguments.empty?
|
48
|
+
arguments = convert_arguments(arguments)
|
49
49
|
|
50
50
|
require 'gerrit/command/base'
|
51
51
|
Command::Base.from_arguments(config, @ui, arguments).run
|
52
52
|
end
|
53
|
+
|
54
|
+
def convert_arguments(arguments)
|
55
|
+
# Display all open changes by default
|
56
|
+
return ['list'] if arguments.empty?
|
57
|
+
|
58
|
+
return ['help'] if %w[-h --help].include?(arguments.first)
|
59
|
+
return ['version'] if %w[-v --version].include?(arguments.first)
|
60
|
+
|
61
|
+
arguments
|
62
|
+
end
|
53
63
|
end
|
54
64
|
end
|
data/lib/gerrit/command/help.rb
CHANGED
data/lib/gerrit/command/setup.rb
CHANGED
@@ -42,11 +42,29 @@ module Gerrit::Command
|
|
42
42
|
ui.success "Added #{remote_name} #{remote_url}"
|
43
43
|
end
|
44
44
|
|
45
|
+
execute_post_setup_script(Dir.pwd)
|
46
|
+
|
45
47
|
ui.newline
|
46
48
|
ui.info 'You can now push commits for review by running: ', newline: false
|
47
49
|
ui.print 'gerrit push'
|
48
50
|
end
|
49
51
|
|
52
|
+
def execute_post_setup_script(repo_directory)
|
53
|
+
post_setup_cmd = Array(config[:post_setup])
|
54
|
+
return unless post_setup_cmd.any?
|
55
|
+
|
56
|
+
result =
|
57
|
+
ui.spinner('Running post setup script...') do
|
58
|
+
spawn(post_setup_cmd)
|
59
|
+
end
|
60
|
+
if result.success?
|
61
|
+
ui.success(result.stdout.rstrip) unless result.stdout.strip.empty?
|
62
|
+
else
|
63
|
+
ui.error('Failed to run post setup script:')
|
64
|
+
ui.error(result.stdout + result.stderr)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
50
68
|
def render_remote_url(remote_config)
|
51
69
|
remote_config['url'] % {
|
52
70
|
user: config[:user],
|
data/lib/gerrit/error_handler.rb
CHANGED
data/lib/gerrit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gerrit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.4.
|
125
|
+
rubygems_version: 2.4.5.1
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Gerrit command line interface
|