Zombie Rails - Laboratories

I'm curious to learn how the Rails for Zombies training site works. The user must answer a series of laboratory questions by typing a ruby ​​code at the (something similar) command line prompt to complete each laboratory. When sending, determines whether they can proceed to the next laboratory question.

Peeking into the DOM via Firebug, it looks like they are using the canvas tag - I assume this is a command line, right? Also, on the Ruby side, how do they guarantee that the code you enter is what is required to answer the question? Or do they just have a test setup using RSpec / Cucumber?

Any help is much appreciated. :)

+4
source share
2 answers

For the browser code editor, we use Mozilla Bespin, now known as Skywriter . For server-side evaluation, we use the sandbox to run Ruby code, as Andy Lindeman stated. In most cases, as you expected, we use tests to ensure that the code does what you should do.

This is definitely not a simple piece of code. If you are interested in using our engine to create a tutorial, please contact us. Gregg at EnvyLabs.

+14
source

I do not work for Envy Labs, but I think that the Ruby code is simply sent as is to the server, where it runs as a sandbox.

It probably works similar to tryruby.org , the source of which is freely available for your reading pleasure :)

+6
source

Source: https://habr.com/ru/post/1335845/


All Articles