Permalink
Browse files

remove alias_method_chain

  • Loading branch information...
ujifgc committed Oct 28, 2015
1 parent a335e0d commit da54bef74d48db154ca1c1a5150aac4391165217
Showing with 9 additions and 4 deletions.
  1. +8 −3 padrino-mailer/lib/padrino-mailer/ext.rb
  2. +1 −1 padrino-support/lib/padrino-support.rb
@@ -23,7 +23,8 @@ def initialize_with_app(*args, &block)
initialize_without_app(*args, &block)
end
alias_method_chain :initialize, :app
alias_method :initialize_without_app, :initialize
alias_method :initialize, :initialize_with_app
##
# Setup like in Sinatra/Padrino apps content_type and template lookup.
@@ -118,7 +119,10 @@ def do_delivery_with_logging
encoded.each_line { |line| logger << (" " + line.strip) } if logger.debug?
do_delivery_without_logging
end
alias_method_chain :do_delivery, :logging if Padrino.respond_to?(:logger)
if Padrino.respond_to?(:logger)
alias_method :do_delivery_without_logging, :do_delivery
alias_method :do_delivery, :do_delivery_with_logging
end
##
# Sinatra and Padrino compatibility.
@@ -241,7 +245,8 @@ def content_type_with_symbol(value=nil)
mime = content_type_without_symbol(value)
Padrino::Mailer::Mime.mime_type(mime)
end
alias_method_chain :content_type, :symbol
alias_method :content_type_without_symbol, :content_type
alias_method :content_type, :content_type_with_symbol
private
@@ -1,7 +1,6 @@
##
# This file loads certain extensions required by Padrino from ActiveSupport.
#
require 'active_support/core_ext/module/aliasing' # alias_method_chain
require 'active_support/core_ext/hash/keys' # symbolize_keys
require 'active_support/core_ext/hash/indifferent_access' # params[:foo]
require 'active_support/core_ext/hash/slice' # slice
@@ -11,6 +10,7 @@
# Remove these on 0.14:
require 'active_support/core_ext/hash/reverse_merge' # reverse_merge
require 'active_support/core_ext/module/aliasing' # alias_method_chain
require 'padrino-support/core_ext/string/inflections'
require 'padrino-support/core_ext/string/colorize'

0 comments on commit da54bef

Please sign in to comment.