From 7da8d76206271bdf200ea201f7e5a49afb9bc9e7 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 20 Jan 2017 15:02:34 -0800 Subject: Change ActionView ERB Handler from Erubis to Erubi Erubi offers the following advantages for Rails: * Works with ruby's --enable-frozen-string-literal option * Has 88% smaller memory footprint * Does no freedom patching (Erubis adds a method to Kernel) * Has simpler internals (1 file, <150 lines of code) * Has an open development model (Erubis doesn't have a public source control repository or bug tracker) * Is not dead (Erubis hasn't been updated since 2011) Erubi is a simplified fork of Erubis that contains just the parts that are generally needed (which includes the parts that Rails uses). The only intentional difference in behavior is that it does not include support for <%=== tags for debug output. That could be added to the ActionView ERB handler if it is desired. The Erubis template handler remains in a deprecated state so that code that accesses it directly does not break. It can be removed after Rails 5.1. --- activesupport/lib/active_support/deprecation/proxy_wrappers.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb index 1c6618b19a..ce39e9a232 100644 --- a/activesupport/lib/active_support/deprecation/proxy_wrappers.rb +++ b/activesupport/lib/active_support/deprecation/proxy_wrappers.rb @@ -122,10 +122,11 @@ module ActiveSupport # (Backtrace information…) # ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"] class DeprecatedConstantProxy < DeprecationProxy - def initialize(old_const, new_const, deprecator = ActiveSupport::Deprecation.instance) + def initialize(old_const, new_const, deprecator = ActiveSupport::Deprecation.instance, message: "#{old_const} is deprecated! Use #{new_const} instead.") @old_const = old_const @new_const = new_const @deprecator = deprecator + @message = message end # Returns the class of the new constant. @@ -143,7 +144,7 @@ module ActiveSupport end def warn(callstack, called, args) - @deprecator.warn("#{@old_const} is deprecated! Use #{@new_const} instead.", callstack) + @deprecator.warn(@message, callstack) end end end -- cgit v1.2.3 From 19fc41992561c901f66064042aa23f4910101d98 Mon Sep 17 00:00:00 2001 From: kenta-s Date: Wed, 25 Jan 2017 23:43:45 +0900 Subject: Fix grammar 'an hyphen' -> 'a hyphen' [ci skip] --- activesupport/lib/active_support/number_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/number_helper.rb b/activesupport/lib/active_support/number_helper.rb index 6000ea44be..da4e91e949 100644 --- a/activesupport/lib/active_support/number_helper.rb +++ b/activesupport/lib/active_support/number_helper.rb @@ -78,7 +78,7 @@ module ActiveSupport # (defaults to "%u%n"). Fields are %u for the # currency, and %n for the number. # * :negative_format - Sets the format for negative - # numbers (defaults to prepending an hyphen to the formatted + # numbers (defaults to prepending a hyphen to the formatted # number given by :format). Accepts the same fields # than :format, except %n is here the # absolute value of the number. -- cgit v1.2.3