gergich 0.2.1 → 0.2.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: cef81a3c65bdd0fc840a4d528f2e53226d53e92e
4
- data.tar.gz: 40df25850f29562ad41d343634b14f57d400a9a9
3
+ metadata.gz: dc6e202255732bf23a6df2c75e18250897744e99
4
+ data.tar.gz: 1942f228ae335675740fa7ae626a92204ce7e7a5
5
5
  SHA512:
6
- metadata.gz: aa63ad319d840a44e9fa108d613171584f155adffae2d3499401f18552f22cefdc8956a9e3e5934a4b0040f3440761eb5ef2cabe98341d3cdfb9a4aeb999a30f
7
- data.tar.gz: d3b7c367fde6d1dab7214c373a11d167e81ea84c44291cb4899102a808a676262fac3cac3348725616770f2fc9e7fe03b32ccf99ed995ec3afa25d36fbc4a4ca
6
+ metadata.gz: 88c9113246e2e97fda409346032d88de432c910c360ec72c28b368e33e9bb34606663f2588601ef2be3e4bdab18644eac6498cc94749404dc941a373b0865238
7
+ data.tar.gz: d3266350ace476809d572e191275a7a18dab184d48954f8e3407680f8ec2b3e5840524c3c626d98ea6f7bd970ca21fa7a46108c67894d6e75153de430ef9ce28
@@ -81,7 +81,7 @@ module Gergich
81
81
 
82
82
  def change_id
83
83
  if info[:project] && info[:branch]
84
- ERB::Util.url_encode "#{info[:project]}~#{info[:branch]}~#{info[:change_id]}"
84
+ "#{info[:project]}~#{ERB::Util.url_encode info[:branch]}~#{info[:change_id]}"
85
85
  else
86
86
  info[:change_id]
87
87
  end
@@ -147,8 +147,11 @@ module Gergich
147
147
  return
148
148
  end
149
149
 
150
+ info = commit.info
151
+ puts "Project: #{info[:project]}"
152
+ puts "Branch: #{info[:branch]}"
153
+ puts "Revision: #{info[:revision_id]} (##{commit.revision_number})"
150
154
  puts "ChangeId: #{commit.change_id}"
151
- puts "Revision: #{commit.revision_id}"
152
155
  puts "Files:"
153
156
  puts " #{commit.files.join("\n ")}"
154
157
 
@@ -306,7 +309,7 @@ module Gergich
306
309
  if ret.sub!(/\A\)\]\}'\n/, "") && ret =~ /\A("|\[|\{)/
307
310
  JSON.parse("[#{ret}]")[0] # array hack so we can parse a string literal
308
311
  elsif ret =~ /Not found: (?<change_id>.*)/i
309
- raise("Cannot find Change-Id: #{Regexp.last_match[:change_id]}.\n"\
312
+ raise("Cannot find Change-Id: #{Regexp.last_match[:change_id]} at #{url}.\n"\
310
313
  "This is most likely due to this"\
311
314
  " Change-Id already being used"\
312
315
  " by an ABANDONED change.\n"\
@@ -65,7 +65,7 @@ RSpec.describe Gergich::Commit do
65
65
  allow(ENV).to receive(:[]).with("GERRIT_CHANGE_ID").and_return("dummychangeset")
66
66
 
67
67
  expect(described_class.new.change_id) # %2F = / and %7E = ~
68
- .to match("spec-project%7Ereleases%2F2017.11.17%7Edummychangeset")
68
+ .to match("spec-project~releases%2F2017.11.17~dummychangeset")
69
69
  end
70
70
  end
71
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gergich
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Jensen