Search
Results (37)
- Revision 30f2d698 (git): Don't call `Kernel#require` in hot loop
- Ref: https://bugs.ruby-lang.org/issues/20641 ... t/exist/#{i}") end payload = 100.times.map { Date.today }.to_yaml Benchmark.ips do |x| x.report(" ... (± 1.8%) i/s - 30.050k in 5.016079s ```
- Bug #19864 (Closed): Ruby 3.2 Changed Behavior With One Sided Ranges
- Thank you for taking the time to read my issu ... with dates should work, especially since (..Date.today).cover?(Date.today) still works as expected.
- Bug #19418 (Closed): Checking if a date in an ... out when the range starts after the test date
- ` require 'date' ((Date.today + 1)..).include?(Date.today) ` is expected to return `false`. It nev ... s like it is in a never ending loop. `((Date.today)..).include?(Date.today)` however, returns `true` right away. ... start date comes after the date to check for.
- Bug #18580 (Closed): Range#include? inconsistency for beginless String ranges
- The follow-up of #18577. `Range#include?` ... ing: ```ruby # default Range behavior: (..Date.today).include? Date.today # (irb):10:in `each': can't iterate from Ni ... w') # => true, this is deeply confusing ```
- Bug #18577 (Closed): Range#include? returns w ... for beginless range with exclusive string end
- Exclusive range should not include the end va ... in):004:0> (...'z').cover? 'z' => false ```
- Feature #18136 (Open): take_while_after
- Sorry, I already tried that once (#16441) but ... ough I tend to like `#take_upto` from #16446.
- Bug #17409 (Rejected): Endless range of dates stuck on include? when miss
- This code stucks (on latest ruby 2.7.1): ```ruby require 'date' (Date.today..).include?(Date.today - 1) ``` But it works well with `cover?` ... 1 > require 'date' => true 2.7.1 :002 > (Date.today..).cover?(Date.today - 1) => false ```
- Bug #17169 (Rejected): Bad value for range using infinity for Time
- How to reproduce: ``` ruby -Float::INFINITY...Float::INFINITY # works Date.today...Float::INFINITY # works -Float::INFINITY...Date.today # works Time.now...Float::INFINITY #fails w ... er, monkey patching Float feels riskier.
- Feature #15668 (Open): stdlib: Date - Time should return the difference in days
- Hi at the ruby/stdlib, Computing with time ... mputation, involving Date and Time try: Date.today - Time.now => TypeError: expected numeric while my naively expected result can done by: Date.today - Time.now.to_date => (0/1) There must b ... can't tune a fish
- Feature #14877 (Rejected): Calculate age in Date class
- Seems like there's enough complexity in deter ... age #=> 2` `Date.new(2016, 6, 29).age #=> 1`
- Feature #14799 (Closed): Startless range
- On introduction of endless range at #12912, " ... months.ago puts "old" when 3.months.ago..Date.today puts "recent" when Date.today.. puts "upcoming" end log.map(&:logge ... ul clamp too: ```ruby updated_at.clamp(..Date.today) ``` **Uncertainty points:** * Would ... xamples, which for me it is hard to think of.
- Feature #14784 (Closed): Comparable#clamp with a range
- **Proposal** Allow "one-sided" `clamp` to ... e clamp(0, Float::INFINITY) timestamp.clamp(Date.today..) # now, I typically use clamp(Date.today..INFINITE_FUTURE_DATE) with custom defined c ... . This is "one-sided", you can't do `clamp(..Date.today)`. To this I can answer than from my experie ... t `#clamp`" shows intentions much less clear.
- Feature #14781 (Closed): Enumerator.generate
- This is alternative proposal to `Object#enume ... # Find next Tuesday p Enumerator.generate(Date.today, &:succ).detect { |d| d.wday == 2 } # => #< ... n the discussion here, on Twitter and Reddit.
- Feature #14575 (Closed): Switch Range#=== to use cover? instead of include?
- _This is **a conscious duplicate** of the bug ... behave like `cover?`" * Dates and times: `(Date.today..Date.today + 1) === DateTime.now` is `false`; it is har ... al-life use case which could be broken by it.
- Feature #14423 (Closed): Enumerator from single object
- **UPD: Current proposal** Introduce method ... in the tracker for all keywords I've tried.
- Bug #13877 (Closed): BUG Unnormalized Fixnum value
- enviroment Windows 10 15063.540 x64 how to simulate it ~~~ require 'date' Date.today.hash ~~~ reproducable on current trunk a ... 1 p:0000 s:0003 E:002400 (none) [FINISH] ~~~
- Feature #13860 (Open): A proposal for a new, ... ability to omit '%' tokens as arguments to it
- Hello ruby-folks, On reddit someone linked ... method may be better. I have also noticed Date.today() ... so I thought about using it, such as via Date.today 'H:M:S' - but I think that it may be better to have it reside within Time, rather than Date. Date.today() presenty only accepts Floats rather than ... you feel it is not a good addition/idea/fit.
- Bug #13101 (Closed): Date#rfc2822 and Time#rfc2822 don't return the same format
- Using the rfc2822 method on various date/time ... # => "Wed, 04 Jan 2017 10:21:06 -0500" Date.today.rfc2822 # => "Wed, 4 Jan 2017 00:00:00 +00 ... zone +0000 and -0000 is technically correct.
- Bug #12961 (Closed): Bad value for range using infinity for Date or Time
- How to reproduce: ~~~ ruby -Float::INFINITY...Float::INFINITY # works Date.today...Float::INFINITY # works -Float::INFINITY...Date.today # fails with "ArgumentError: bad value for r ... eport for 1.9.3, obviously still not resolved
- Feature #12790 (Open): Better inspect for stdlib classes
- `#inspect` is important for understanding "wh ... ing. ## `Date` and `DateTime` ```ruby Date.today # => #<Date: 2016-09-26 ((2457658j,0s,0n),+ ... provide just `2016-09-26 17:03:59 +0300`.)
- Feature #12612 (Rejected): Switch Range#=== to use cover? instead of include?
- Currently, `Range#===` is an alias of `#inclu ... `include?` is preferable for identity check.
- Feature #11882 (Assigned): Map or NamedMap
- Hash is one of the best features of Ruby. I r ... cript Objects) and brings that to Ruby.
- Bug #11621 (Rejected): Date.- and Date.+ methods inconsistencies
- I noticed today some inconsistencies when usi ... 0> require 'date' => true irb(main):002:0> Date.today - 7 => #<Date: 2015-10-19 ((2457315j,0s,0n),+0s,2299161j)> irb(main):003:0> Date.today -7 => #<Date: 2015-10-26 ((2457322j,0s,0n),+0s,2299161j)> irb(main):004:0> Date.today-7 => #<Date: 2015-10-19 ((2457315j,0s,0n),+ ... e parser ignores the `-7` in the context of `Date.today` instead of interpreting it as `7 days ago` ... ):002:0> days = 5 => 5 irb(main):003:0> p (Date.today - days) == (Date.today -days) false => false ~~~ or when crea ... n a variable: ~~~ irb(main):004:0> now = Date.today => #<Date: 2015-10-26 ((2457322j,0s,0n),+0s ... sts and commented the output from my machine.
- Bug #11037 (Closed): Time Parse Documentation Incorrect - Undefined method getlocal
- According to: http://ruby-doc.org/stdlib-2 ... uby irb(main):010:0> Time.parse('12:30 AM', Date.today) NoMethodError: undefined method `getlocal' ... e object must be passed as the now parameter.
- Feature #9794 (Closed): DateTime.strptime() doesn't work correctly for '%s %z'
- Time.strptime() works correctly: Time. ... trptime() has to be fixed. Patch attached.
- Feature #8629 (Rejected): Method#parameters should include the default value
- def a_method arg1=1, now = Time.now, arg2 = a ... '', parent_name: String, age: Integer, date: Date.today end Of course, you'd need to set up the ... thod. Could you please consider this idea?
- Feature #7114 (Feedback): New classes: `HumanTime::LocalTime`, `HumanTime::Duration`
- =begin As suggested by *drbrain* in #7113 , ... uk/2008/01/03/time-columns-and-rails/ =end
- Bug #7031 (Rejected): Date::mjd_to_jd disappeared
- I've migrated almost all of my Ruby code fro ... Am I missing something? Thanks, Dave
- Bug #6864 (Closed): bad value for range when using infinity with date or time
- Steps to reproduce: require 'date' Range.new(Date.today, 1.0/0.0) # works Range.new(-1.0/0.0, Date.today) # fails Range.new(Time.now, 1.0/0.0) # fa ... logic error. just ranges without one bound.
- Bug #6702 (Rejected): Date should be either required or not
- Today I was trying to do some experiment with IRB: "Date.today" threw a NoMethodError. But Date was defi ... ehavior, but it doesn't make any sense to me.
- Bug #6652 (Closed): broken Marshal compatibilities on Date and DateTime
- =begin (({Date})) and (({DateTime})) dumped ... $ /usr/bin/ruby -rdate -e 'Marshal.dump(Date.today, STDOUT)' | ruby -rdate -e 'p Marshal.load(S ... in>' bash: exit 1 Patch attached. =end
- Bug #5232 (Rejected): Encoding of Date#to_s
- The encoding of Date#to_s should respect Enco ... 0> require 'date' => true irb(main):002:0> Date.today.to_s.encoding => #<Encoding:US-ASCII> irb( ... TF_8 => #<Encoding:UTF-8> irb(main):004:0> Date.today.to_s.encoding => #<Encoding:US-ASCII> irb( ... 0> require 'date' => true irb(main):002:0> Date.today.to_s.encoding => #<Encoding:US-ASCII> irb( ... TF_8 => #<Encoding:UTF-8> irb(main):004:0> Date.today.to_s.encoding => #<Encoding:UTF-8> irb(main):005:0> I've attached a patch that fixes this.
- Bug #4460 (Rejected): Date.commercial date calculations don't match strftime output
- =begin When retrieving the date for a week n ... g) })) Which is in fact true today: (({Date.today.strftime('%W') => "09" Date.commercial(2011,9,1) => Mon, 28 Feb 2011 Date.today.at_beginning_of_week => Mon, 28 Feb 2011 })) But not two years from now: (({(Date.today+2.years).strftime("%W") => "08" Date.commercial(2013,8,1) => Mon, 18 Feb 2013 (Date.today+2.years).at_beginning_of_week => Mon, 25 Feb ... sses up some of my date calculations. =end
- Bug #4451 (Rejected): Date#step does not raise ArgumentError for 0 step
- =begin Numeric#step: $ ruby -e '1.step(2, ... n `<main>' Date#step: ruby -r date -e 'Date.today.step(Date.today, 0){}' # infinite loop There is already ... les the check and adds a test for it. =end
- Feature #4068 (Rejected): Replace current standard Date/DateTime library with home_run
- =begin The current standard date library is ... w what all of the required changes are. =end
- Bug #3687 (Closed): Date#rfc3339 does not include time, which breaks Date._rfc3339
- =begin I'm not sure if the bug is in the rfc ... .txt). $ irb -r date ruby-1.9.2-rc2 > Date.today.rfc3339 => "2010-08-12" ruby-1.9.2-rc2 > Date._rfc3339(Date.today.rfc3339) => nil ruby-1.9.2-rc2 > Date.rfc3339(Date.today.rfc3339) ArgumentError: invalid date ... -I date-rfc3339/ -r date ruby-1.9.2-rc2 > Date.today.rfc3339 => "2010-08-12T00:00:00+00:00" ruby-1.9.2-rc2 > Date._rfc3339(Date.today.rfc3339) => {:year=>2010, :mon=>8, :mday= ... :offset=>0} ruby-1.9.2-rc2 > Date.rfc3339(Date.today.rfc3339) => #<Date: 2010-08-12 (4910841/2 ... at all, as that uses the time already. =end
- Feature #735 (Closed): Date#inspect
- =begin 「inspectは人間に優しい文字列化」という観点から、Date#insp ... 3+09:00> のほうがわかりやすいです。 require 'date' Date.today # => #<Date: 4909561/2,0,2299161> Date.today.to_s # => "2008-11-10" DateTime.now ... .to_s # => "2008-11-10T05:22:03+09:00" =end