pdc 0.1.10 → 0.1.11

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: 9e74315885ba024c3bae059ec530761698a2b1b1
4
- data.tar.gz: 5bdf6a27f924c35a4984aab43a0fcbed478a361b
3
+ metadata.gz: ca306779982cf263fec603670b09c872859555fe
4
+ data.tar.gz: 4561b58710ca446ed9d37b87ee0f898775f8a914
5
5
  SHA512:
6
- metadata.gz: eee57d0ad04994857fcc9c2991026f5a6368baecd40931aad8d6e104655ca2b0dd92e58fbf9b8584b4ce8e893be6fd9b7f0bbb5422057ab08435cd50beda25fe
7
- data.tar.gz: 2936d8525f7716f60364b5faeb94a315a7862ce9ac94e1d8abbe32ac673528393e7ae23104a2c0543549760e71a9817c48453e33e4209e2ff9c30fef5080daf2
6
+ metadata.gz: dcef5e6ff461dcdfb37cf030af975e09a04f7f59f8b3bae2063c4b887e5ed88294fa2b16b0a4103c725848d04411384ac651593f37a8d24563e5e2f2437e6c62
7
+ data.tar.gz: d6e5e38ba1e9ccc09559a034778d553d2eaf8dcc355ed4d2f91777408a806c92b787e9c4d8c5f2d1687c3110109476241b3322c70e151d0f71247a3a312c8206
data/lib/pdc/config.rb CHANGED
@@ -118,7 +118,14 @@ module PDC
118
118
  faraday_config = {
119
119
  url: api_url,
120
120
  headers: PDC::Request.default_headers,
121
- ssl: ssl_config
121
+ ssl: ssl_config,
122
+ # adding this request parameter is about changing how
123
+ # parameters are serialized which is mentioned on faraday's
124
+ # doc, it's about sending a query request with multi values
125
+ # of a field, like product_version: [xxx, xxx].
126
+ request: {
127
+ params_encoder: Faraday::FlatParamsEncoder
128
+ }
122
129
  }
123
130
 
124
131
  PDC::Base.connection = Faraday.new(faraday_config) do |c|
data/lib/pdc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PDC
2
- VERSION = '0.1.10'.freeze
2
+ VERSION = '0.1.11'.freeze
3
3
  end
data/pdc.gemspec CHANGED
@@ -34,5 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_dependency 'faraday', '~> 0.9.2'
35
35
  s.add_dependency 'faraday_middleware', '~> 0.10.0'
36
36
  s.add_dependency 'faraday-http-cache', '~> 1.3.0'
37
+ # redhat sudo yum install ruby-devel libcurl-devel openssl-devel
38
+ # ubuntu sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
37
39
  s.add_dependency 'curb', '~> 0.9.3'
38
40
  end
@@ -0,0 +1,55 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://pdc.host.dev.eng.pek2.redhat.com/rest_api/v1/releases/?product_version=rhel-8&product_version=rhel-7
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Content-Type:
13
+ - application/json
14
+ User-Agent:
15
+ - Faraday v0.9.2
16
+ response:
17
+ status:
18
+ code: 200
19
+ message:
20
+ headers:
21
+ date:
22
+ - Fri, 10 Nov 2017 07:07:37 GMT
23
+ server:
24
+ - Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_auth_kerb/5.4
25
+ mod_wsgi/3.4 Python/2.7.5
26
+ expires:
27
+ - Fri, 10 Nov 2017 07:08:10 GMT
28
+ vary:
29
+ - Accept,Cookie
30
+ last-modified:
31
+ - Tue, 26 Sep 2017 08:04:24 GMT
32
+ allow:
33
+ - GET, POST, PUT, PATCH, HEAD, OPTIONS
34
+ cache-control:
35
+ - max-age=30
36
+ x-frame-options:
37
+ - SAMEORIGIN
38
+ transfer-encoding:
39
+ - chunked
40
+ content-type:
41
+ - application/json
42
+ body:
43
+ encoding: UTF-8
44
+ string: '{"count":8,"next":null,"previous":null,"results":[{"release_id":"rhel-7.0","short":"rhel","version":"7.0","name":"Red
45
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"ga","compose_set":["RHEL-7.0-20140507.0"],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":null,"brew":{"default_target":"rhel-7.0-candidate","allowed_tags":["rhel-7.0","rhel-7.0-candidate"]},"product_pages":{"release_id":17},"errata":{"product_version":"RHEL-7"}},{"release_id":"rhel-7.0-updates","short":"rhel","version":"7.0","name":"Red
46
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"updates","compose_set":["RHEL-7.0-20140507.0"],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":null,"brew":null,"product_pages":null,"errata":null},{"release_id":"rhel-7.1","short":"rhel","version":"7.1","name":"Red
47
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"ga","compose_set":["RHEL-7.1-20140708.n.0","RHEL-7.1-20150219.1"],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":null,"brew":{"default_target":"rhel-7.1-candidate","allowed_tags":["rhel-7.1","rhel-7.1-candidate"]},"product_pages":{"release_id":390},"errata":{"product_version":"RHEL-7"}},{"release_id":"rhel-7.1-updates","short":"rhel","version":"7.1","name":"Red
48
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"updates","compose_set":[],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":null,"brew":null,"product_pages":null,"errata":null},{"release_id":"rhel-7.1-eus","short":"rhel","version":"7.1","name":"Red
49
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"eus","compose_set":["RHEL-7.1-20150219.1"],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":null,"brew":null,"product_pages":null,"errata":null},{"release_id":"rhel-7.2","short":"rhel","version":"7.2","name":"Red
50
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"ga","compose_set":["RHEL-7.2-20150616.n.0","RHEL-7.2-20150618.n.0","RHEL-7.2-20150708.1","RHEL-7.2-20150720.n.0","RHEL-7.2-20150720.0","RHEL-7.2-20150722.n.0","RHEL-7.2-20150724.n.0","RHEL-7.2-20150727.n.0","RHEL-7.2-20150728.n.0","RHEL-7.2-20150729.n.0","RHEL-7.2-20150803.n.0","RHEL-7.2-20150803.n.1","RHEL-7.2-20150805.n.0","RHEL-7.2-20150805.1","RHEL-7.2-20150806.1","RHEL-7.2-20150810.n.0","RHEL-7.2-20150812.n.0","RHEL-7.2-20150817.n.0","RHEL-7.2-20150817.n.1","RHEL-7.2-20150817.n.2","RHEL-7.2-20150819.n.0","RHEL-7.2-20150820.0","RHEL-7.2-20150824.n.0","RHEL-7.2-20150831.n.0","RHEL-7.2-20150902.n.0","RHEL-7.2-20150903.0","RHEL-7.2-20150904.0","RHEL-7.2-20150907.n.0","RHEL-7.2-20150909.n.0","RHEL-7.2-20150910.2","RHEL-7.2-20150914.n.0","RHEL-7.2-20150916.n.0","RHEL-7.2-20150917.0","RHEL-7.2-20150921.n.0","RHEL-7.2-20150921.n.1","RHEL-7.2-20150922.n.0","RHEL-7.2-20150923.n.0","RHEL-7.2-20150924.n.0","RHEL-7.2-20150924.0","RHEL-7.2-20150925.n.0","RHEL-7.2-20150928.n.0","RHEL-7.2-20150929.n.0","RHEL-7.2-20150930.n.0","RHEL-7.2-20151001.n.0","RHEL-7.2-20151001.0","RHEL-7.2-20151002.n.0","RHEL-7.2-20151005.n.0","RHEL-7.2-20151006.n.0","RHEL-7.2-20151007.n.0","RHEL-7.2-20151007.n.1","RHEL-7.2-20151008.n.0","RHEL-7.2-20151008.0","RHEL-7.2-20151012.n.0","RHEL-7.2-20151013.n.0","RHEL-7.2-20151014.n.0","RHEL-7.2-20151015.n.0","RHEL-7.2-20151015.0","RHEL-7.2-20151019.n.0","RHEL-7.2-20151021.n.0","RHEL-7.2-20151023.n.0","RHEL-7.2-20151026.n.0","RHEL-7.2-20151027.n.0","RHEL-7.2-20151027.3","RHEL-7.2-20151028.n.0","RHEL-7.2-20151029.n.0","RHEL-7.2-20151030.n.0","RHEL-7.2-20151030.n.1","RHEL-7.2-20151030.0","RHEL-7.2-20151102.n.0","RHEL-7.2-20151103.n.0","RHEL-7.2-20151104.n.0","RHEL-7.2-20151105.n.0","RHEL-7.2-20151106.n.0","RHEL-7.2-20160504.0","RHEL-7.2-20160531.0"],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":{"branch":"rhel-7.2"},"brew":{"default_target":"rhel-7.2-candidate","allowed_tags":["rhel-7.2","rhel-7.2-candidate"]},"product_pages":{"release_id":446},"errata":{"product_version":"RHEL-7"}},{"release_id":"rhel-7.3","short":"rhel","version":"7.3","name":"Red
51
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"ga","compose_set":["RHEL-7.3-20160120.n.0","RHEL-7.3-20160125.n.0","RHEL-7.3-20160127.n.0","RHEL-7.3-20160201.n.0","RHEL-7.3-20160203.n.0","RHEL-7.3-20160208.n.0","RHEL-7.3-20160210.n.0","RHEL-7.3-20160215.n.0","RHEL-7.3-20160217.n.0","RHEL-7.3-20160218.n.0","RHEL-7.3-20160222.n.0","RHEL-7.3-20160224.n.0","RHEL-7.3-20160229.n.0","RHEL-7.3-20160302.n.0","RHEL-7.3-20160307.n.0","RHEL-7.3-20160401.n.0","RHEL-7.3-20160404.n.0","RHEL-7.3-20160405.n.0","RHEL-7.3-20160406.n.0","RHEL-7.3-20160407.n.0","RHEL-7.3-20160413.n.1","RHEL-7.3-20160413.n.2","RHEL-7.3-20160414.n.1","RHEL-7.3-20160415.n.0","RHEL-7.3-20160418.n.0","RHEL-7.3-20160418.n.1","RHEL-7.3-20160428.n.0","RHEL-7.3-20160428.n.1","RHEL-7.3-20160429.n.0","RHEL-7.3-20160502.n.0","RHEL-7.3-20160503.n.0","RHEL-7.3-20160505.n.0","RHEL-7.3-20160506.n.0","RHEL-7.3-20160510.n.0","RHEL-7.3-20160511.n.0","RHEL-7.3-20160512.n.0","RHEL-7.3-20160513.n.0","RHEL-7.3-20160516.n.0","RHEL-7.3-20160517.n.0","RHEL-7.3-20160518.n.0","RHEL-7.3-20160519.n.0","RHEL-7.3-20160520.n.0","RHEL-7.3-20160523.n.0","RHEL-7.3-20160524.n.0","RHEL-7.3-20160525.n.0","RHEL-7.3-20160601.n.0","RHEL-7.3-20160602.n.0","RHEL-7.3-20160603.n.0","RHEL-7.3-20160606.n.0","RHEL-7.3-20160607.n.0","RHEL-7.3-20160608.n.0","RHEL-7.3-20160609.n.0","RHEL-7.3-20160610.n.0","RHEL-7.3-20160613.n.0","RHEL-7.3-20160614.n.0","RHEL-7.3-20160615.n.0","RHEL-7.3-20160616.n.0","RHEL-7.3-20160617.n.0","RHEL-7.3-20160620.n.0","RHEL-7.3-20160621.n.0","RHEL-7.3-20160627.n.0","RHEL-7.3-20160627.n.1","RHEL-7.3-20160628.n.0","RHEL-7.3-20160629.n.0","RHEL-7.3-20160630.n.0","RHEL-7.3-20160701.n.0","RHEL-7.3-20160705.n.0","RHEL-7.3-20160706.n.0","RHEL-7.3-20160707.n.0","RHEL-7.3-20160707.2","RHEL-7.3-20160708.n.0","RHEL-7.3-20160711.n.0","RHEL-7.3-20160712.n.0","RHEL-7.3-20160713.n.0","RHEL-7.3-20160714.n.0","RHEL-7.3-20160715.n.0","RHEL-7.3-20160718.n.0","RHEL-7.3-20160719.n.0","RHEL-7.3-20160719.0","RHEL-7.3-20160719.1","RHEL-7.3-20160720.n.0","RHEL-7.3-20160721.n.0","RHEL-7.3-20160722.n.0","RHEL-7.3-20160726.n.0","RHEL-7.3-20160727.n.0","RHEL-7.3-20160728.n.0","RHEL-7.3-20160729.n.0","RHEL-7.3-20160729.1","RHEL-7.3-20160801.n.0","RHEL-7.3-20160802.n.0","RHEL-7.3-20160803.n.0","RHEL-7.3-20160804.n.0","RHEL-7.3-20160805.n.0","RHEL-7.3-20160808.n.0","RHEL-7.3-20160809.n.0","RHEL-7.3-20160810.n.0","RHEL-7.3-20160811.n.0","RHEL-7.3-20160811.0","RHEL-7.3-20160812.n.0","RHEL-7.3-20160815.n.0","RHEL-7.3-20160817.n.0","RHEL-7.3-20160817.1","RHEL-7.3-20160818.n.0","RHEL-7.3-20160819.n.0","RHEL-7.3-20160822.n.0","RHEL-7.3-20160823.n.0","RHEL-7.3-20160824.n.0","RHEL-7.3-20160825.n.0","RHEL-7.3-20160825.0","RHEL-7.3-20160825.1","RHEL-7.3-20160826.n.0","RHEL-7.3-20160829.n.0","RHEL-7.3-20160830.n.0","RHEL-7.3-20160831.n.0","RHEL-7.3-20160901.n.0","RHEL-7.3-20160901.1","RHEL-7.3-20160902.n.0","RHEL-7.3-20160905.n.0","RHEL-7.3-20160906.n.2","RHEL-7.3-20160906.n.3","RHEL-7.3-20160907.n.2","RHEL-7.3-20160908.3","RHEL-7.3-20160909.n.0","RHEL-7.3-20160912.n.3","RHEL-7.3-20160912.n.4","RHEL-7.3-20160913.n.0","RHEL-7.3-20160914.1","RHEL-7.3-20160916.n.0","RHEL-7.3-20160916.n.1","RHEL-7.3-20160919.n.0","RHEL-7.3-20160920.n.0","RHEL-7.3-20160921.n.0","RHEL-7.3-20160922.n.0","RHEL-7.3-20160922.n.1","RHEL-7.3-20160923.n.0","RHEL-7.3-20160923.n.1","RHEL-7.3-20160923.0","RHEL-7.3-20160926.n.1","RHEL-7.3-20160927.n.0","RHEL-7.3-20160927.n.1","RHEL-7.3-20160928.n.0","RHEL-7.3-20160929.n.0","RHEL-7.3-20160929.2","RHEL-7.3-20160929.5","RHEL-7.3-20160930.n.0","RHEL-7.3-20161003.n.0","RHEL-7.3-20161003.0","RHEL-7.3-20161004.n.0","RHEL-7.3-20161005.0","RHEL-7.3-20161006.n.0","RHEL-7.3-20161007.n.0","RHEL-7.3-20161010.n.0","RHEL-7.3-20161012.0","RHEL-7.3-20161019.0","RHEL-7.3-updates-20161219.1"],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":{"branch":"rhel-7.3"},"brew":{"default_target":"rhel-7.3-candidate","allowed_tags":["rhel-7.3","rhel-7.3-candidate"]},"product_pages":{"release_id":680},"errata":{"product_version":"RHEL-7"}},{"release_id":"rhel-7.4","short":"rhel","version":"7.4","name":"Red
52
+ Hat Enterprise Linux","base_product":null,"active":true,"product_version":"rhel-7","release_type":"ga","compose_set":["RHEL-7.4-20161213.n.2","RHEL-7.4-20161214.n.0","RHEL-7.4-20161215.n.0","RHEL-7.4-20161216.n.0","RHEL-7.4-20161219.n.0","RHEL-7.4-20161220.n.0","RHEL-7.4-20161221.n.0","RHEL-7.4-20161222.n.0","RHEL-7.4-20161223.n.0","RHEL-7.4-20161226.n.0"],"integrated_with":null,"sigkey":null,"allow_buildroot_push":false,"allowed_debuginfo_services":[],"allowed_push_targets":[],"bugzilla":null,"dist_git":null,"brew":{"default_target":"rhel-7.4-candidate","allowed_tags":["rhel-7.4","rhel-7.4-candidate"]},"product_pages":null,"errata":null}]}'
53
+ http_version:
54
+ recorded_at: Fri, 10 Nov 2017 07:07:40 GMT
55
+ recorded_with: VCR 3.0.3
@@ -23,6 +23,11 @@ describe PDC::V1::Release do
23
23
  count = release.where(active: false).count
24
24
  count.must_equal 0
25
25
  end
26
+
27
+ it 'can get release by multi product_version' do
28
+ count = release.where(product_version: ["rhel-8","rhel-7"]).count
29
+ count.must_equal 8
30
+ end
26
31
  end # count
27
32
 
28
33
  describe '#brew' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sunil Thaha
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-01 00:00:00.000000000 Z
12
+ date: 2017-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -218,6 +218,7 @@ files:
218
218
  - spec/fixtures/vcr/caches_response_with_a_query.yml
219
219
  - spec/fixtures/vcr/caches_response_with_multiple_query.yml
220
220
  - spec/fixtures/vcr/caches_response_without_query.yml
221
+ - spec/fixtures/vcr/can_get_release_by_multi_product_version.yml
221
222
  - spec/fixtures/vcr/can_iterate_using_each.yml
222
223
  - spec/fixtures/vcr/content_delivery_repos_must_return_a_record.yml
223
224
  - spec/fixtures/vcr/fetches_variants_of_a_release.yml
@@ -287,6 +288,7 @@ test_files:
287
288
  - spec/fixtures/vcr/caches_response_with_a_query.yml
288
289
  - spec/fixtures/vcr/caches_response_with_multiple_query.yml
289
290
  - spec/fixtures/vcr/caches_response_without_query.yml
291
+ - spec/fixtures/vcr/can_get_release_by_multi_product_version.yml
290
292
  - spec/fixtures/vcr/can_iterate_using_each.yml
291
293
  - spec/fixtures/vcr/content_delivery_repos_must_return_a_record.yml
292
294
  - spec/fixtures/vcr/fetches_variants_of_a_release.yml