audc-gerry 0.1.11 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4a9979f2094ec0152b871da64e077343cfabb17c113e931fc9aee97b3ec5334
4
- data.tar.gz: a34a5c5bc528c812cc6e6d76657c7143eea9b43b82cea0665b2a7492e9c7561a
3
+ metadata.gz: f3108822eab8300e7cb2c52de53d6023b3233dc59bf55f14171682d0b640a6a1
4
+ data.tar.gz: 64909d46f5114971670f520d56a0c871e37f2ed6efe429bf9d6a363dfc3ead6f
5
5
  SHA512:
6
- metadata.gz: 166044fab28cc7375df59bf4b9122ac832be1e62e8c18d7694ff1d43af86345143b4fd1f5d8d1005208346bcea1a05577aa4a5bd8b26f7ab5b3e4666b0a90386
7
- data.tar.gz: d3751ff7ebfe9b8a705da6d7ff14e4f619444dc4bf5280b12ff48e9bc85a28d6d0169dfafcc393ce4de668737233da8c8ef93c01117578d258fba46171ed009f
6
+ metadata.gz: 137515096c190d22a358193de1d3a771fea6b773b5bd273df9024c8a4fcd14a9c4badd1ab96c8851ad6855db4c60032577442615670059401b507ea0330aa8a4
7
+ data.tar.gz: 59c050de6042e87b92168fad2db67456dd1c51c584dc82288819af4115caed0307b9d79af26af07bd5191aca262e3baf6249c89ad631624f5175bb6b60f04fea
@@ -14,7 +14,8 @@ module Gerry
14
14
  if options.is_a?(Array)
15
15
  options.map { |v| "#{v}" }.join('&')
16
16
  elsif options.is_a?(Hash)
17
- options.map { |k,v| "#{k}=#{v.join(',')}" }.join('&')
17
+ # Gerrit expects repeated parameters (o=A&o=B), never a comma-joined list.
18
+ options.flat_map { |k, v| Array(v).map { |value| "#{k}=#{value}" } }.join('&')
18
19
  end
19
20
  end
20
21
 
data/lib/gerry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gerry
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
data/spec/changes_spec.rb CHANGED
@@ -41,6 +41,21 @@ describe '.changes' do
41
41
  expect(changes[2]['owner']['name']).to eq('Bill')
42
42
  end
43
43
 
44
+ it 'should keep repeated options while fetching batches' do
45
+ stub_batch_0 = stub_get('/changes/?o=CURRENT_REVISION&o=LABELS', 'changes_batch_0.json')
46
+ stub_batch_1 = stub_get('/changes/?o=CURRENT_REVISION&o=LABELS&S=1', 'changes_batch_1.json')
47
+ stub_batch_2 = stub_get('/changes/?o=CURRENT_REVISION&o=LABELS&S=2', 'changes_batch_2.json')
48
+
49
+ client = MockGerry.new
50
+ changes = client.changes(['o=CURRENT_REVISION', 'o=LABELS'])
51
+
52
+ expect(stub_batch_0).to have_been_requested
53
+ expect(stub_batch_1).to have_been_requested
54
+ expect(stub_batch_2).to have_been_requested
55
+
56
+ expect(changes.size).to eq(3)
57
+ end
58
+
44
59
  it 'should fetch all open changes' do
45
60
  stub = stub_get('/changes/?q=is:open+owner:self', 'open_changes.json')
46
61
 
data/spec/request_spec.rb CHANGED
@@ -8,6 +8,14 @@ describe '.map_options' do
8
8
 
9
9
  expect(options).to eq('q=createAccount&q=createGroup')
10
10
  end
11
+
12
+ it 'should repeat a hash option that has several values' do
13
+
14
+ client = MockGerry.new
15
+ options = client.map_options('o' => %w[CURRENT_REVISION LABELS], 'S' => ['0'])
16
+
17
+ expect(options).to eq('o=CURRENT_REVISION&o=LABELS&S=0')
18
+ end
11
19
  end
12
20
 
13
21
  describe '.get' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audc-gerry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabian Mettler
@@ -12,7 +12,7 @@ authors:
12
12
  - iiithking
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2026-06-11 00:00:00.000000000 Z
15
+ date: 2026-09-02 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: guard
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.6.7
190
+ rubygems_version: 4.0.18
191
191
  specification_version: 4
192
192
  summary: Simple Ruby wrapper for the Gerrit Code Review REST-API.
193
193
  test_files: