Skip to content

Instantly share code, notes, and snippets.

@zmanji
Created July 3, 2014 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmanji/8c246470beecec557188 to your computer and use it in GitHub Desktop.
Save zmanji/8c246470beecec557188 to your computer and use it in GitHub Desktop.
What is wrong with Ruby?
Zameers-MacBook-Air:~ zmanji$ pry
[1] pry(main)> puts RUBY_VERSION
1.9.3
=> nil
[2] pry(main)> Date.methods.length
=> 104
[3] pry(main)> require "date"
=> true
[4] pry(main)> Date.methods.length
=> 135
[5] pry(main)> puts "WAT"
WAT
=> nil
[6] pry(main)>
@mhyee
Copy link

mhyee commented Jul 3, 2014

[1] pry(main)> puts RUBY_VERSION
1.9.3
=> nil
[2] pry(main)> pre = Date.methods;
[3] pry(main)> pre.length
=> 104
[4] pry(main)> require 'date'
=> true
[5] pry(main)> post = Date.methods;
[6] pry(main)> post.length
=> 135
[7] pry(main)> intersection = pre & post;
[8] pry(main)> intersection.length
=> 104
[9] pry(main)> Object.methods.length
=> 104
[10] pry(main)> (intersection - Object.methods).length
=> 0

That's the extent of my 10-minute investigation. No idea why there'd be a Date class that has only the methods in Object.

@nullroar
Copy link

nullroar commented Jul 3, 2014

Out of curiosity, was 135 the correct DOY when you pulled this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment