meta_tools 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -13
- data/VERSION +1 -1
- data/lib/meta_tools.rb +10 -5
- data/meta_tools.gemspec +2 -22
- metadata +7 -8
- data/Gemfile.lock +0 -14
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/lib/meta_tools.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
module MetaTools
|
2
2
|
# The hidden singleton lurks behind everyone
|
3
3
|
def metaclass
|
4
|
+
puts "Warning: #metaclass will be deprecated in 0.3.0. Use #meta_class"
|
5
|
+
meta_class
|
6
|
+
end
|
7
|
+
|
8
|
+
def meta_class
|
4
9
|
class << self; self; end
|
5
10
|
end
|
6
11
|
|
7
|
-
# Evaluate a block within the instance of the
|
12
|
+
# Evaluate a block within the instance of the meta_class
|
8
13
|
def meta_eval(&blk)
|
9
|
-
|
14
|
+
meta_class.instance_eval(&blk)
|
10
15
|
end
|
11
16
|
|
12
|
-
# Adds methods to a
|
17
|
+
# Adds methods to a meta_class
|
13
18
|
def meta_def(name, &blk)
|
14
19
|
meta_eval { define_method(name, &blk) }
|
15
20
|
end
|
@@ -19,9 +24,9 @@ module MetaTools
|
|
19
24
|
class_eval { define_method(name, &blk) }
|
20
25
|
end
|
21
26
|
|
22
|
-
# Send a method to the
|
27
|
+
# Send a method to the meta_class
|
23
28
|
def meta_send(meth, *args, &blk)
|
24
|
-
|
29
|
+
meta_class.send(meth, *args, &blk)
|
25
30
|
end
|
26
31
|
|
27
32
|
# Send a method to the class
|
data/meta_tools.gemspec
CHANGED
@@ -10,16 +10,9 @@ Gem::Specification.new do |s|
|
|
10
10
|
|
11
11
|
s.name = File.basename(__FILE__, ".gemspec")
|
12
12
|
s.version = File.read("VERSION")
|
13
|
-
# VERSIONING
|
14
|
-
# Some people like to use a YAML file to display the version, some like CSV,
|
15
|
-
# others might just add a constant set to a version string, some (Rack) might
|
16
|
-
# even have an array splitting the version into parts.
|
17
|
-
# Just edit the above line appropriately.
|
18
|
-
# An easy thing to do is set a constant within your app to a version string
|
19
|
-
# and use it in here
|
20
13
|
|
21
14
|
# Add directories you *might* use in ALL projects.
|
22
|
-
s.files = [File.basename(__FILE__)] + Dir['lib/**/*'] + Dir['
|
15
|
+
s.files = [File.basename(__FILE__)] + Dir['lib/**/*'] + Dir['spec/**/*']
|
23
16
|
|
24
17
|
# Add files you *might* use in ALL projects!
|
25
18
|
%W{Gemfile.lock README.* README Rakefile VERSION LICENSE}.each do |file|
|
@@ -31,18 +24,5 @@ Gem::Specification.new do |s|
|
|
31
24
|
(s.extra_rdoc_files ||= []).unshift(file) if File.exists?(file)
|
32
25
|
end
|
33
26
|
|
34
|
-
|
35
|
-
|
36
|
-
# If you only specify one application file in executables, that file becomes
|
37
|
-
# the default executable. Therefore, you only need to specify this value if you
|
38
|
-
# have more than one application file.
|
39
|
-
if s.executables.length > 1
|
40
|
-
if exe = s.executables.find { |e| e.include?(File.basename(__FILE__, ".gemspec")) }
|
41
|
-
s.default_executable = exe
|
42
|
-
else
|
43
|
-
raise(Exception, "Couldn't automatically figure out the default_executable")
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
s.test_files = Dir['test/**/*'] + Dir['examples/**/*']
|
27
|
+
s.test_files = Dir['spec/**/*_spec.rb']
|
48
28
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.3
|
5
4
|
prerelease:
|
5
|
+
version: 0.2.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan Scott Lewis
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-07-03 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
description: A Module that simply contains some methods that help out when metaprogramming.
|
@@ -23,7 +23,6 @@ files:
|
|
23
23
|
- LICENSE
|
24
24
|
- VERSION
|
25
25
|
- Rakefile
|
26
|
-
- Gemfile.lock
|
27
26
|
- meta_tools.gemspec
|
28
27
|
- lib/meta_tools.rb
|
29
28
|
has_rdoc: true
|
@@ -36,18 +35,18 @@ require_paths:
|
|
36
35
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
36
|
none: false
|
38
37
|
requirements:
|
39
|
-
- -
|
38
|
+
- - '>='
|
40
39
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
40
|
+
version: "0"
|
42
41
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
42
|
none: false
|
44
43
|
requirements:
|
45
|
-
- -
|
44
|
+
- - '>='
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
46
|
+
version: "0"
|
48
47
|
requirements: []
|
49
48
|
rubyforge_project:
|
50
|
-
rubygems_version: 1.
|
49
|
+
rubygems_version: 1.4.2
|
51
50
|
signing_key:
|
52
51
|
specification_version: 3
|
53
52
|
summary: Tools for metaprogramming.
|