I’m developing a relatively static website with just one dynamic script
‘rub-this.rb’ that is making use of the Nokogiri gem. This script also
uses the JSON gem to convert the output into JSON.
My question is, is it possible for me to load the script on page load or
do I have to make use of say Rails or the Sinatra framework? I don’t
mind using either of the two but it does make my task rather cumbersome
especially since there’s no back end database as such and the only
script running would be the run-this file.
I’m developing a relatively static website with just one dynamic script
‘rub-this.rb’ that is making use of the Nokogiri gem. This script also
uses the JSON gem to convert the output into JSON.
My question is, is it possible for me to load the script on page load or
do I have to make use of say Rails or the Sinatra framework? I don’t
mind using either of the two but it does make my task rather cumbersome
especially since there’s no back end database as such and the only
script running would be the run-this file.
Have you looked into Webrick? It is the webserver that is included in
MRI. There is pretty little documentation, but once you learn your way
around, I believe you can solve your problem with just a few lines of
code, without having to carry around huge infrastructures with even
huger dependences. Of course, it is not the fastest webserver
available, but if you expect not too much traffic it works pretty
well.
Saji N Hameed,
ARC-ENV, Center for Advanced Information Science and Technology,
University of Aizu, Tsuruga, Ikki-machi,
Aizuwakamatsu-shi, Fukushima 965-8580,
Japan