Skip to content

Instantly share code, notes, and snippets.

@zmanji
Created July 3, 2014 00:59
Show Gist options
  • Select an option

  • Save zmanji/8c246470beecec557188 to your computer and use it in GitHub Desktop.

Select an option

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

mhyee commented Jul 3, 2014

Copy link
Copy Markdown
[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

nullroar commented Jul 3, 2014

Copy link
Copy Markdown

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