Evaluate the code passed as a String as a new Run

run_code  code (string)

Executes the code passed as a string in a new Run. This works as if the code was in a buffer and Run button was pressed.

Introduced in v2.11

Examples

# Example 1

run_code "sample :ambi_lunar_land"



#=> will play the :ambi_lunar_land sample



# Example 2


run_code "8.times do
play 60
sleep 1
end"



# Works with any amount of code:
 
 
 
# will play 60 8 times