The spaceship operator is general comparison operator. The <=> operator compares 2 values and returning -1, 0, or 1 depending on whether the first value is less than, equal, or greater than the second.
Example in irb.
This operator is used on ruby range operation , objects must implement <=> and succ method to perform range operation. Lets test the a numeric value for these methods.
Ruby programming language have constant like other language we know ? Or Ruby dont have ?
Ruby have naming convention related to variable names. If a variable name begin with upper case then its considered constant. Ruby wont stop you to change that constant, it only emit warning like a test case below on irb.
To host sinatra ruby web application on NetBSD 9 we need to install apache http server, ruby, and passenger.
To install ruby 2.6, login as root and do pkgin install ruby. This will automatically install ruby version 2.6. After installed, install sinatra and your other gems using gem install sinatra.
Next is to install apache http server. On terminal execute pkgin install apache. Copy rc.d script from /usr/pkg/share/examples/rc.d/apache to /etc/rc.d folder (this step just following after install message). Edit /etc/rc.conf and add a line containing apache=YES to enable auto start of apache on system start up.
Install passenger module to apache by executing pkgin install ap24-ruby26-passenger. After install edit /usr/pkg/etc/httpd/httpd.conf and add as follow.