activesupport 4.1.14.2 → 4.1.15.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/active_support/gem_version.rb +2 -2
- data/lib/active_support/inflector/methods.rb +2 -2
- data/lib/active_support/logger.rb +14 -0
- data/lib/active_support/logger_silence.rb +24 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea4f01f2574cc981a54c304c53aff19c70d35d23
|
4
|
+
data.tar.gz: 640acc258adeaac97e6eb757c55c0f997e401fbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6cc8078948101ae3ea9cc55910bbde2473c24be3ed9f6740e92c8257d74fbfb06a51be4e6740f3d29b81aab67066a1ff22e9132c87d049f8660df1aa492363c
|
7
|
+
data.tar.gz: c45d751c229dd2717cc66424e973f1d2c3ac58e52a97fbea456bf28f715dc874f5d67b7c11ee31586231f293c463391c7f5c604703c3d83c1e622b1578074e49
|
data/CHANGELOG.md
CHANGED
@@ -280,8 +280,8 @@ module ActiveSupport
|
|
280
280
|
def safe_constantize(camel_cased_word)
|
281
281
|
constantize(camel_cased_word)
|
282
282
|
rescue NameError => e
|
283
|
-
raise
|
284
|
-
e.name.to_s == camel_cased_word.to_s
|
283
|
+
raise if e.name && !(camel_cased_word.to_s.split("::").include?(e.name.to_s) ||
|
284
|
+
e.name.to_s == camel_cased_word.to_s)
|
285
285
|
rescue ArgumentError => e
|
286
286
|
raise unless e.message =~ /not missing constant #{const_regexp(camel_cased_word)}\!$/
|
287
287
|
end
|
@@ -44,6 +44,20 @@ module ActiveSupport
|
|
44
44
|
def initialize(*args)
|
45
45
|
super
|
46
46
|
@formatter = SimpleFormatter.new
|
47
|
+
after_initialize if respond_to? :after_initialize
|
48
|
+
end
|
49
|
+
|
50
|
+
def add(severity, message = nil, progname = nil, &block)
|
51
|
+
return true if @logdev.nil? || (severity || UNKNOWN) < level
|
52
|
+
super
|
53
|
+
end
|
54
|
+
|
55
|
+
Logger::Severity.constants.each do |severity|
|
56
|
+
class_eval(<<-EOT, __FILE__, __LINE__ + 1)
|
57
|
+
def #{severity.downcase}? # def debug?
|
58
|
+
Logger::#{severity} >= level # DEBUG >= level
|
59
|
+
end # end
|
60
|
+
EOT
|
47
61
|
end
|
48
62
|
|
49
63
|
# Simple formatter which only displays the message.
|
@@ -1,24 +1,45 @@
|
|
1
1
|
require 'active_support/concern'
|
2
|
+
require 'thread_safe'
|
2
3
|
|
3
4
|
module LoggerSilence
|
4
5
|
extend ActiveSupport::Concern
|
5
6
|
|
6
7
|
included do
|
7
8
|
cattr_accessor :silencer
|
9
|
+
attr_reader :local_levels
|
8
10
|
self.silencer = true
|
9
11
|
end
|
10
12
|
|
13
|
+
|
14
|
+
def after_initialize
|
15
|
+
@local_levels = ThreadSafe::Cache.new(:initial_capacity => 2)
|
16
|
+
end
|
17
|
+
|
18
|
+
def local_log_id
|
19
|
+
Thread.current.__id__
|
20
|
+
end
|
21
|
+
|
22
|
+
def level
|
23
|
+
local_levels[local_log_id] || super
|
24
|
+
end
|
25
|
+
|
11
26
|
# Silences the logger for the duration of the block.
|
12
27
|
def silence(temporary_level = Logger::ERROR)
|
13
28
|
if silencer
|
14
29
|
begin
|
15
|
-
|
30
|
+
old_local_level = local_levels[local_log_id]
|
31
|
+
local_levels[local_log_id] = temporary_level
|
32
|
+
|
16
33
|
yield self
|
17
34
|
ensure
|
18
|
-
|
35
|
+
if old_local_level
|
36
|
+
local_levels[local_log_id] = old_local_level
|
37
|
+
else
|
38
|
+
local_levels.delete(local_log_id)
|
39
|
+
end
|
19
40
|
end
|
20
41
|
else
|
21
42
|
yield self
|
22
43
|
end
|
23
44
|
end
|
24
|
-
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.15.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -332,9 +332,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
332
332
|
version: 1.9.3
|
333
333
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
334
334
|
requirements:
|
335
|
-
- - "
|
335
|
+
- - ">"
|
336
336
|
- !ruby/object:Gem::Version
|
337
|
-
version:
|
337
|
+
version: 1.3.1
|
338
338
|
requirements: []
|
339
339
|
rubyforge_project:
|
340
340
|
rubygems_version: 2.5.1
|