Skip to content

Instantly share code, notes, and snippets.

@jqr
Created April 1, 2009 04:02
Show Gist options
  • Save jqr/88531 to your computer and use it in GitHub Desktop.
Save jqr/88531 to your computer and use it in GitHub Desktop.
#!/usr/bin/env /some/rails/project/script/runner
# Shows every class that contains capitalized method names and the "offending" methods.
methods = {}
ObjectSpace.each_object(Class) do |klass|
capitalized_methods = klass.methods.select { |m| m =~ /[A-Z]/ }
unless capitalized_methods.empty?
methods[klass] = capitalized_methods
end
end
puts methods.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment