right_support 2.8.36 → 2.8.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 695bd84c95a2c978873deaf2b85ac85e9f72a10c
4
+ data.tar.gz: 855562b8a7497925dfdc17951e852e8263724227
5
+ SHA512:
6
+ metadata.gz: acfa03c38cb1e5dd0edba374ffe3a3000b411415743d0a60a6f60866cd3515bd8445df5145995ec709117b4f8f083785298530209b2e5ddde7ec360cc5b2b2eb
7
+ data.tar.gz: 304ca6549fcbcdb76a4a7a53a71f18d90ddbe12d6600523a47523fde823bfb6c2d0a5474c74953ee84d2c0e9488f12fc46abba133b61484ad9e150fff04e68c6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.8.36
1
+ 2.8.37
@@ -124,6 +124,14 @@ module RightSupport::Net
124
124
 
125
125
  attr_reader :endpoints
126
126
 
127
+ # Return the actual, potentially DNS-resolved endpoints that are used for requests.
128
+ # If the balancer was constructed with :resolve=>false, return self.endpoints.
129
+ #
130
+ # @return [Array] collection of endpoints
131
+ def resolved_endpoints
132
+ (@ips.nil? || @ips.empty?) ? @endpoints : @ips
133
+ end
134
+
127
135
  def self.request(endpoints, options={}, &block)
128
136
  new(endpoints, options).request(&block)
129
137
  end
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: right_support 2.8.37 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "right_support"
8
- s.version = "2.8.36"
9
+ s.version = "2.8.37"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Tony Spataro", "Sergey Sergyenko", "Ryan Williamson", "Lee Kirchhoff", "Alexey Karpik", "Scott Messier"]
12
- s.date = "2014-11-18"
14
+ s.date = "2014-11-26"
13
15
  s.description = "A toolkit of useful, reusable foundation code created by RightScale."
14
16
  s.email = "support@rightscale.com"
15
17
  s.extra_rdoc_files = [
@@ -146,12 +148,11 @@ Gem::Specification.new do |s|
146
148
  ]
147
149
  s.homepage = "https://github.com/rightscale/right_support"
148
150
  s.licenses = ["MIT"]
149
- s.require_paths = ["lib"]
150
- s.rubygems_version = "1.8.23"
151
+ s.rubygems_version = "2.2.0"
151
152
  s.summary = "Reusable foundation code."
152
153
 
153
154
  if s.respond_to? :specification_version then
154
- s.specification_version = 3
155
+ s.specification_version = 4
155
156
 
156
157
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
157
158
  s.add_development_dependency(%q<rake>, ["~> 10.0"])
@@ -1,8 +1,41 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe RightSupport::Log::FilterLogger do
4
+ before :each do
5
+ @base_logger = mock_logger
6
+ @logger = RightSupport::Log::FilterLogger.new(@base_logger)
7
+ end
4
8
  it 'does method_missing correctly'
5
9
  it 'does respond_to? correctly'
6
- it 'transparently proxies Logger methods to underlying object'
7
- it 'filters log messages'
8
- end
10
+
11
+ context 'transparently proxies Logger severity-methods to underlying object' do
12
+ [:debug, :info, :warn, :error, :fatal].each do |method|
13
+ it ":#{method}" do
14
+ #@base_logger.should_receive(method).with('testing').once
15
+ @logger.__send__(method, "testing")
16
+ end
17
+ end
18
+ end
19
+
20
+ context 'transparently proxies Logger add method to underlying object' do
21
+ [:debug, :info, :warn, :error, :fatal].each do |method|
22
+ severity = RightSupport::Log::FilterLogger::SEVERITY_TO_METHOD.index(method)
23
+ it "add(#{method}, \t... ) With Message" do
24
+ @base_logger.should_receive(:add).with(severity, 'testing').once
25
+ @logger.add(severity, "testing")
26
+ end
27
+ it "add(#{method}, \t... ) With Block" do
28
+ @base_logger.should_receive(:add).with(severity, "testing").once
29
+ @logger.add(severity) {"testing"}
30
+ end
31
+ end
32
+ end
33
+ it 'filters log messages by severity'
34
+ it 'should always log a null or empty message' do
35
+ # Is this the behaviour we want?
36
+ @base_logger.should_receive(:info).twice
37
+ @logger.info(nil)
38
+ @logger.info("")
39
+ end
40
+
41
+ end
@@ -281,6 +281,10 @@ describe RightSupport::Net::RequestBalancer do
281
281
  @balancer.instance_variable_get("@ips").should include('2.2.2.2')
282
282
  @balancer.instance_variable_get("@ips").should include('3.3.3.3')
283
283
  end
284
+
285
+ it 'reports on the resolved endpoints' do
286
+ @balancer.resolved_endpoints.sort.should == ['1.1.1.1', '2.2.2.2', '3.3.3.3']
287
+ end
284
288
  end
285
289
  end
286
290
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.36
5
- prerelease:
4
+ version: 2.8.37
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tony Spataro
@@ -14,86 +13,76 @@ authors:
14
13
  autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
- date: 2014-11-18 00:00:00.000000000 Z
16
+ date: 2014-11-26 00:00:00.000000000 Z
18
17
  dependencies:
19
18
  - !ruby/object:Gem::Dependency
20
19
  name: rake
21
20
  requirement: !ruby/object:Gem::Requirement
22
- none: false
23
21
  requirements:
24
- - - ~>
22
+ - - "~>"
25
23
  - !ruby/object:Gem::Version
26
24
  version: '10.0'
27
25
  type: :development
28
26
  prerelease: false
29
27
  version_requirements: !ruby/object:Gem::Requirement
30
- none: false
31
28
  requirements:
32
- - - ~>
29
+ - - "~>"
33
30
  - !ruby/object:Gem::Version
34
31
  version: '10.0'
35
32
  - !ruby/object:Gem::Dependency
36
33
  name: jeweler
37
34
  requirement: !ruby/object:Gem::Requirement
38
- none: false
39
35
  requirements:
40
- - - ~>
36
+ - - "~>"
41
37
  - !ruby/object:Gem::Version
42
38
  version: '2.0'
43
39
  type: :development
44
40
  prerelease: false
45
41
  version_requirements: !ruby/object:Gem::Requirement
46
- none: false
47
42
  requirements:
48
- - - ~>
43
+ - - "~>"
49
44
  - !ruby/object:Gem::Version
50
45
  version: '2.0'
51
46
  - !ruby/object:Gem::Dependency
52
47
  name: ruby-debug
53
48
  requirement: !ruby/object:Gem::Requirement
54
- none: false
55
49
  requirements:
56
- - - ! '>='
50
+ - - ">="
57
51
  - !ruby/object:Gem::Version
58
52
  version: '0'
59
53
  type: :development
60
54
  prerelease: false
61
55
  version_requirements: !ruby/object:Gem::Requirement
62
- none: false
63
56
  requirements:
64
- - - ! '>='
57
+ - - ">="
65
58
  - !ruby/object:Gem::Version
66
59
  version: '0'
67
60
  - !ruby/object:Gem::Dependency
68
61
  name: pry
69
62
  requirement: !ruby/object:Gem::Requirement
70
- none: false
71
63
  requirements:
72
- - - ! '>='
64
+ - - ">="
73
65
  - !ruby/object:Gem::Version
74
66
  version: '0'
75
67
  type: :development
76
68
  prerelease: false
77
69
  version_requirements: !ruby/object:Gem::Requirement
78
- none: false
79
70
  requirements:
80
- - - ! '>='
71
+ - - ">="
81
72
  - !ruby/object:Gem::Version
82
73
  version: '0'
83
74
  - !ruby/object:Gem::Dependency
84
75
  name: pry-byebug
85
76
  requirement: !ruby/object:Gem::Requirement
86
- none: false
87
77
  requirements:
88
- - - ! '>='
78
+ - - ">="
89
79
  - !ruby/object:Gem::Version
90
80
  version: '0'
91
81
  type: :development
92
82
  prerelease: false
93
83
  version_requirements: !ruby/object:Gem::Requirement
94
- none: false
95
84
  requirements:
96
- - - ! '>='
85
+ - - ">="
97
86
  - !ruby/object:Gem::Version
98
87
  version: '0'
99
88
  description: A toolkit of useful, reusable foundation code created by RightScale.
@@ -104,10 +93,10 @@ extra_rdoc_files:
104
93
  - LICENSE
105
94
  - README.md
106
95
  files:
107
- - .coveralls.yml
108
- - .rspec
109
- - .simplecov
110
- - .travis.yml
96
+ - ".coveralls.yml"
97
+ - ".rspec"
98
+ - ".simplecov"
99
+ - ".travis.yml"
111
100
  - CHANGELOG.rdoc
112
101
  - Gemfile
113
102
  - Gemfile.lock
@@ -233,29 +222,25 @@ files:
233
222
  homepage: https://github.com/rightscale/right_support
234
223
  licenses:
235
224
  - MIT
225
+ metadata: {}
236
226
  post_install_message:
237
227
  rdoc_options: []
238
228
  require_paths:
239
229
  - lib
240
230
  required_ruby_version: !ruby/object:Gem::Requirement
241
- none: false
242
231
  requirements:
243
- - - ! '>='
232
+ - - ">="
244
233
  - !ruby/object:Gem::Version
245
234
  version: '0'
246
- segments:
247
- - 0
248
- hash: -3247930919812590420
249
235
  required_rubygems_version: !ruby/object:Gem::Requirement
250
- none: false
251
236
  requirements:
252
- - - ! '>='
237
+ - - ">="
253
238
  - !ruby/object:Gem::Version
254
239
  version: '0'
255
240
  requirements: []
256
241
  rubyforge_project:
257
- rubygems_version: 1.8.23
242
+ rubygems_version: 2.2.0
258
243
  signing_key:
259
- specification_version: 3
244
+ specification_version: 4
260
245
  summary: Reusable foundation code.
261
246
  test_files: []