activesupport 3.0.0.rc2 → 3.0.0
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.
- data/CHANGELOG +3 -16
- data/lib/active_support/cache.rb +8 -1
- data/lib/active_support/callbacks.rb +1 -1
- data/lib/active_support/core_ext/string.rb +2 -1
- data/lib/active_support/core_ext/string/inflections.rb +2 -0
- data/lib/active_support/core_ext/string/strip.rb +24 -0
- data/lib/active_support/deprecation/reporting.rb +8 -4
- data/lib/active_support/version.rb +1 -2
- metadata +9 -11
data/CHANGELOG
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
*Rails 3.0.0
|
1
|
+
*Rails 3.0.0 (August 29, 2010)*
|
2
2
|
|
3
|
-
*
|
3
|
+
* Implemented String#strip_heredoc. [fxn]
|
4
4
|
|
5
|
-
|
6
|
-
*Rails 3.0.0 [release candidate] (July 26th, 2010)*
|
5
|
+
* Pluggable cache stores: setting config.cache_store = "custom_store" will require 'active_support/cache/custom_store' and look for the CustomStore constant. #5486 [Mike Perham]
|
7
6
|
|
8
7
|
* Removed Object#returning, Object#tap should be used instead. [Santiago Pastorino]
|
9
8
|
|
@@ -23,9 +22,6 @@
|
|
23
22
|
|
24
23
|
* Date#since, #ago, #beginning_of_day, #end_of_day, and #xmlschema honor now the user time zone if set. [Geoff Buesing]
|
25
24
|
|
26
|
-
|
27
|
-
*Rails 3.0.0 [beta 4] (June 8th, 2010)*
|
28
|
-
|
29
25
|
* Extracted String#truncate from TextHelper#truncate [DHH]
|
30
26
|
|
31
27
|
* Ruby 1.9: support UTF-8 case folding. #4595 [Norman Clarke]
|
@@ -78,18 +74,12 @@
|
|
78
74
|
|
79
75
|
* JSON: encode objects that don't have a native JSON representation using to_hash, if available, instead of instance_values (the old fallback) or to_s (other encoders' default). Encode BigDecimal and Regexp encode as strings to conform with other encoders. Try to transcode non-UTF-8 strings. [Jeremy Kemper]
|
80
76
|
|
81
|
-
|
82
|
-
*Rails 3.0.0 [beta 3] (April 13th, 2010)*
|
83
|
-
|
84
77
|
* HashWithIndifferentAccess: remove inherited symbolize_keys! since its keys are always strings. [Santiago Pastorino]
|
85
78
|
|
86
79
|
* Improve transliteration quality. #4374 [Norman Clarke]
|
87
80
|
|
88
81
|
* Speed up and add Ruby 1.9 support for ActiveSupport::Multibyte::Chars#tidy_bytes. #4350 [Norman Clarke]
|
89
82
|
|
90
|
-
|
91
|
-
*Rails 3.0.0 [beta 2] (April 1st, 2010)*
|
92
|
-
|
93
83
|
* Reduced load time by deferring configuration of classes using
|
94
84
|
ActiveSupport::on_load(:component_name) [YK]
|
95
85
|
|
@@ -101,9 +91,6 @@
|
|
101
91
|
|
102
92
|
* JSON backend for YAJL. Preferred if available. #2666 [Brian Lopez]
|
103
93
|
|
104
|
-
|
105
|
-
*Rails 3.0.0 [beta 1] (February 4, 2010)*
|
106
|
-
|
107
94
|
* Introduce class_attribute to declare inheritable class attributes. Writing an attribute on a subclass behaves just like overriding the superclass reader method. Unifies and replaces most usage of cattr_accessor, class_inheritable_attribute, superclass_delegating_attribute, and extlib_inheritable_attribute. [Jeremy Kemper, Yehuda Katz]
|
108
95
|
|
109
96
|
* Time#- with a DateTime argument behaves the same as with a Time argument, i.e. returns the difference between self and arg as a Float #3476 [Geoff Buesing]
|
data/lib/active_support/cache.rb
CHANGED
@@ -58,7 +58,14 @@ module ActiveSupport
|
|
58
58
|
case store
|
59
59
|
when Symbol
|
60
60
|
store_class_name = store.to_s.camelize
|
61
|
-
store_class =
|
61
|
+
store_class =
|
62
|
+
begin
|
63
|
+
require "active_support/cache/#{store}"
|
64
|
+
rescue LoadError
|
65
|
+
raise "Could not find cache store adapter for #{store} (#{$!})"
|
66
|
+
else
|
67
|
+
ActiveSupport::Cache.const_get(store_class_name)
|
68
|
+
end
|
62
69
|
store_class.new(*parameters)
|
63
70
|
when nil
|
64
71
|
ActiveSupport::Cache::MemoryStore.new
|
@@ -5,7 +5,7 @@ require 'active_support/core_ext/kernel/reporting'
|
|
5
5
|
require 'active_support/core_ext/kernel/singleton_class'
|
6
6
|
|
7
7
|
module ActiveSupport
|
8
|
-
# Callbacks are hooks into the
|
8
|
+
# Callbacks are hooks into the life cycle of an object that allow you to trigger logic
|
9
9
|
# before or after an alteration of the object state.
|
10
10
|
#
|
11
11
|
# Mixing in this module allows you to define callbacks in your class.
|
@@ -9,4 +9,5 @@ require 'active_support/core_ext/string/behavior'
|
|
9
9
|
require 'active_support/core_ext/string/interpolation'
|
10
10
|
require 'active_support/core_ext/string/output_safety'
|
11
11
|
require 'active_support/core_ext/string/exclude'
|
12
|
-
require 'active_support/core_ext/string/encoding'
|
12
|
+
require 'active_support/core_ext/string/encoding'
|
13
|
+
require 'active_support/core_ext/string/strip'
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'active_support/inflector/methods'
|
2
2
|
require 'active_support/inflector/inflections'
|
3
|
+
require 'active_support/inflector/transliterate'
|
4
|
+
|
3
5
|
# String inflections define new methods on the String class to transform names for different purposes.
|
4
6
|
# For instance, you can figure out the name of a database from the name of a class.
|
5
7
|
#
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class String
|
2
|
+
# Strips indentation in heredocs.
|
3
|
+
#
|
4
|
+
# For example in
|
5
|
+
#
|
6
|
+
# if options[:usage]
|
7
|
+
# puts <<-USAGE.strip_heredoc
|
8
|
+
# This command does such and such.
|
9
|
+
#
|
10
|
+
# Supported options are:
|
11
|
+
# -h This message
|
12
|
+
# ...
|
13
|
+
# USAGE
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# the user would see the usage message aligned against the left margin.
|
17
|
+
#
|
18
|
+
# Technically, it looks for the least indented line in the whole string, and removes
|
19
|
+
# that amount of leading whitespace.
|
20
|
+
def strip_heredoc
|
21
|
+
indent = chomp.scan(/^\s*/).min.size
|
22
|
+
gsub(/^\s{#{indent}}/, '')
|
23
|
+
end
|
24
|
+
end
|
@@ -46,10 +46,14 @@ module ActiveSupport
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def extract_callstack(callstack)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
rails_gem_root = File.expand_path("../../../../..", __FILE__) + "/"
|
50
|
+
offending_line = callstack.find { |line| !line.start_with?(rails_gem_root) } || callstack.first
|
51
|
+
if offending_line
|
52
|
+
if md = offending_line.match(/^(.+?):(\d+)(?::in `(.*?)')?/)
|
53
|
+
md.captures
|
54
|
+
else
|
55
|
+
offending_line
|
56
|
+
end
|
53
57
|
end
|
54
58
|
end
|
55
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 7
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
9
|
- 0
|
10
|
-
|
11
|
-
version: 3.0.0.rc2
|
10
|
+
version: 3.0.0
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- David Heinemeier Hansson
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-29 00:00:00 -05:00
|
20
19
|
default_executable:
|
21
20
|
dependencies: []
|
22
21
|
|
@@ -154,6 +153,7 @@ files:
|
|
154
153
|
- lib/active_support/core_ext/string/multibyte.rb
|
155
154
|
- lib/active_support/core_ext/string/output_safety.rb
|
156
155
|
- lib/active_support/core_ext/string/starts_ends_with.rb
|
156
|
+
- lib/active_support/core_ext/string/strip.rb
|
157
157
|
- lib/active_support/core_ext/string/xchar.rb
|
158
158
|
- lib/active_support/core_ext/string.rb
|
159
159
|
- lib/active_support/core_ext/time/acts_like.rb
|
@@ -260,14 +260,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
260
260
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
261
261
|
none: false
|
262
262
|
requirements:
|
263
|
-
- - "
|
263
|
+
- - ">="
|
264
264
|
- !ruby/object:Gem::Version
|
265
|
-
hash:
|
265
|
+
hash: 3
|
266
266
|
segments:
|
267
|
-
-
|
268
|
-
|
269
|
-
- 1
|
270
|
-
version: 1.3.1
|
267
|
+
- 0
|
268
|
+
version: "0"
|
271
269
|
requirements: []
|
272
270
|
|
273
271
|
rubyforge_project: activesupport
|