Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (604 Bytes)
Bug #8100
» fail.rb
Reduced script -
judofyr (Magnus Holm)
, 03/22/2013 06:38 PM
class
Fail
def
render
(
scope
=
Object
.
new
)
compiled_method
.
bind
(
scope
).
call
end
def
compiled_method
@compiled_method
||=
compile_template_method
end
def
source
"Hello world"
.
inspect
end
def
compile_template_method
method_name
=
"__tilt_
#{
Thread
.
current
.
object_id
.
abs
}
"
Object
.
class_eval
(
"def
#{
method_name
}
;
#{
source
}
end"
)
unbind_compiled_method
(
method_name
)
end
def
unbind_compiled_method
(
method_name
)
method
=
Object
.
instance_method
(
method_name
)
Object
.
class_eval
{
remove_method
(
method_name
)
}
method
end
end
loop
do
Fail
.
new
.
render
end
« Previous
1
2
3
4
Next »
(4-4/4)
Loading...