Sha256: 6433bf2d9966623ecd27d5b16029f51f03f4f1e95957fbe8ce991b0f9dd52889

Contents?: true

Size: 283 Bytes

Versions: 51

Compression:

Stored size: 283 Bytes

Contents

require 'time'

# Support Ruby 1.8.7's Time.parse('Today')

if RUBY_VERSION >= '1.9'
  class Time
    class << self
      alias :old_parse :parse
      def parse(date, now=self.now)
        date = now.to_s if date =~ /today/i
        old_parse(date, now)
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
dugway-1.0.10 lib/dugway/extensions/time.rb
dugway-1.0.9 lib/dugway/extensions/time.rb
dugway-1.0.8 lib/dugway/extensions/time.rb
dugway-1.0.7 lib/dugway/extensions/time.rb
dugway-1.0.6 lib/dugway/extensions/time.rb
dugway-1.0.5 lib/dugway/extensions/time.rb
dugway-1.0.4 lib/dugway/extensions/time.rb
dugway-1.0.3 lib/dugway/extensions/time.rb
dugway-1.0.2 lib/dugway/extensions/time.rb
dugway-1.0.1 lib/dugway/extensions/time.rb
dugway-1.0.0 lib/dugway/extensions/time.rb
dugway-0.12.3 lib/dugway/extensions/time.rb
dugway-0.12.2 lib/dugway/extensions/time.rb
dugway-0.12.1 lib/dugway/extensions/time.rb
dugway-0.12.0 lib/dugway/extensions/time.rb
dugway-0.11.4 lib/dugway/extensions/time.rb
dugway-0.11.3 lib/dugway/extensions/time.rb
dugway-0.11.2 lib/dugway/extensions/time.rb
dugway-0.11.1 lib/dugway/extensions/time.rb
dugway-0.11.0 lib/dugway/extensions/time.rb