From 157dc275da0ad38635337b7c1d96de656d91de8e Mon Sep 17 00:00:00 2001 From: Avner Cohen Date: Tue, 6 Aug 2013 20:43:02 +0300 Subject: Removing obsolete html tags in favor of markdown code block. --- activesupport/lib/active_support/xml_mini.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index d082a0a499..4133ba68e1 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -13,7 +13,7 @@ module ActiveSupport extend self # This module decorates files deserialized using Hash.from_xml with - # the original_filename and content_type methods. + # the `original_filename` and `content_type` methods. module FileLike #:nodoc: attr_writer :original_filename, :content_type -- cgit v1.2.3 From 86f2061cd53057012109f072976ceb1773fcd194 Mon Sep 17 00:00:00 2001 From: Avner Cohen Date: Tue, 6 Aug 2013 22:16:03 +0300 Subject: Revert "Removing obsolete html tags in favor of markdown code block" This reverts commit 157dc275da0ad38635337b7c1d96de656d91de8e. --- activesupport/lib/active_support/xml_mini.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index 4133ba68e1..d082a0a499 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -13,7 +13,7 @@ module ActiveSupport extend self # This module decorates files deserialized using Hash.from_xml with - # the `original_filename` and `content_type` methods. + # the original_filename and content_type methods. module FileLike #:nodoc: attr_writer :original_filename, :content_type -- cgit v1.2.3 From ec8ef1e1055c4e1598da13f49d30261f07f4a9b4 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sat, 17 Aug 2013 21:38:53 +0530 Subject: Revert "Merge branch 'master' of github.com:rails/docrails" This reverts commit 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9. Seems to be a code merge done by mistake. --- .../lib/active_support/core_ext/date/calculations.rb | 2 +- .../lib/active_support/core_ext/hash/conversions.rb | 1 + activesupport/lib/active_support/core_ext/object/try.rb | 2 +- activesupport/test/transliterate_test.rb | 6 +++--- activesupport/test/xml_mini_test.rb | 12 ++---------- 5 files changed, 8 insertions(+), 15 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/date/calculations.rb b/activesupport/lib/active_support/core_ext/date/calculations.rb index eddb1b851f..06e4847e82 100644 --- a/activesupport/lib/active_support/core_ext/date/calculations.rb +++ b/activesupport/lib/active_support/core_ext/date/calculations.rb @@ -119,7 +119,7 @@ class Date options.fetch(:day, day) ) end - + # Allow Date to be compared with Time by converting to DateTime and relying on the <=> from there. def compare_with_coercion(other) if other.is_a?(Time) diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index fbf2877117..8930376ac8 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -235,6 +235,7 @@ module ActiveSupport value.map! { |i| deep_to_h(i) } value.length > 1 ? value : value.first end + end end diff --git a/activesupport/lib/active_support/core_ext/object/try.rb b/activesupport/lib/active_support/core_ext/object/try.rb index 48190e1e66..534bbe3c42 100644 --- a/activesupport/lib/active_support/core_ext/object/try.rb +++ b/activesupport/lib/active_support/core_ext/object/try.rb @@ -47,7 +47,7 @@ class Object end # Same as #try, but will raise a NoMethodError exception if the receiving is not nil and - # does not implement the tried method. + # does not implemented the tried method. def try!(*a, &b) if a.empty? && block_given? yield self diff --git a/activesupport/test/transliterate_test.rb b/activesupport/test/transliterate_test.rb index e0f85f4e7c..ce91c443e1 100644 --- a/activesupport/test/transliterate_test.rb +++ b/activesupport/test/transliterate_test.rb @@ -3,6 +3,7 @@ require 'abstract_unit' require 'active_support/inflector/transliterate' class TransliterateTest < ActiveSupport::TestCase + def test_transliterate_should_not_change_ascii_chars (0..127).each do |byte| char = [byte].pack("U") @@ -23,13 +24,12 @@ class TransliterateTest < ActiveSupport::TestCase def test_transliterate_should_work_with_custom_i18n_rules_and_uncomposed_utf8 char = [117, 776].pack("U*") # "ü" as ASCII "u" plus COMBINING DIAERESIS I18n.backend.store_translations(:de, :i18n => {:transliterate => {:rule => {"ü" => "ue"}}}) - default_locale, I18n.locale = I18n.locale, :de + I18n.locale = :de assert_equal "ue", ActiveSupport::Inflector.transliterate(char) - ensure - I18n.locale = default_locale end def test_transliterate_should_allow_a_custom_replacement_char assert_equal "a*b", ActiveSupport::Inflector.transliterate("a索b", "*") end + end diff --git a/activesupport/test/xml_mini_test.rb b/activesupport/test/xml_mini_test.rb index d992028323..a025279e16 100644 --- a/activesupport/test/xml_mini_test.rb +++ b/activesupport/test/xml_mini_test.rb @@ -106,11 +106,7 @@ module XmlMiniTest module Nokogiri end setup do - @xml, @default_backend = ActiveSupport::XmlMini, ActiveSupport::XmlMini.backend - end - - teardown do - ActiveSupport::XmlMini.backend = @default_backend + @xml = ActiveSupport::XmlMini end test "#with_backend should switch backend and then switch back" do @@ -139,11 +135,7 @@ module XmlMiniTest module LibXML end setup do - @xml, @default_backend = ActiveSupport::XmlMini, ActiveSupport::XmlMini.backend - end - - teardown do - ActiveSupport::XmlMini.backend = @default_backend + @xml = ActiveSupport::XmlMini end test "#with_backend should be thread-safe" do -- cgit v1.2.3