gen_eval 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/Rakefile +1 -39
- data/lib/gen_eval/version.rb +1 -1
- metadata +3 -7
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
gen_eval is a homebrew version of instance_eval that eliminates the most annoying aspect of
|
1
|
+
gen_eval is a homebrew version of instance_eval that eliminates the most annoying aspect of its use:
|
2
2
|
|
3
3
|
For example:
|
4
4
|
|
@@ -10,7 +10,7 @@ For example:
|
|
10
10
|
|
11
11
|
=> error @x not initialized
|
12
12
|
|
13
|
-
In the above code
|
13
|
+
In the above code the programmer means to access the local @x yet instance_eval looks up @x in the receiver (my_image).
|
14
14
|
|
15
15
|
gen_eval, on the other hand, works as you'd expect, it looks up @x in the caller-context yet still invokes methods in the receiver-context.
|
16
16
|
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rake/clean'
|
|
2
2
|
#require 'rake/extensiontask'
|
3
3
|
require 'rake/gempackagetask'
|
4
4
|
require 'rake/rdoctask'
|
5
|
-
require 'lib/gen_eval/version'
|
5
|
+
require './lib/gen_eval/version'
|
6
6
|
|
7
7
|
dlext = Config::CONFIG['DLEXT']
|
8
8
|
direc = File.dirname(__FILE__)
|
@@ -32,44 +32,6 @@ Rake::GemPackageTask.new(spec) do |pkg|
|
|
32
32
|
pkg.need_tar = false
|
33
33
|
end
|
34
34
|
|
35
|
-
ext_direc = "#{direc}/ext/gen_eval"
|
36
|
-
|
37
|
-
file "#{ext_direc}/Makefile" => "#{ext_direc}/extconf.rb" do
|
38
|
-
chdir(ext_direc) do
|
39
|
-
sh 'ruby extconf.rb'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
directory "#{direc}/lib/1.9"
|
44
|
-
directory "#{direc}/lib/1.8"
|
45
|
-
|
46
|
-
file "#{ext_direc}/gen_eval.#{dlext}" => ["#{ext_direc}/Makefile", "#{direc}/lib/1.9", "#{direc}/lib/1.8"] do
|
47
|
-
chdir(ext_direc) do
|
48
|
-
sh 'make'
|
49
|
-
|
50
|
-
if RUBY_VERSION =~ /1.9/
|
51
|
-
cp "gen_eval.#{dlext}", "#[direc}/lib/1.9/"
|
52
|
-
puts "built gen_eval.#{dlext} and copied to #{direc}/lib/1.9"
|
53
|
-
elsif RUBY_VERSION =~ /1.8/
|
54
|
-
cp "gen_eval.#{dlext}", "#[direc}/lib/1.8/"
|
55
|
-
puts "built gen_eval.#{dlext} and copied to #{direc}/lib/1.8"
|
56
|
-
else
|
57
|
-
raise "Error, Rakefile only supports Ruby 1.8 and 1.9"
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
task :compile => "#{ext_direc}/gen_eval.#{dlext}"
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
# Rake::ExtensionTask.new('mult', spec) do |ext|
|
68
|
-
# ext.config_script = 'extconf.rb'
|
69
|
-
# ext.cross_compile = true
|
70
|
-
# ext.cross_platform = 'i386-mswin32'
|
71
|
-
# end
|
72
|
-
|
73
35
|
Rake::RDocTask.new do |rd|
|
74
36
|
rd.main = "README.rdoc"
|
75
37
|
rd.rdoc_files.include("README.rdoc", "lib/gen_eval.rb")
|
data/lib/gen_eval/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gen_eval
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 19
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- John Mair (banisterfiend)
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-10-09 00:00:00 +13:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 19
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
- 3
|
@@ -66,7 +64,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
64
|
requirements:
|
67
65
|
- - ">="
|
68
66
|
- !ruby/object:Gem::Version
|
69
|
-
hash: 3
|
70
67
|
segments:
|
71
68
|
- 0
|
72
69
|
version: "0"
|
@@ -75,7 +72,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
72
|
requirements:
|
76
73
|
- - ">="
|
77
74
|
- !ruby/object:Gem::Version
|
78
|
-
hash: 3
|
79
75
|
segments:
|
80
76
|
- 0
|
81
77
|
version: "0"
|