dannytatom-metaid 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.mkd +12 -0
  2. data/lib/metaid.rb +26 -0
  3. metadata +56 -0
@@ -0,0 +1,12 @@
1
+ # metaid
2
+
3
+ metaid is a tiny library for aiding metaprogramming.
4
+
5
+ ## Documentation
6
+
7
+ _why's article [Seeing Metaclasses Clearly](http://dannytatom.github.com/metaid) is the closest to "docs" available for metaid.
8
+
9
+ ## Authors
10
+
11
+ metaid was originally created by [why the lucky stiff](http://en.wikipedia.org/wiki/Why_the_lucky_stiff),
12
+ but is now being maintained by [Danny Tatom](http://dannytatom.com) as of August 22, 2009.
@@ -0,0 +1,26 @@
1
+ # metaid
2
+ # ------
3
+ # a few simple metaclass helpers
4
+ #
5
+ # http://github.com/dannytatom/metaid
6
+ class Object
7
+ # The hidden singleton lurks behind everyone
8
+ def metaclass; class << self; self; end; end
9
+ def meta_eval &blk; metaclass.instance_eval &blk; end
10
+
11
+ # Adds methods to a metaclass
12
+ def meta_def name, &blk
13
+ meta_eval { define_method name, &blk }
14
+ end
15
+ end
16
+
17
+ class Module
18
+ # Defines an instance method within a module
19
+ def module_def name, &blk
20
+ module_eval { define_method name, &blk }
21
+ end
22
+ end
23
+
24
+ class Class
25
+ alias class_def module_def
26
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dannytatom-metaid
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - why the lucky stiff
8
+ - Danny Tatom
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-05-16 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: metaid is a tiny library for aiding metaprogramming
18
+ email: dannytatom@gmail.com
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files: []
24
+
25
+ files:
26
+ - README.mkd
27
+ - lib/metaid.rb
28
+ has_rdoc: false
29
+ homepage: http://github.com/dannytatom/metaid
30
+ licenses:
31
+ post_install_message:
32
+ rdoc_options: []
33
+
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: "0"
41
+ version:
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ version:
48
+ requirements: []
49
+
50
+ rubyforge_project:
51
+ rubygems_version: 1.3.5
52
+ signing_key:
53
+ specification_version: 2
54
+ summary: metaid is a tiny library for aiding metaprogramming
55
+ test_files: []
56
+