Project

General

Profile

Bug #12233

Please consider adding documentation to DateTime, one line, require 'date'

Added by shevegen (Robert A. Heiler) over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:74729]

Description

The ruby DateTime page does not include this line:

require 'date'

It just happened on IRC right now (I edited/truncated a bit here):

<schemanic> Can anyone tell me why in irb Date/Time/DateTime gives me NameError: uninitialized constant DateTime
<apeiros> schemanic: because you forgot to require 'date'?
<apeiros> though, Time in that list won't give you a NameError
<schemanic> sigh. Okay. I'm sorry - the Ruby doc code example didn't have the requirement statement

The documentation can be found here:

http://ruby-doc.org/stdlib/libdoc/date/rdoc/DateTime.html
http://ruby-doc.org/stdlib-2.3.0/libdoc/date/rdoc/DateTime.html

I suggest to add the require 'date' close to the top of that page, to help newcomers not be too
confused about how to use it.

PS: On a side note, perhaps another subsection could be added to the ruby bug/issue tracker here, a subsection
solely for docs? That way, people could report suggestions to improve the documentation there. Anyway that's
just a semi-random suggestion. :)

Associated revisions

Revision f85ff1ed
Added by nobu (Nobuyoshi Nakada) over 3 years ago

date_core.c: fix DateTime rdoc

  • ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc of DateTime. [ruby-core:74729] [Bug #12233]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 54444
Added by nobu (Nobuyoshi Nakada) over 3 years ago

date_core.c: fix DateTime rdoc

  • ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc of DateTime. [ruby-core:74729] [Bug #12233]

Revision 54444
Added by nobu (Nobuyoshi Nakada) over 3 years ago

date_core.c: fix DateTime rdoc

  • ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc of DateTime. [ruby-core:74729] [Bug #12233]

Revision 54444
Added by nobu (Nobuyoshi Nakada) over 3 years ago

date_core.c: fix DateTime rdoc

  • ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc of DateTime. [ruby-core:74729] [Bug #12233]

Revision 54444
Added by nobu (Nobuyoshi Nakada) over 3 years ago

date_core.c: fix DateTime rdoc

  • ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc of DateTime. [ruby-core:74729] [Bug #12233]

Revision 0e30b44a
Added by naruse (Yui NARUSE) over 3 years ago

merge revision(s) 54444: [Backport #12233]

    * ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
      of DateTime.  [ruby-core:74729] [Bug #12233]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 54631
Added by naruse (Yui NARUSE) over 3 years ago

merge revision(s) 54444: [Backport #12233]

* ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
  of DateTime.  [ruby-core:74729] [Bug #12233]

Revision 658cd087
Added by usa (Usaku NAKAMURA) about 3 years ago

merge revision(s) 54444: [Backport #12233]

    * ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
      of DateTime.  [ruby-core:74729] [Bug #12233]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 54678
Added by usa (Usaku NAKAMURA) about 3 years ago

merge revision(s) 54444: [Backport #12233]

* ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc
  of DateTime.  [ruby-core:74729] [Bug #12233]

History

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Tracker changed from Misc to Bug
  • Backport set to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED
#2

Updated by nobu (Nobuyoshi Nakada) over 3 years ago

  • Status changed from Open to Closed

Applied in changeset r54444.


date_core.c: fix DateTime rdoc

  • ext/date/date_core.c (Init_date_core): [DOC] fix misplaced doc of DateTime. [ruby-core:74729] [Bug #12233]

Updated by naruse (Yui NARUSE) over 3 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE

ruby_2_3 r54631 merged revision(s) 54444.

Updated by usa (Usaku NAKAMURA) about 3 years ago

  • Backport changed from 2.1: REQUIRED, 2.2: REQUIRED, 2.3: DONE to 2.1: REQUIRED, 2.2: DONE, 2.3: DONE

ruby_2_2 r54678 merged revision(s) 54444.

Also available in: Atom PDF