rabbitmq_http_api_client 1.8.0 → 1.9.0

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
  SHA1:
3
- metadata.gz: 6d8ada29fcfb2d9ace237b89e6172fef52fadffb
4
- data.tar.gz: ff901540b1761cafcaf2004b8e9e9af74b52062e
3
+ metadata.gz: 689fb5a05c6fead2a4cb21bec129cb4be0a13041
4
+ data.tar.gz: a31f9a028e196524eff2670de85fdffd3740260f
5
5
  SHA512:
6
- metadata.gz: fc24be0290dc8a91da0d1f21bfb7bc06e4a0b1a57be2179474308b162d201e14f3f39f02ddb6928b2c7397daefd6fb3abce547d220b14bcb3817f3cd75b97269
7
- data.tar.gz: 8b9391797082f6fccd289e89af915268dac757a7422b8432e98ce3106fd48f003bd3d3f4ae4c23ce290fd89578ad3e5d9baf2f90e9fd13bbcf8e5f5276177d0f
6
+ metadata.gz: 02ea6b0b437ca540616eb474b558c09572d750ffc67fc2fa57ed4bb64f843e56dd250dca154c428318670493028c8c2d9923794a967e5273c05ba813f7e94c41
7
+ data.tar.gz: 7d5e0de0708c2d07baa06c74c246a994e9651044fd22604af3860535dedc7230bf5308074275e3029c5ed61a5952535ce10efcf2952fb674fddf757205e737cc
@@ -1,4 +1,19 @@
1
- ## Changes Between 1.7.0 and 1.8.0
1
+ ## Changes Between 1.8.0 and 1.9.0 (unreleased)
2
+
3
+ No changes yet.
4
+
5
+
6
+ ## Changes Between 1.8.0 and 1.9.0 (July 30th, 2017)
7
+
8
+ ### Make it Possible to Pass Faraday Adapter as Option
9
+
10
+ GitHub issue: [#30](https://github.com/ruby-amqp/rabbitmq_http_api_client/issues/30)
11
+
12
+ Contributed by Mrinmoy Das.
13
+
14
+
15
+
16
+ ## Changes Between 1.7.0 and 1.8.0 (Feb 1st, 2017)
2
17
 
3
18
  ### Correct URI Path Segment Encoding
4
19
 
data/Gemfile CHANGED
@@ -1,9 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  group :development, :test do
4
- gem "rspec", ">= 3.2.0"
4
+ gem "rspec", ">= 3.5.0"
5
5
  gem "json", :platform => :ruby_18
6
- gem "bunny", ">= 2.5.1"
6
+ gem "bunny", ">= 2.6.4"
7
7
 
8
8
  gem "rantly"
9
9
  end
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2013 Michael Klishin
1
+ Copyright (c) 2012-2017 Michael Klishin
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -31,15 +31,17 @@ All versions require [RabbitMQ Management UI plugin](http://www.rabbitmq.com/man
31
31
 
32
32
  Add this line to your application's Gemfile:
33
33
 
34
- gem 'rabbitmq_http_api_client', '>= 1.7.0'
34
+ ``` ruby
35
+ gem 'rabbitmq_http_api_client', '>= 1.8.0'
36
+ ```
35
37
 
36
38
  And then execute:
37
39
 
38
- $ bundle install
40
+ bundle install
39
41
 
40
42
  Or install it yourself as:
41
43
 
42
- $ gem install rabbitmq_http_api_client
44
+ gem install rabbitmq_http_api_client
43
45
 
44
46
  ## Usage
45
47
 
@@ -369,5 +371,5 @@ and rabbitmq-management plugin enabled.
369
371
 
370
372
  Double-licensed under the MIT and Mozilla Public License (same as RabbitMQ).
371
373
 
372
- (c) Michael S. Klishin, 2012-2016.
374
+ (c) Michael S. Klishin, 2012-2017.
373
375
 
@@ -404,6 +404,7 @@ module RabbitMQ
404
404
  user = uri.user || options.delete(:username) || "guest"
405
405
  password = uri.password || options.delete(:password) || "guest"
406
406
  options = options.merge(:url => uri.to_s)
407
+ adapter = options.delete(:adapter) || Faraday.default_adapter
407
408
 
408
409
  @connection = Faraday.new(options) do |conn|
409
410
  conn.basic_auth user, password
@@ -411,7 +412,7 @@ module RabbitMQ
411
412
  conn.use Faraday::Response::RaiseError
412
413
  conn.response :json, :content_type => /\bjson$/
413
414
 
414
- conn.adapter options.fetch(:adapter, Faraday.default_adapter)
415
+ conn.adapter adapter
415
416
  end
416
417
  end
417
418
 
@@ -1,7 +1,7 @@
1
1
  module RabbitMQ
2
2
  module HTTP
3
3
  class Client
4
- VERSION = "1.8.0"
4
+ VERSION = "1.9.0"
5
5
  end
6
6
  end
7
7
  end
@@ -890,6 +890,23 @@ describe RabbitMQ::HTTP::Client do
890
890
  subject.create_vhost(vhost)
891
891
  subject.delete_vhost(vhost)
892
892
  end
893
+
894
+ gen = Rantly.new
895
+ 200.times do
896
+ vhost = gen.string
897
+
898
+ context "when vhost #{vhost} is deleted immediately after being created" do
899
+ it "creates a vhost" do
900
+ subject.create_vhost(vhost)
901
+ subject.create_vhost(vhost)
902
+
903
+ v = subject.vhost_info(vhost)
904
+ expect(v.name).to eq(vhost)
905
+
906
+ subject.delete_vhost(v.name)
907
+ end
908
+ end
909
+ end
893
910
  end
894
911
 
895
912
  describe "GET /api/vhosts/:name/permissions" do
@@ -1046,4 +1063,17 @@ describe RabbitMQ::HTTP::Client do
1046
1063
  expect(r).to eq(true)
1047
1064
  end
1048
1065
  end
1066
+
1067
+ #
1068
+ # Accept Faraday adapter options
1069
+ #
1070
+ describe "connection accepts different faraday adapters" do
1071
+ it "accepts explicit adapter" do
1072
+ c = described_class.connect("http://guest:guest@127.0.0.1:15672/api",
1073
+ adapter: :net_http)
1074
+ r = c.overview
1075
+ expect(r.rabbitmq_version).to_not be_nil
1076
+ expect(r.erlang_version).to_not be_nil
1077
+ end
1078
+ end
1049
1079
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbitmq_http_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klishin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-01 00:00:00.000000000 Z
11
+ date: 2017-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.5.1
127
+ rubygems_version: 2.6.11
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: RabbitMQ HTTP API client for Ruby