activesupport 3.0.0.beta3 → 3.0.0.beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
- data/CHANGELOG +57 -0
- data/lib/active_support/builder.rb +6 -0
- data/lib/active_support/cache.rb +428 -70
- data/lib/active_support/cache/compressed_mem_cache_store.rb +6 -15
- data/lib/active_support/cache/file_store.rb +139 -41
- data/lib/active_support/cache/mem_cache_store.rb +115 -76
- data/lib/active_support/cache/memory_store.rb +127 -27
- data/lib/active_support/cache/strategy/local_cache.rb +109 -57
- data/lib/active_support/cache/synchronized_memory_store.rb +2 -38
- data/lib/active_support/callbacks.rb +27 -27
- data/lib/active_support/configurable.rb +19 -18
- data/lib/active_support/core_ext/array/conversions.rb +30 -26
- data/lib/active_support/core_ext/array/random_access.rb +19 -5
- data/lib/active_support/core_ext/benchmark.rb +0 -12
- data/lib/active_support/core_ext/class/attribute.rb +1 -4
- data/lib/active_support/core_ext/class/inheritable_attributes.rb +3 -0
- data/lib/active_support/core_ext/date/calculations.rb +27 -8
- data/lib/active_support/core_ext/date/conversions.rb +1 -0
- data/lib/active_support/core_ext/date_time/conversions.rb +9 -3
- data/lib/active_support/core_ext/file.rb +1 -0
- data/lib/active_support/core_ext/hash/conversions.rb +14 -137
- data/lib/active_support/core_ext/kernel/debugger.rb +1 -1
- data/lib/active_support/core_ext/kernel/reporting.rb +2 -1
- data/lib/active_support/core_ext/load_error.rb +1 -0
- data/lib/active_support/core_ext/logger.rb +1 -1
- data/lib/active_support/core_ext/module/attr_internal.rb +2 -2
- data/lib/active_support/core_ext/object/to_param.rb +2 -2
- data/lib/active_support/core_ext/object/with_options.rb +2 -0
- data/lib/active_support/core_ext/string.rb +1 -0
- data/lib/active_support/core_ext/string/conversions.rb +35 -1
- data/lib/active_support/core_ext/string/encoding.rb +11 -0
- data/lib/active_support/core_ext/string/filters.rb +29 -0
- data/lib/active_support/core_ext/string/inflections.rb +0 -11
- data/lib/active_support/core_ext/string/interpolation.rb +1 -0
- data/lib/active_support/core_ext/string/multibyte.rb +16 -19
- data/lib/active_support/core_ext/time/calculations.rb +7 -6
- data/lib/active_support/core_ext/uri.rb +8 -3
- data/lib/active_support/dependencies.rb +33 -1
- data/lib/active_support/duration.rb +1 -0
- data/lib/active_support/hash_with_indifferent_access.rb +5 -1
- data/lib/active_support/i18n.rb +7 -2
- data/lib/active_support/inflector/transliterate.rb +58 -38
- data/lib/active_support/json/encoding.rb +28 -5
- data/lib/active_support/lazy_load_hooks.rb +14 -4
- data/lib/active_support/locale/en.yml +4 -1
- data/lib/active_support/message_verifier.rb +4 -4
- data/lib/active_support/multibyte.rb +1 -19
- data/lib/active_support/multibyte/chars.rb +143 -427
- data/lib/active_support/multibyte/unicode.rb +393 -0
- data/lib/active_support/notifications/fanout.rb +15 -5
- data/lib/active_support/notifications/instrumenter.rb +10 -4
- data/lib/active_support/railtie.rb +36 -0
- data/lib/active_support/rescuable.rb +1 -0
- data/lib/active_support/ruby/shim.rb +1 -0
- data/lib/active_support/testing/declarative.rb +1 -1
- data/lib/active_support/testing/isolation.rb +2 -1
- data/lib/active_support/testing/setup_and_teardown.rb +3 -0
- data/lib/active_support/values/time_zone.rb +20 -30
- data/lib/active_support/values/unicode_tables.dat +0 -0
- data/lib/active_support/version.rb +1 -1
- data/lib/active_support/xml_mini.rb +126 -1
- metadata +8 -61
- data/lib/active_support/multibyte/unicode_database.rb +0 -71
@@ -1,71 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module ActiveSupport #:nodoc:
|
4
|
-
module Multibyte #:nodoc:
|
5
|
-
# Holds data about a codepoint in the Unicode database
|
6
|
-
class Codepoint
|
7
|
-
attr_accessor :code, :combining_class, :decomp_type, :decomp_mapping, :uppercase_mapping, :lowercase_mapping
|
8
|
-
end
|
9
|
-
|
10
|
-
# Holds static data from the Unicode database
|
11
|
-
class UnicodeDatabase
|
12
|
-
ATTRIBUTES = :codepoints, :composition_exclusion, :composition_map, :boundary, :cp1252
|
13
|
-
|
14
|
-
attr_writer(*ATTRIBUTES)
|
15
|
-
|
16
|
-
def initialize
|
17
|
-
@codepoints = Hash.new(Codepoint.new)
|
18
|
-
@composition_exclusion = []
|
19
|
-
@composition_map = {}
|
20
|
-
@boundary = {}
|
21
|
-
@cp1252 = {}
|
22
|
-
end
|
23
|
-
|
24
|
-
# Lazy load the Unicode database so it's only loaded when it's actually used
|
25
|
-
ATTRIBUTES.each do |attr_name|
|
26
|
-
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
|
27
|
-
def #{attr_name} # def codepoints
|
28
|
-
load # load
|
29
|
-
@#{attr_name} # @codepoints
|
30
|
-
end # end
|
31
|
-
EOS
|
32
|
-
end
|
33
|
-
|
34
|
-
# Loads the Unicode database and returns all the internal objects of UnicodeDatabase.
|
35
|
-
def load
|
36
|
-
begin
|
37
|
-
@codepoints, @composition_exclusion, @composition_map, @boundary, @cp1252 = File.open(self.class.filename, 'rb') { |f| Marshal.load f.read }
|
38
|
-
rescue Exception => e
|
39
|
-
raise IOError.new("Couldn't load the Unicode tables for UTF8Handler (#{e.message}), ActiveSupport::Multibyte is unusable")
|
40
|
-
end
|
41
|
-
|
42
|
-
# Redefine the === method so we can write shorter rules for grapheme cluster breaks
|
43
|
-
@boundary.each do |k,_|
|
44
|
-
@boundary[k].instance_eval do
|
45
|
-
def ===(other)
|
46
|
-
detect { |i| i === other } ? true : false
|
47
|
-
end
|
48
|
-
end if @boundary[k].kind_of?(Array)
|
49
|
-
end
|
50
|
-
|
51
|
-
# define attr_reader methods for the instance variables
|
52
|
-
class << self
|
53
|
-
attr_reader(*ATTRIBUTES)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Returns the directory in which the data files are stored
|
58
|
-
def self.dirname
|
59
|
-
File.dirname(__FILE__) + '/../values/'
|
60
|
-
end
|
61
|
-
|
62
|
-
# Returns the filename for the data file for this version
|
63
|
-
def self.filename
|
64
|
-
File.expand_path File.join(dirname, "unicode_tables.dat")
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
# UniCode Database
|
69
|
-
UCD = UnicodeDatabase.new
|
70
|
-
end
|
71
|
-
end
|