Ruby Web Page Example

Some of our examples will also use a sinatra application.
Ruby web page example. Ruby is an interpreted high level general purpose programming language it was designed and developed in the mid 1990s by yukihiro matz matsumoto in japan. To execute our example hello ruby code therefore we could enter the following command. Ruby is a general purpose language. By default opern uri calls it browser ruby which does not say mutch.
This is achieved by using the e command line flag. Ruby annotations are for showing pronunciation of east asian characters. Ruby e print hello ruby n hello ruby. Sinatra is a popular ruby web application framework.
It can t properly be called a web language at all. The html ruby element represents a ruby annotation. We can change it to whatever we want by passing user agent to the open call. Even so web applications and web tools in general are among the most common uses of ruby.
The same happens when we open a web page using the open function supplied by the open uri module. Sudo gem install sinatra sudo gem install thin we install sinatra and thin web server. Ruby allows lines of code to be executed as command line options to the ruby tool. It is easy to install and set up.
Ruby annotations are for showing pronunciation of east asian characters. The source for this interactive example is stored in a github repository.