aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2013-11-05 20:36:09 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2013-11-06 17:15:18 -0800
commit6da5ff45c6d69912fb96870f31aaf0c0590fa212 (patch)
tree01f4590d1b587150c84af4f0b9375d8dd48b56ba
parent5584ddc43da6f3275c45305f50d934e505750f8c (diff)
downloadrails-6da5ff45c6d69912fb96870f31aaf0c0590fa212.tar.gz
rails-6da5ff45c6d69912fb96870f31aaf0c0590fa212.tar.bz2
rails-6da5ff45c6d69912fb96870f31aaf0c0590fa212.zip
Moved AS::JSON::DATE_REGEX as it's only used for decoding
-rw-r--r--activesupport/lib/active_support/json/decoding.rb3
-rw-r--r--activesupport/lib/active_support/json/encoding.rb3
2 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb
index 315c76199a..8b5fc70dee 100644
--- a/activesupport/lib/active_support/json/decoding.rb
+++ b/activesupport/lib/active_support/json/decoding.rb
@@ -7,6 +7,9 @@ module ActiveSupport
mattr_accessor :parse_json_times
module JSON
+ # matches YAML-formatted dates
+ DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?))$/
+
class << self
# Parses a JSON string (JavaScript Object Notation) into a hash.
# See www.json.org for more info.
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb
index 4d73672047..8d8557fe3d 100644
--- a/activesupport/lib/active_support/json/encoding.rb
+++ b/activesupport/lib/active_support/json/encoding.rb
@@ -21,9 +21,6 @@ module ActiveSupport
end
module JSON
- # matches YAML-formatted dates
- DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?))$/
-
# Dumps objects in JSON (JavaScript Object Notation).
# See www.json.org for more info.
#