how to execute a ruby program which is inside a string ?
for example
ex.rb
puts “start "
temp=”(1…10).each do |count| print count end "
puts “end”
how to execute the source code in temp(String object)
how to execute a ruby program which is inside a string ?
for example
ex.rb
puts “start "
temp=”(1…10).each do |count| print count end "
puts “end”
how to execute the source code in temp(String object)
On 10 Aug 2007, at 17:51, Pokkai D. wrote:
how to execute the source code in temp(String object)
eval(temp)
Hope this helps.
Douglas F Shearer
[email protected]
On Friday 10 August 2007 09:51:55 am Pokkai D. wrote:
how to execute a ruby program which is inside a string ?
for example
ex.rbputs “start "
temp=”(1…10).each do |count| print count end "
puts “end”how to execute the source code in temp(String object)
eval(string), but this is always what NOT-WHAT-YOU-WANT-TO-DO.
Pokkai D. wrote:
how to execute a ruby program which is inside a string ?
eval
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs