right_support 2.8.23 → 2.8.24
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/right_support/log/mixin.rb +7 -2
- data/right_support.gemspec +15 -11
- data/spec/log/mixin_spec.rb +21 -0
- metadata +93 -78
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.8.
|
1
|
+
2.8.24
|
@@ -59,6 +59,11 @@ module RightSupport::Log
|
|
59
59
|
# processor.logger = Logger.new(File.open("#{processor.object_id}.log", 'w'))
|
60
60
|
#
|
61
61
|
module Mixin
|
62
|
+
# List of base classes to which a class-level .logger call is NEVER delegated, even if the base
|
63
|
+
# class object responds to .logger; this protects against other metaprogramming that defines
|
64
|
+
# Class#logger or Object#logger.
|
65
|
+
UNDELEGATED = [Class, Object]
|
66
|
+
|
62
67
|
# A decorator class which will be wrapped around any logger that is
|
63
68
|
# provided to any of the setter methods. This ensures that ExceptionLogger's
|
64
69
|
# methods will always be available to anyone who uses this mixin for logging.
|
@@ -69,8 +74,8 @@ module RightSupport::Log
|
|
69
74
|
def logger
|
70
75
|
if @logger
|
71
76
|
@logger
|
72
|
-
elsif respond_to?(:superclass) && superclass.respond_to?(:logger) && superclass.logger
|
73
|
-
|
77
|
+
elsif scl = (respond_to?(:superclass) && superclass.respond_to?(:logger) && !UNDELEGATED.include?(superclass) && superclass.logger)
|
78
|
+
scl
|
74
79
|
else
|
75
80
|
RightSupport::Log::Mixin.default_logger
|
76
81
|
end
|
data/right_support.gemspec
CHANGED
@@ -4,14 +4,14 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "2.8.
|
7
|
+
s.name = %q{right_support}
|
8
|
+
s.version = "2.8.24"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tony Spataro", "Sergey Sergyenko", "Ryan Williamson", "Lee Kirchhoff", "Alexey Karpik", "Scott Messier"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = %q{2014-06-23}
|
13
|
+
s.description = %q{A toolkit of useful, reusable foundation code created by RightScale.}
|
14
|
+
s.email = %q{support@rightscale.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
17
|
"README.rdoc"
|
@@ -136,31 +136,35 @@ Gem::Specification.new do |s|
|
|
136
136
|
"spec/validation/openssl_spec.rb",
|
137
137
|
"spec/validation/ssh_spec.rb"
|
138
138
|
]
|
139
|
-
s.homepage =
|
139
|
+
s.homepage = %q{https://github.com/rightscale/right_support}
|
140
140
|
s.licenses = ["MIT"]
|
141
141
|
s.require_paths = ["lib"]
|
142
|
-
s.rubygems_version =
|
143
|
-
s.summary =
|
142
|
+
s.rubygems_version = %q{1.3.7}
|
143
|
+
s.summary = %q{Reusable foundation code.}
|
144
144
|
|
145
145
|
if s.respond_to? :specification_version then
|
146
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
146
147
|
s.specification_version = 3
|
147
148
|
|
148
149
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
149
150
|
s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
|
150
151
|
s.add_development_dependency(%q<flexmock>, ["~> 1.0"])
|
151
152
|
s.add_development_dependency(%q<rspec>, ["~> 2.13.0"])
|
152
|
-
s.add_development_dependency(%q<cucumber>, ["
|
153
|
+
s.add_development_dependency(%q<cucumber>, ["~> 1.0", "< 1.3.3"])
|
154
|
+
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
153
155
|
else
|
154
156
|
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
155
157
|
s.add_dependency(%q<flexmock>, ["~> 1.0"])
|
156
158
|
s.add_dependency(%q<rspec>, ["~> 2.13.0"])
|
157
|
-
s.add_dependency(%q<cucumber>, ["
|
159
|
+
s.add_dependency(%q<cucumber>, ["~> 1.0", "< 1.3.3"])
|
160
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
158
161
|
end
|
159
162
|
else
|
160
163
|
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
161
164
|
s.add_dependency(%q<flexmock>, ["~> 1.0"])
|
162
165
|
s.add_dependency(%q<rspec>, ["~> 2.13.0"])
|
163
|
-
s.add_dependency(%q<cucumber>, ["
|
166
|
+
s.add_dependency(%q<cucumber>, ["~> 1.0", "< 1.3.3"])
|
167
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
164
168
|
end
|
165
169
|
end
|
166
170
|
|
data/spec/log/mixin_spec.rb
CHANGED
@@ -117,4 +117,25 @@ describe RightSupport::Log::Mixin do
|
|
117
117
|
Bystander.logger.error('foo')
|
118
118
|
end
|
119
119
|
end
|
120
|
+
|
121
|
+
context 'given someone has defined Class#logger' do
|
122
|
+
before(:all) do
|
123
|
+
InnocentVictim.logger = nil
|
124
|
+
class Class
|
125
|
+
def logger
|
126
|
+
raise "THIS SHOULD NEVER BE CALLED"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
after(:all) do
|
132
|
+
class Class
|
133
|
+
remove_method :logger
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
it 'should never delegate to Class#logger' do
|
138
|
+
InnocentVictim.logger.info 'test log'
|
139
|
+
end
|
140
|
+
end
|
120
141
|
end
|
metadata
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_support
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 8
|
9
|
+
- 24
|
10
|
+
version: 2.8.24
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Tony Spataro
|
9
14
|
- Sergey Sergyenko
|
10
15
|
- Ryan Williamson
|
@@ -14,86 +19,89 @@ authors:
|
|
14
19
|
autorequire:
|
15
20
|
bindir: bin
|
16
21
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
+
|
23
|
+
date: 2014-06-24 00:00:00 -07:00
|
24
|
+
default_executable:
|
25
|
+
dependencies:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
28
|
none: false
|
23
|
-
requirements:
|
29
|
+
requirements:
|
24
30
|
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
|
27
|
-
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
hash: 3
|
33
|
+
segments:
|
34
|
+
- 2
|
35
|
+
- 0
|
36
|
+
version: "2.0"
|
37
|
+
name: jeweler
|
38
|
+
requirement: *id001
|
28
39
|
prerelease: false
|
29
|
-
|
40
|
+
type: :development
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
30
43
|
none: false
|
31
|
-
requirements:
|
44
|
+
requirements:
|
32
45
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
|
35
|
-
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
hash: 15
|
48
|
+
segments:
|
49
|
+
- 1
|
50
|
+
- 0
|
51
|
+
version: "1.0"
|
36
52
|
name: flexmock
|
37
|
-
requirement:
|
38
|
-
none: false
|
39
|
-
requirements:
|
40
|
-
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '1.0'
|
43
|
-
type: :development
|
53
|
+
requirement: *id002
|
44
54
|
prerelease: false
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
- - ~>
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: '1.0'
|
51
|
-
- !ruby/object:Gem::Dependency
|
52
|
-
name: rspec
|
53
|
-
requirement: !ruby/object:Gem::Requirement
|
55
|
+
type: :development
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
58
|
none: false
|
55
|
-
requirements:
|
59
|
+
requirements:
|
56
60
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 59
|
63
|
+
segments:
|
64
|
+
- 2
|
65
|
+
- 13
|
66
|
+
- 0
|
58
67
|
version: 2.13.0
|
59
|
-
|
68
|
+
name: rspec
|
69
|
+
requirement: *id003
|
60
70
|
prerelease: false
|
61
|
-
|
71
|
+
type: :development
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
62
74
|
none: false
|
63
|
-
requirements:
|
75
|
+
requirements:
|
64
76
|
- - ~>
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
requirements:
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
hash: 15
|
79
|
+
segments:
|
80
|
+
- 1
|
81
|
+
- 0
|
82
|
+
version: "1.0"
|
72
83
|
- - <
|
73
|
-
- !ruby/object:Gem::Version
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 29
|
86
|
+
segments:
|
87
|
+
- 1
|
88
|
+
- 3
|
89
|
+
- 3
|
74
90
|
version: 1.3.3
|
75
|
-
|
76
|
-
|
77
|
-
version: '1.0'
|
78
|
-
type: :development
|
91
|
+
name: cucumber
|
92
|
+
requirement: *id004
|
79
93
|
prerelease: false
|
80
|
-
|
81
|
-
none: false
|
82
|
-
requirements:
|
83
|
-
- - <
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 1.3.3
|
86
|
-
- - ~>
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '1.0'
|
94
|
+
type: :development
|
89
95
|
description: A toolkit of useful, reusable foundation code created by RightScale.
|
90
96
|
email: support@rightscale.com
|
91
97
|
executables: []
|
98
|
+
|
92
99
|
extensions: []
|
93
|
-
|
100
|
+
|
101
|
+
extra_rdoc_files:
|
94
102
|
- LICENSE
|
95
103
|
- README.rdoc
|
96
|
-
files:
|
104
|
+
files:
|
97
105
|
- .rspec
|
98
106
|
- CHANGELOG.rdoc
|
99
107
|
- Gemfile
|
@@ -212,32 +220,39 @@ files:
|
|
212
220
|
- spec/stats/helpers_spec.rb
|
213
221
|
- spec/validation/openssl_spec.rb
|
214
222
|
- spec/validation/ssh_spec.rb
|
223
|
+
has_rdoc: true
|
215
224
|
homepage: https://github.com/rightscale/right_support
|
216
|
-
licenses:
|
225
|
+
licenses:
|
217
226
|
- MIT
|
218
227
|
post_install_message:
|
219
228
|
rdoc_options: []
|
220
|
-
|
229
|
+
|
230
|
+
require_paths:
|
221
231
|
- lib
|
222
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
232
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
223
233
|
none: false
|
224
|
-
requirements:
|
225
|
-
- -
|
226
|
-
- !ruby/object:Gem::Version
|
227
|
-
|
228
|
-
segments:
|
234
|
+
requirements:
|
235
|
+
- - ">="
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
hash: 3
|
238
|
+
segments:
|
229
239
|
- 0
|
230
|
-
|
231
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
|
+
version: "0"
|
241
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
232
242
|
none: false
|
233
|
-
requirements:
|
234
|
-
- -
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
|
243
|
+
requirements:
|
244
|
+
- - ">="
|
245
|
+
- !ruby/object:Gem::Version
|
246
|
+
hash: 3
|
247
|
+
segments:
|
248
|
+
- 0
|
249
|
+
version: "0"
|
237
250
|
requirements: []
|
251
|
+
|
238
252
|
rubyforge_project:
|
239
|
-
rubygems_version: 1.
|
253
|
+
rubygems_version: 1.3.7
|
240
254
|
signing_key:
|
241
255
|
specification_version: 3
|
242
256
|
summary: Reusable foundation code.
|
243
257
|
test_files: []
|
258
|
+
|