audc-gerry 0.1.10 → 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 +4 -4
- data/lib/gerry/api/request.rb +2 -1
- data/lib/gerry/client.rb +2 -0
- data/lib/gerry/version.rb +1 -1
- data/spec/changes_spec.rb +15 -0
- data/spec/request_spec.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3108822eab8300e7cb2c52de53d6023b3233dc59bf55f14171682d0b640a6a1
|
|
4
|
+
data.tar.gz: 64909d46f5114971670f520d56a0c871e37f2ed6efe429bf9d6a363dfc3ead6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 137515096c190d22a358193de1d3a771fea6b773b5bd273df9024c8a4fcd14a9c4badd1ab96c8851ad6855db4c60032577442615670059401b507ea0330aa8a4
|
|
7
|
+
data.tar.gz: 59c050de6042e87b92168fad2db67456dd1c51c584dc82288819af4115caed0307b9d79af26af07bd5191aca262e3baf6249c89ad631624f5175bb6b60f04fea
|
data/lib/gerry/api/request.rb
CHANGED
|
@@ -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
|
-
|
|
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/client.rb
CHANGED
data/lib/gerry/version.rb
CHANGED
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.
|
|
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-
|
|
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:
|
|
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:
|