gerricator 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b95073cc012085a556c2b161d89afb6ec17acd9
4
- data.tar.gz: 18601b5e858f315fcc213680794ac2e392f5d1c5
3
+ metadata.gz: 82cb01cc81eae73074c801d55789cc76166bc9cd
4
+ data.tar.gz: 75185c8ce34965b5516270f098c5961ea327291b
5
5
  SHA512:
6
- metadata.gz: 7cb01b4fdd457ae8cd100afdd129cb1de17dbf05dd7e983cb02680c003813b6db98ea2bbff74011cd43a410bf463fe3caa295c92aa325c1c93560b3395a6028b
7
- data.tar.gz: 20a99fca89918a1fd25b52baef44cb4ebe336d9a3865272a29683dbde4355b5ab261679821e65d0b55d67aa34e4b7f7cd0847e21839fc0641e486a00e73350d3
6
+ metadata.gz: 6a714d8f047ba5f7d2ec6f9e24d39c1273982fd0b417bb6e89e03f133bcdcf5c6c8f6ca8dd9680289434de490ebbe801328c0c4e0a543373cbbe89ad9ddd91f3
7
+ data.tar.gz: de81ad7e0c6f3ee9e083c22075e8a9443c848f5a7d010b38e3ec458161772ba477af15e4b563f683fb4537fb5dde560e2b527e239b028754ad04057ddc210d05
data/config/app.rb CHANGED
@@ -97,7 +97,7 @@ module App; class << self
97
97
  change_url = File.join(config['gerrit']['base_url'], "#/c/#{number}")
98
98
  message = "#{Git::message(work_dir)}\nGerrit URL: #{change_url}\n"
99
99
  reviewers = [*config['projects'][project]['reviewers']].compact
100
- reviewers = change.reviewers - gerrit_bots if reviewers.empty?
100
+ reviewers = change.reviewers - gerrit_bots - [change.owner] if reviewers.empty?
101
101
  logger.info "Creating new diff, reviewers: #{reviewers}"
102
102
  differential_id = arc.diff(work_dir, config['projects'][project]['phabricator_callsign'], message: message, reviewers: reviewers)
103
103
  link = Link.create! differential_id: differential_id, change_number: number, patch_set_revisions: rev_no
data/gerricator.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gerricator'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.2'
4
4
  s.date = Date.civil(2015,1,25)
5
5
  s.summary = 'Gerrit change to Phabricator diff'
6
6
  s.description = 'Command-line tool to create or update Phabricator diff from Gerrit change'
data/lib/gerrit.rb CHANGED
@@ -12,6 +12,10 @@ class Gerrit < Struct.new(:base_url, :username, :password)
12
12
  request endpoint, method: 'post', body: body.to_s
13
13
  end
14
14
 
15
+ def put endpoint, body = {}
16
+ request endpoint, method: 'put', body: JSON.dump(body)
17
+ end
18
+
15
19
  class Change < Struct.new(:gerrit, :change_id)
16
20
  def number
17
21
  @number ||= get['_number']
@@ -29,6 +33,10 @@ class Gerrit < Struct.new(:base_url, :username, :password)
29
33
  get('?o=ALL_REVISIONS')['revisions']
30
34
  end
31
35
 
36
+ def owner
37
+ get('detail')['owner']['username']
38
+ end
39
+
32
40
  def get subpath=''
33
41
  path = File.join("changes/#{change_id}", subpath)
34
42
  gerrit.get path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gerricator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jun Wu