activesupport 1.2.5 → 1.3.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 +163 -4
- data/lib/active_support.rb +8 -3
- data/lib/active_support/breakpoint.rb +1 -1
- data/lib/active_support/caching_tools.rb +62 -0
- data/lib/active_support/clean_logger.rb +3 -1
- data/lib/active_support/core_ext/array.rb +16 -0
- data/lib/active_support/core_ext/array/conversions.rb +18 -2
- data/lib/active_support/core_ext/blank.rb +14 -2
- data/lib/active_support/core_ext/class.rb +3 -0
- data/lib/active_support/core_ext/class/attribute_accessors.rb +44 -0
- data/lib/active_support/{class_inheritable_attributes.rb → core_ext/class/inheritable_attributes.rb} +2 -4
- data/lib/active_support/core_ext/class/removal.rb +24 -0
- data/lib/active_support/core_ext/date/conversions.rb +2 -0
- data/lib/active_support/core_ext/enumerable.rb +23 -1
- data/lib/active_support/core_ext/exception.rb +0 -1
- data/lib/active_support/core_ext/hash.rb +4 -0
- data/lib/active_support/core_ext/hash/conversions.rb +44 -0
- data/lib/active_support/core_ext/hash/diff.rb +11 -0
- data/lib/active_support/core_ext/hash/indifferent_access.rb +23 -4
- data/lib/active_support/core_ext/integer/inflections.rb +1 -1
- data/lib/active_support/core_ext/kernel.rb +4 -79
- data/lib/active_support/core_ext/kernel/agnostics.rb +11 -0
- data/lib/active_support/core_ext/kernel/daemonizing.rb +15 -0
- data/lib/active_support/core_ext/kernel/reporting.rb +51 -0
- data/lib/active_support/core_ext/kernel/requires.rb +24 -0
- data/lib/active_support/core_ext/logger.rb +16 -0
- data/lib/active_support/core_ext/module.rb +5 -0
- data/lib/active_support/core_ext/module/attribute_accessors.rb +44 -0
- data/lib/active_support/core_ext/module/delegation.rb +16 -0
- data/lib/active_support/core_ext/module/inclusion.rb +11 -0
- data/lib/active_support/core_ext/module/introspection.rb +21 -0
- data/lib/active_support/core_ext/module/loading.rb +13 -0
- data/lib/active_support/core_ext/numeric/time.rb +14 -1
- data/lib/active_support/core_ext/object.rb +2 -0
- data/lib/active_support/core_ext/object/extending.rb +47 -0
- data/lib/active_support/core_ext/object/misc.rb +34 -0
- data/lib/active_support/core_ext/proc.rb +12 -0
- data/lib/active_support/core_ext/string.rb +2 -0
- data/lib/active_support/core_ext/string/access.rb +2 -2
- data/lib/active_support/core_ext/string/inflections.rb +10 -3
- data/lib/active_support/core_ext/string/iterators.rb +17 -0
- data/lib/active_support/core_ext/symbol.rb +5 -0
- data/lib/active_support/core_ext/time/calculations.rb +15 -0
- data/lib/active_support/core_ext/time/conversions.rb +1 -0
- data/lib/active_support/dependencies.rb +81 -159
- data/lib/active_support/inflections.rb +48 -48
- data/lib/active_support/inflector.rb +17 -5
- data/lib/active_support/json.rb +37 -0
- data/lib/active_support/json/encoders.rb +25 -0
- data/lib/active_support/json/encoders/core.rb +65 -0
- data/lib/active_support/option_merger.rb +25 -0
- data/lib/active_support/ordered_options.rb +23 -11
- data/lib/active_support/reloadable.rb +30 -0
- data/lib/active_support/vendor/builder.rb +13 -0
- data/lib/active_support/vendor/builder/blankslate.rb +53 -0
- data/lib/active_support/vendor/builder/xmlbase.rb +143 -0
- data/lib/active_support/vendor/builder/xmlevents.rb +63 -0
- data/lib/active_support/vendor/builder/xmlmarkup.rb +308 -0
- data/lib/active_support/version.rb +2 -2
- metadata +113 -69
- data/lib/active_support/class_attribute_accessors.rb +0 -57
- data/lib/active_support/core_ext/object_and_class.rb +0 -44
- data/lib/active_support/module_attribute_accessors.rb +0 -57
metadata
CHANGED
@@ -3,11 +3,11 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: activesupport
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.
|
7
|
-
date:
|
6
|
+
version: 1.3.0
|
7
|
+
date: 2006-03-27 00:00:00 -06:00
|
8
8
|
summary: Support and utility classes used by the Rails framework.
|
9
9
|
require_paths:
|
10
|
-
|
10
|
+
- lib
|
11
11
|
email: david@loudthinking.com
|
12
12
|
homepage: http://www.rubyonrails.org
|
13
13
|
rubyforge_project: activesupport
|
@@ -18,81 +18,125 @@ bindir: bin
|
|
18
18
|
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
version: 0.0.0
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
25
24
|
version:
|
26
25
|
platform: ruby
|
27
26
|
signing_key:
|
28
27
|
cert_chain:
|
29
28
|
authors:
|
30
|
-
|
29
|
+
- David Heinemeier Hansson
|
31
30
|
files:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
31
|
+
- CHANGELOG
|
32
|
+
- lib/active_support
|
33
|
+
- lib/active_support.rb
|
34
|
+
- lib/active_support/binding_of_caller.rb
|
35
|
+
- lib/active_support/breakpoint.rb
|
36
|
+
- lib/active_support/caching_tools.rb
|
37
|
+
- lib/active_support/clean_logger.rb
|
38
|
+
- lib/active_support/core_ext
|
39
|
+
- lib/active_support/core_ext.rb
|
40
|
+
- lib/active_support/dependencies.rb
|
41
|
+
- lib/active_support/inflections.rb
|
42
|
+
- lib/active_support/inflector.rb
|
43
|
+
- lib/active_support/json
|
44
|
+
- lib/active_support/json.rb
|
45
|
+
- lib/active_support/option_merger.rb
|
46
|
+
- lib/active_support/ordered_options.rb
|
47
|
+
- lib/active_support/reloadable.rb
|
48
|
+
- lib/active_support/values
|
49
|
+
- lib/active_support/vendor
|
50
|
+
- lib/active_support/version.rb
|
51
|
+
- lib/active_support/whiny_nil.rb
|
52
|
+
- lib/active_support/core_ext/array
|
53
|
+
- lib/active_support/core_ext/array.rb
|
54
|
+
- lib/active_support/core_ext/blank.rb
|
55
|
+
- lib/active_support/core_ext/cgi
|
56
|
+
- lib/active_support/core_ext/cgi.rb
|
57
|
+
- lib/active_support/core_ext/class
|
58
|
+
- lib/active_support/core_ext/class.rb
|
59
|
+
- lib/active_support/core_ext/date
|
60
|
+
- lib/active_support/core_ext/date.rb
|
61
|
+
- lib/active_support/core_ext/enumerable.rb
|
62
|
+
- lib/active_support/core_ext/exception.rb
|
63
|
+
- lib/active_support/core_ext/hash
|
64
|
+
- lib/active_support/core_ext/hash.rb
|
65
|
+
- lib/active_support/core_ext/integer
|
66
|
+
- lib/active_support/core_ext/integer.rb
|
67
|
+
- lib/active_support/core_ext/kernel
|
68
|
+
- lib/active_support/core_ext/kernel.rb
|
69
|
+
- lib/active_support/core_ext/load_error.rb
|
70
|
+
- lib/active_support/core_ext/logger.rb
|
71
|
+
- lib/active_support/core_ext/module
|
72
|
+
- lib/active_support/core_ext/module.rb
|
73
|
+
- lib/active_support/core_ext/numeric
|
74
|
+
- lib/active_support/core_ext/numeric.rb
|
75
|
+
- lib/active_support/core_ext/object
|
76
|
+
- lib/active_support/core_ext/object.rb
|
77
|
+
- lib/active_support/core_ext/proc.rb
|
78
|
+
- lib/active_support/core_ext/range
|
79
|
+
- lib/active_support/core_ext/range.rb
|
80
|
+
- lib/active_support/core_ext/string
|
81
|
+
- lib/active_support/core_ext/string.rb
|
82
|
+
- lib/active_support/core_ext/symbol.rb
|
83
|
+
- lib/active_support/core_ext/time
|
84
|
+
- lib/active_support/core_ext/time.rb
|
85
|
+
- lib/active_support/core_ext/array/conversions.rb
|
86
|
+
- lib/active_support/core_ext/cgi/escape_skipping_slashes.rb
|
87
|
+
- lib/active_support/core_ext/class/attribute_accessors.rb
|
88
|
+
- lib/active_support/core_ext/class/inheritable_attributes.rb
|
89
|
+
- lib/active_support/core_ext/class/removal.rb
|
90
|
+
- lib/active_support/core_ext/date/conversions.rb
|
91
|
+
- lib/active_support/core_ext/hash/conversions.rb
|
92
|
+
- lib/active_support/core_ext/hash/diff.rb
|
93
|
+
- lib/active_support/core_ext/hash/indifferent_access.rb
|
94
|
+
- lib/active_support/core_ext/hash/keys.rb
|
95
|
+
- lib/active_support/core_ext/hash/reverse_merge.rb
|
96
|
+
- lib/active_support/core_ext/integer/even_odd.rb
|
97
|
+
- lib/active_support/core_ext/integer/inflections.rb
|
98
|
+
- lib/active_support/core_ext/kernel/agnostics.rb
|
99
|
+
- lib/active_support/core_ext/kernel/daemonizing.rb
|
100
|
+
- lib/active_support/core_ext/kernel/reporting.rb
|
101
|
+
- lib/active_support/core_ext/kernel/requires.rb
|
102
|
+
- lib/active_support/core_ext/module/attribute_accessors.rb
|
103
|
+
- lib/active_support/core_ext/module/delegation.rb
|
104
|
+
- lib/active_support/core_ext/module/inclusion.rb
|
105
|
+
- lib/active_support/core_ext/module/introspection.rb
|
106
|
+
- lib/active_support/core_ext/module/loading.rb
|
107
|
+
- lib/active_support/core_ext/numeric/bytes.rb
|
108
|
+
- lib/active_support/core_ext/numeric/time.rb
|
109
|
+
- lib/active_support/core_ext/object/extending.rb
|
110
|
+
- lib/active_support/core_ext/object/misc.rb
|
111
|
+
- lib/active_support/core_ext/range/conversions.rb
|
112
|
+
- lib/active_support/core_ext/string/access.rb
|
113
|
+
- lib/active_support/core_ext/string/conversions.rb
|
114
|
+
- lib/active_support/core_ext/string/inflections.rb
|
115
|
+
- lib/active_support/core_ext/string/iterators.rb
|
116
|
+
- lib/active_support/core_ext/string/starts_ends_with.rb
|
117
|
+
- lib/active_support/core_ext/time/calculations.rb
|
118
|
+
- lib/active_support/core_ext/time/conversions.rb
|
119
|
+
- lib/active_support/json/encoders
|
120
|
+
- lib/active_support/json/encoders.rb
|
121
|
+
- lib/active_support/json/encoders/core.rb
|
122
|
+
- lib/active_support/values/time_zone.rb
|
123
|
+
- lib/active_support/vendor/builder
|
124
|
+
- lib/active_support/vendor/builder.rb
|
125
|
+
- lib/active_support/vendor/builder/blankslate.rb
|
126
|
+
- lib/active_support/vendor/builder/xmlbase.rb
|
127
|
+
- lib/active_support/vendor/builder/xmlevents.rb
|
128
|
+
- lib/active_support/vendor/builder/xmlmarkup.rb
|
92
129
|
test_files: []
|
130
|
+
|
93
131
|
rdoc_options: []
|
132
|
+
|
94
133
|
extra_rdoc_files: []
|
134
|
+
|
95
135
|
executables: []
|
136
|
+
|
96
137
|
extensions: []
|
138
|
+
|
97
139
|
requirements: []
|
98
|
-
|
140
|
+
|
141
|
+
dependencies: []
|
142
|
+
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# Extends the class object with class and instance accessors for class attributes,
|
2
|
-
# just like the native attr* accessors for instance attributes.
|
3
|
-
class Class # :nodoc:
|
4
|
-
def cattr_reader(*syms)
|
5
|
-
syms.select { |sym| sym.respond_to?(:id2name) }.each do |sym|
|
6
|
-
class_eval <<-EOS
|
7
|
-
if ! defined? @@#{sym.id2name}
|
8
|
-
@@#{sym.id2name} = nil
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.#{sym.id2name}
|
12
|
-
@@#{sym}
|
13
|
-
end
|
14
|
-
|
15
|
-
def #{sym.id2name}
|
16
|
-
@@#{sym}
|
17
|
-
end
|
18
|
-
|
19
|
-
def call_#{sym.id2name}
|
20
|
-
case @@#{sym.id2name}
|
21
|
-
when Symbol then send(@@#{sym})
|
22
|
-
when Proc then @@#{sym}.call(self)
|
23
|
-
when String then @@#{sym}
|
24
|
-
else nil
|
25
|
-
end
|
26
|
-
end
|
27
|
-
EOS
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def cattr_writer(*syms)
|
32
|
-
syms.select { |sym| sym.respond_to?(:id2name) }.each do |sym|
|
33
|
-
class_eval <<-EOS
|
34
|
-
if ! defined? @@#{sym.id2name}
|
35
|
-
@@#{sym.id2name} = nil
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.#{sym.id2name}=(obj)
|
39
|
-
@@#{sym.id2name} = obj
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.set_#{sym.id2name}(obj)
|
43
|
-
@@#{sym.id2name} = obj
|
44
|
-
end
|
45
|
-
|
46
|
-
def #{sym.id2name}=(obj)
|
47
|
-
@@#{sym} = obj
|
48
|
-
end
|
49
|
-
EOS
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def cattr_accessor(*syms)
|
54
|
-
cattr_reader(*syms)
|
55
|
-
cattr_writer(*syms)
|
56
|
-
end
|
57
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
class Object #:nodoc:
|
2
|
-
def remove_subclasses_of(*superclasses)
|
3
|
-
subclasses_of(*superclasses).each do |subclass|
|
4
|
-
Object.send(:remove_const, subclass.to_s) rescue nil
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
def subclasses_of(*superclasses)
|
9
|
-
subclasses = []
|
10
|
-
ObjectSpace.each_object(Class) do |k|
|
11
|
-
next if (k.ancestors & superclasses).empty? || superclasses.include?(k) || k.to_s.include?("::") || subclasses.include?(k)
|
12
|
-
subclasses << k
|
13
|
-
end
|
14
|
-
subclasses
|
15
|
-
end
|
16
|
-
|
17
|
-
# "", " ", nil, [], and {} are blank
|
18
|
-
def blank?
|
19
|
-
if respond_to?(:empty?) && respond_to?(:strip)
|
20
|
-
empty? or strip.empty?
|
21
|
-
elsif respond_to?(:empty?)
|
22
|
-
empty?
|
23
|
-
else
|
24
|
-
!self
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def suppress(*exception_classes)
|
29
|
-
begin yield
|
30
|
-
rescue Exception => e
|
31
|
-
raise unless exception_classes.any? {|cls| e.kind_of? cls}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Class #:nodoc:
|
37
|
-
def remove_subclasses
|
38
|
-
Object.remove_subclasses_of(self)
|
39
|
-
end
|
40
|
-
|
41
|
-
def subclasses
|
42
|
-
Object.subclasses_of(self).map { |o| o.to_s }
|
43
|
-
end
|
44
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# Extends the module object with module and instance accessors for class attributes,
|
2
|
-
# just like the native attr* accessors for instance attributes.
|
3
|
-
class Module # :nodoc:
|
4
|
-
def mattr_reader(*syms)
|
5
|
-
syms.each do |sym|
|
6
|
-
class_eval <<-EOS
|
7
|
-
if ! defined? @@#{sym.id2name}
|
8
|
-
@@#{sym.id2name} = nil
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.#{sym.id2name}
|
12
|
-
@@#{sym}
|
13
|
-
end
|
14
|
-
|
15
|
-
def #{sym.id2name}
|
16
|
-
@@#{sym}
|
17
|
-
end
|
18
|
-
|
19
|
-
def call_#{sym.id2name}
|
20
|
-
case @@#{sym.id2name}
|
21
|
-
when Symbol then send(@@#{sym})
|
22
|
-
when Proc then @@#{sym}.call(self)
|
23
|
-
when String then @@#{sym}
|
24
|
-
else nil
|
25
|
-
end
|
26
|
-
end
|
27
|
-
EOS
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def mattr_writer(*syms)
|
32
|
-
syms.each do |sym|
|
33
|
-
class_eval <<-EOS
|
34
|
-
if ! defined? @@#{sym.id2name}
|
35
|
-
@@#{sym.id2name} = nil
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.#{sym.id2name}=(obj)
|
39
|
-
@@#{sym.id2name} = obj
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.set_#{sym.id2name}(obj)
|
43
|
-
@@#{sym.id2name} = obj
|
44
|
-
end
|
45
|
-
|
46
|
-
def #{sym.id2name}=(obj)
|
47
|
-
@@#{sym} = obj
|
48
|
-
end
|
49
|
-
EOS
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def mattr_accessor(*syms)
|
54
|
-
mattr_reader(*syms)
|
55
|
-
mattr_writer(*syms)
|
56
|
-
end
|
57
|
-
end
|