meta_tools 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/{README → README.md} +10 -3
- data/VERSION +1 -1
- data/lib/meta_tools.rb +13 -2
- data/test/helper.rb +1 -1
- metadata +25 -40
data/Gemfile
ADDED
data/{README → README.md}
RENAMED
@@ -1,8 +1,15 @@
|
|
1
|
-
|
1
|
+
# meta_tools
|
2
2
|
|
3
3
|
A Module that simply contains some methods that help out when metaprogramming.
|
4
4
|
|
5
|
-
|
5
|
+
Source [Source](http://dannytatom.github.com/metaid/ "Source")
|
6
|
+
|
7
|
+
# Notice
|
8
|
+
|
9
|
+
This gem is very social!
|
10
|
+
Be *sure* to follow the guide below to get your code into this gem!
|
11
|
+
|
12
|
+
## Contributing to meta_tools
|
6
13
|
|
7
14
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
15
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
@@ -12,7 +19,7 @@ A Module that simply contains some methods that help out when metaprogramming.
|
|
12
19
|
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
20
|
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
21
|
|
15
|
-
|
22
|
+
## Copyright
|
16
23
|
|
17
24
|
Copyright (c) 2011 Ryan Lewis. See LICENSE.txt for
|
18
25
|
further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/meta_tools.rb
CHANGED
@@ -3,7 +3,8 @@ module MetaTools
|
|
3
3
|
def metaclass
|
4
4
|
class << self; self; end
|
5
5
|
end
|
6
|
-
|
6
|
+
|
7
|
+
# Evaluate a block within the instance of the metaclass
|
7
8
|
def meta_eval(&blk)
|
8
9
|
metaclass.instance_eval(&blk)
|
9
10
|
end
|
@@ -17,4 +18,14 @@ module MetaTools
|
|
17
18
|
def class_def(name, &blk)
|
18
19
|
class_eval { define_method(name, &blk) }
|
19
20
|
end
|
20
|
-
|
21
|
+
|
22
|
+
# Send a method to the metaclass
|
23
|
+
def meta_send(meth, *args, &blk)
|
24
|
+
metaclass.send(meth, *args, &blk)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Send a method to the class
|
28
|
+
def class_send(meth, *args, &blk)
|
29
|
+
self.class.send
|
30
|
+
end
|
31
|
+
end
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,36 +1,29 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_tools
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
version: 0.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Ryan Lewis
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
date: 2011-04-20 00:00:00 -04:00
|
12
|
+
date: 2011-05-22 00:00:00.000000000 -04:00
|
18
13
|
default_executable:
|
19
14
|
dependencies: []
|
20
|
-
|
21
15
|
description: A Module that simply contains some methods that help out when metaprogramming.
|
22
16
|
email: c00lryguy@gmail.com
|
23
17
|
executables: []
|
24
|
-
|
25
18
|
extensions: []
|
26
|
-
|
27
|
-
extra_rdoc_files:
|
19
|
+
extra_rdoc_files:
|
28
20
|
- LICENSE.txt
|
29
|
-
- README
|
30
|
-
files:
|
21
|
+
- README.md
|
22
|
+
files:
|
31
23
|
- .document
|
24
|
+
- Gemfile
|
32
25
|
- LICENSE.txt
|
33
|
-
- README
|
26
|
+
- README.md
|
34
27
|
- Rakefile
|
35
28
|
- VERSION
|
36
29
|
- lib/meta_tools.rb
|
@@ -38,36 +31,28 @@ files:
|
|
38
31
|
- test/test_meta_tools.rb
|
39
32
|
has_rdoc: true
|
40
33
|
homepage: http://github.com/c00lryguy/meta_tools
|
41
|
-
licenses:
|
34
|
+
licenses:
|
42
35
|
- MIT
|
43
36
|
post_install_message:
|
44
37
|
rdoc_options: []
|
45
|
-
|
46
|
-
require_paths:
|
38
|
+
require_paths:
|
47
39
|
- lib
|
48
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
41
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
55
|
-
version: "0"
|
56
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
47
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
- 0
|
63
|
-
version: "0"
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
64
52
|
requirements: []
|
65
|
-
|
66
53
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.
|
54
|
+
rubygems_version: 1.6.2
|
68
55
|
signing_key:
|
69
56
|
specification_version: 3
|
70
57
|
summary: A Module that simply contains some methods that help out when metaprogramming.
|
71
|
-
test_files:
|
72
|
-
- test/helper.rb
|
73
|
-
- test/test_meta_tools.rb
|
58
|
+
test_files: []
|