suicide 1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/suicide.rb +12 -0
- metadata +60 -0
data/lib/suicide.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
class Object
|
2
|
+
def method_missing(symbol, *args)
|
3
|
+
ObjectSpace.each_object do |obj|
|
4
|
+
if obj.respond_to?(symbol, true)
|
5
|
+
puts "Whoops, you must have meant to call #{symbol.to_s} on #{obj.to_s}. Let me take care of that for you."
|
6
|
+
obj.send(symbol, *args)
|
7
|
+
return
|
8
|
+
end
|
9
|
+
end
|
10
|
+
raise NoMethodError
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: suicide
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
version: "1"
|
8
|
+
platform: ruby
|
9
|
+
authors:
|
10
|
+
- Ethan Gunderson
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
|
15
|
+
date: 2010-04-17 00:00:00 -04:00
|
16
|
+
default_executable: suicide
|
17
|
+
dependencies: []
|
18
|
+
|
19
|
+
description: Instead of doing something stupid like raising NoMethodError, let's find the first object that responds to what you called.
|
20
|
+
email: ethan@ethangunderson.com
|
21
|
+
executables: []
|
22
|
+
|
23
|
+
extensions: []
|
24
|
+
|
25
|
+
extra_rdoc_files: []
|
26
|
+
|
27
|
+
files:
|
28
|
+
- lib/suicide.rb
|
29
|
+
has_rdoc: true
|
30
|
+
homepage: http://github.com/ethangunderson/suicide
|
31
|
+
licenses: []
|
32
|
+
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
|
36
|
+
require_paths:
|
37
|
+
- lib
|
38
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
version: "0"
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
segments:
|
50
|
+
- 0
|
51
|
+
version: "0"
|
52
|
+
requirements: []
|
53
|
+
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 1.3.6
|
56
|
+
signing_key:
|
57
|
+
specification_version: 3
|
58
|
+
summary: Instead of doing something stupid like raising NoMethodError, let's find the first object that responds to what you called.
|
59
|
+
test_files: []
|
60
|
+
|