Sha256: 6176c5656e923badd1c03321b54c4bdd3726778150115e8bd824729e61ce4bcc

Contents?: true

Size: 918 Bytes

Versions: 13

Compression:

Stored size: 918 Bytes

Contents

require 'padrino-core/support_lite'
unless Fixnum.method_defined?(:days)
  # We don't add active_support/core_ext/object/misc because override some extlib defaults
  if Padrino.support == :extlib
    class Object
      # A duck-type assistant method. For example, Active Support extends Date
      # to define an acts_like_date? method, and extends Time to define
      # acts_like_time?. As a result, we can do "x.acts_like?(:time)" and
      # "x.acts_like?(:date)" to do duck-type-safe comparisons, since classes that
      # we want to act like Time simply need to define an acts_like_time? method.
      def acts_like?(duck)
        respond_to? "acts_like_#{duck}?"
      end
    end
  else
    require 'active_support/core_ext/object/misc'
  end
  require 'active_support/core_ext/date'
  require 'active_support/core_ext/time'
  require 'active_support/core_ext/numeric'
  require 'active_support/duration'
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
padrino-helpers-0.7.5 test/support_helpers.rb
padrino-helpers-0.7.4 test/support_helpers.rb
padrino-helpers-0.7.3 test/support_helpers.rb
padrino-helpers-0.7.2 test/support_helpers.rb
padrino-helpers-0.7.1 test/support_helpers.rb
padrino-helpers-0.7.0 test/support_helpers.rb
padrino-helpers-0.6.7 test/support_helpers.rb
padrino-helpers-0.6.3 test/support_helpers.rb
padrino-helpers-0.6.2 test/support_helpers.rb
padrino-helpers-0.6.1 test/support_helpers.rb
padrino-helpers-0.5.0 test/support_helpers.rb
padrino-helpers-0.4.6 test/support_helpers.rb
padrino-helpers-0.4.5 test/support_helpers.rb