Skip to content

Instantly share code, notes, and snippets.

@codahale
Created February 25, 2009 21:17
Show Gist options
  • Save codahale/70417 to your computer and use it in GitHub Desktop.
Save codahale/70417 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
$existing_methods = []
def print_methods(library)
new_methods = [].methods.sort - $existing_methods
for method in new_methods
puts "Array##{method}"
end
puts "(total: #{new_methods.size} added by #{library})\n\n"
$existing_methods = [].methods.sort
end
puts "Standard: ==============================================================="
print_methods("stdlib")
puts "RubyGems: ==============================================================="
require "rubygems"
print_methods("rubygems")
puts "ActiveSupport: =========================================================="
require "activesupport"
print_methods("activesupport")
puts "Undocumented Methods: ==================================================="
require "rdoc/ri/driver"
class HeadlessDriver < RDoc::RI::Driver
def documented?(name)
if class_cache.key? name then
return true
elsif name =~ /::|\#|\./ then
method = nil
klass, = parse_name name
klass = expand_klass klass unless class_cache.key? klass
orig_klass = klass
orig_name = name
loop do
method = lookup_method name, klass
break if method
ancestor = lookup_ancestor klass, orig_klass
break unless ancestor
name = name.sub klass, ancestor
klass = ancestor
end
return !method.nil?
else
methods = select_methods(/#{name}/)
if methods.size == 0
return false
else
return true
end
end
end
end
driver = HeadlessDriver.new
for method in [].methods.sort
m = "Array##{method}"
unless driver.documented?(m)
puts "#{m} is a total fucking mystery"
end
end
Standard: ===============================================================
Array#&
Array#*
Array#+
Array#-
Array#<<
Array#<=>
Array#==
Array#===
Array#=~
Array#[]
Array#[]=
Array#__id__
Array#__send__
Array#all?
Array#any?
Array#assoc
Array#at
Array#class
Array#clear
Array#clone
Array#collect
Array#collect!
Array#compact
Array#compact!
Array#concat
Array#delete
Array#delete_at
Array#delete_if
Array#detect
Array#display
Array#dup
Array#each
Array#each_index
Array#each_with_index
Array#empty?
Array#entries
Array#eql?
Array#equal?
Array#extend
Array#fetch
Array#fill
Array#find
Array#find_all
Array#first
Array#flatten
Array#flatten!
Array#freeze
Array#frozen?
Array#grep
Array#hash
Array#id
Array#include?
Array#index
Array#indexes
Array#indices
Array#inject
Array#insert
Array#inspect
Array#instance_eval
Array#instance_of?
Array#instance_variable_defined?
Array#instance_variable_get
Array#instance_variable_set
Array#instance_variables
Array#is_a?
Array#join
Array#kind_of?
Array#last
Array#length
Array#map
Array#map!
Array#max
Array#member?
Array#method
Array#methods
Array#min
Array#nil?
Array#nitems
Array#object_id
Array#pack
Array#partition
Array#pop
Array#private_methods
Array#protected_methods
Array#public_methods
Array#push
Array#rassoc
Array#reject
Array#reject!
Array#replace
Array#respond_to?
Array#reverse
Array#reverse!
Array#reverse_each
Array#rindex
Array#select
Array#send
Array#shift
Array#singleton_methods
Array#size
Array#slice
Array#slice!
Array#sort
Array#sort!
Array#sort_by
Array#taint
Array#tainted?
Array#to_a
Array#to_ary
Array#to_s
Array#transpose
Array#type
Array#uniq
Array#uniq!
Array#unshift
Array#untaint
Array#values_at
Array#zip
Array#|
(total: 119 added by stdlib)
RubyGems: ===============================================================
Array#taguri
Array#taguri=
Array#to_yaml
Array#to_yaml_properties
Array#to_yaml_style
Array#yaml_initialize
(total: 6 added by rubygems)
ActiveSupport: ==========================================================
Array#`
Array#acts_like?
Array#b64encode
Array#blank?
Array#breakpoint
Array#class_eval
Array#copy_instance_variables_from
Array#daemonize
Array#dclone
Array#debugger
Array#decode64
Array#decode_b
Array#duplicable?
Array#each_cons
Array#each_slice
Array#each_with_object
Array#enable_warnings
Array#encode64
Array#enum_cons
Array#enum_for
Array#enum_slice
Array#enum_with_index
Array#extend_with_included_modules_from
Array#extended_by
Array#extract_options!
Array#fifth
Array#forty_two
Array#fourth
Array#from
Array#group_by
Array#in_groups
Array#in_groups_of
Array#index_by
Array#instance_exec
Array#instance_values
Array#instance_variable_names
Array#load_with_new_constant_marking
Array#many?
Array#metaclass
Array#present?
Array#rand
Array#remove_subclasses_of
Array#require
Array#require_association
Array#require_dependency
Array#require_library_or_gem
Array#require_or_load
Array#returning
Array#second
Array#silence_stderr
Array#silence_stream
Array#silence_warnings
Array#split
Array#subclasses_of
Array#sum
Array#suppress
Array#third
Array#to
Array#to_default_s
Array#to_enum
Array#to_formatted_s
Array#to_json
Array#to_param
Array#to_query
Array#to_sentence
Array#to_set
Array#to_xml
Array#unloadable
Array#with_options
(total: 69 added by activesupport)
Undocumented Methods: ===================================================
Array#` is a total fucking mystery
Array#b64encode is a total fucking mystery
Array#breakpoint is a total fucking mystery
Array#class_eval is a total fucking mystery
Array#copy_instance_variables_from is a total fucking mystery
Array#daemonize is a total fucking mystery
Array#debugger is a total fucking mystery
Array#decode64 is a total fucking mystery
Array#decode_b is a total fucking mystery
Array#each_with_object is a total fucking mystery
Array#enable_warnings is a total fucking mystery
Array#encode64 is a total fucking mystery
Array#extend_with_included_modules_from is a total fucking mystery
Array#extended_by is a total fucking mystery
Array#fifth is a total fucking mystery
Array#forty_two is a total fucking mystery
Array#fourth is a total fucking mystery
Array#from is a total fucking mystery
Array#in_groups is a total fucking mystery
Array#in_groups_of is a total fucking mystery
Array#instance_values is a total fucking mystery
Array#instance_variable_names is a total fucking mystery
Array#load_with_new_constant_marking is a total fucking mystery
Array#many? is a total fucking mystery
Array#metaclass is a total fucking mystery
Array#present? is a total fucking mystery
Array#rand is a total fucking mystery
Array#remove_subclasses_of is a total fucking mystery
Array#require is a total fucking mystery
Array#require_association is a total fucking mystery
Array#require_dependency is a total fucking mystery
Array#require_library_or_gem is a total fucking mystery
Array#require_or_load is a total fucking mystery
Array#second is a total fucking mystery
Array#silence_stderr is a total fucking mystery
Array#silence_stream is a total fucking mystery
Array#silence_warnings is a total fucking mystery
Array#split is a total fucking mystery
Array#subclasses_of is a total fucking mystery
Array#suppress is a total fucking mystery
Array#taguri is a total fucking mystery
Array#taguri= is a total fucking mystery
Array#third is a total fucking mystery
Array#to is a total fucking mystery
Array#to_default_s is a total fucking mystery
Array#to_formatted_s is a total fucking mystery
Array#to_sentence is a total fucking mystery
Array#to_xml is a total fucking mystery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment