activesupport 3.1.1.rc1 → 3.1.1.rc2

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.

@@ -13,6 +13,7 @@ module ActiveSupport
13
13
  attr_reader :cache_path
14
14
 
15
15
  DIR_FORMATTER = "%03X"
16
+ FILENAME_MAX_SIZE = 230 # max filename size on file system is 255, minus room for timestamp and random characters appended by Tempfile (used by atomic write)
16
17
 
17
18
  def initialize(cache_path, options = nil)
18
19
  super(options)
@@ -141,15 +142,13 @@ module ActiveSupport
141
142
  hash, dir_1 = hash.divmod(0x1000)
142
143
  dir_2 = hash.modulo(0x1000)
143
144
  fname_paths = []
144
- # Make sure file name is < 255 characters so it doesn't exceed file system limits.
145
- if fname.size <= 255
146
- fname_paths << fname
147
- else
148
- while fname.size <= 255
149
- fname_path << fname[0, 255]
150
- fname = fname[255, -1]
151
- end
152
- end
145
+
146
+ # Make sure file name doesn't exceed file system limits.
147
+ begin
148
+ fname_paths << fname[0, FILENAME_MAX_SIZE]
149
+ fname = fname[FILENAME_MAX_SIZE..-1]
150
+ end until fname.blank?
151
+
153
152
  File.join(cache_path, DIR_FORMATTER % dir_1, DIR_FORMATTER % dir_2, *fname_paths)
154
153
  end
155
154
 
@@ -7,7 +7,7 @@ class Object
7
7
  # Note: This method is defined as a default implementation for all Objects for Hash#to_query to work.
8
8
  def to_query(key)
9
9
  require 'cgi' unless defined?(CGI) && defined?(CGI::escape)
10
- "#{CGI.escape(key.to_s)}=#{CGI.escape(to_param.to_s)}"
10
+ "#{CGI.escape(key.to_param)}=#{CGI.escape(to_param.to_s)}"
11
11
  end
12
12
  end
13
13
 
@@ -20,7 +20,7 @@ class ERB
20
20
  if s.html_safe?
21
21
  s
22
22
  else
23
- s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;").html_safe
23
+ s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;").html_safe
24
24
  end
25
25
  end
26
26
 
@@ -136,7 +136,7 @@ module ActiveSupport #:nodoc:
136
136
  end
137
137
 
138
138
  for unsafe_method in UNSAFE_STRING_METHODS
139
- class_eval <<-EOT, __FILE__, __LINE__
139
+ class_eval <<-EOT, __FILE__, __LINE__ + 1
140
140
  def #{unsafe_method}(*args)
141
141
  super.to_str
142
142
  end
@@ -3,7 +3,7 @@ module ActiveSupport
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
5
  TINY = 1
6
- PRE = "rc1"
6
+ PRE = "rc2"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  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
- hash: 977940594
4
+ hash: 977940595
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
9
  - 1
10
- - rc1
11
- version: 3.1.1.rc1
10
+ - rc2
11
+ version: 3.1.1.rc2
12
12
  platform: ruby
13
13
  authors:
14
14
  - David Heinemeier Hansson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-09-14 00:00:00 -07:00
19
+ date: 2011-09-29 00:00:00 -03:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency