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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3d4bf97e65bd0615e763a93dc4a272de6d44f46
4
- data.tar.gz: 35c23b5746259a6a815196a6988d6acfd2a47ae3
3
+ metadata.gz: ea4f01f2574cc981a54c304c53aff19c70d35d23
4
+ data.tar.gz: 640acc258adeaac97e6eb757c55c0f997e401fbe
5
5
  SHA512:
6
- metadata.gz: 75e7c00b21b75f0ff8670a15f474f684294752fd62ff49a7429c96baf6c60e1daa736061ed3f460cc90400eac45c875a8a5b79f30b468ee21bddb2ec1a01c4a7
7
- data.tar.gz: 48abd058dc546bcdecbf41cb3396814e252c5e2bc6a9d5f7c1657375a6de95f44719ae2a715101170044d44f525075fafa0423a7f9b744465ec9e2f4e20cbecf
6
+ metadata.gz: f6cc8078948101ae3ea9cc55910bbde2473c24be3ed9f6740e92c8257d74fbfb06a51be4e6740f3d29b81aab67066a1ff22e9132c87d049f8660df1aa492363c
7
+ data.tar.gz: c45d751c229dd2717cc66424e973f1d2c3ac58e52a97fbea456bf28f715dc874f5d67b7c11ee31586231f293c463391c7f5c604703c3d83c1e622b1578074e49
@@ -1,3 +1,8 @@
1
+ ## Rails 4.1.15.rc1 (March 01, 2016) ##
2
+
3
+ * No changes.
4
+
5
+
1
6
  ## Rails 4.1.14.2 (February 26, 2016) ##
2
7
 
3
8
  * No changes.
@@ -7,8 +7,8 @@ module ActiveSupport
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
- TINY = 14
11
- PRE = "2"
10
+ TINY = 15
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -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 unless e.message =~ /(uninitialized constant|wrong constant name) #{const_regexp(camel_cased_word)}$/ ||
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
- old_logger_level, self.level = level, temporary_level
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
- self.level = old_logger_level
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.14.2
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-02-29 00:00:00.000000000 Z
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: '0'
337
+ version: 1.3.1
338
338
  requirements: []
339
339
  rubyforge_project:
340
340
  rubygems_version: 2.5.1