[ad_1]
RubyonRails is just like most programming languages Rails, is a server-side net software framework written in Ruby below the MIT License the place in a single can use the command line in home windows or a terminal in Unix based mostly methods. All applications ought to be written and saves in plain textual content format for the compiler and interpreter to course of it simply.The primary program would provide you with a really feel for the general syntax of how this system is created and what the compiler does. Kind the next code into the textual content file to see how it’s finished:
—————————————-
#it is a pattern program
a = “That is”
b = “my first Ruby Program”
print “The concatenated line is:”
print a << b
——————————————-
The best way to Save the Ruby Program:
Save the textual content file with the next filename “first1.rb” and we now go into the syntax checking perform and the power supplied to point out the syntax verify verbosely. The next code reveals how code is checked for syntax correctness and returns the results of the mentioned checking by typing the next code:
$ ruby:cw first1.rb
The “-c” flag initiates Ruby’s syntax checker whereas the “w” flag reveals the results of the syntax checker. If there is no such thing as a difficulty with the code being checked you get a “Syntax OK” outcome which suggests you may execute the code for there are not any syntax points. Kind $ruby first1.rb on the command line and also you get the outcome ” The concatenated line is: That is my first Ruby Program “
About Ruby on Rails Textual content Editor:
Extra on textual content editors which can be used with RoR and we not talk about VIM or Vi Improved. Vim like Emacs is sort of environment friendly and straightforward to make use of with RoR supplied it’s set-up correctly. The great about Vim is that it has the nifty approach of highlighting syntax in ruby making it straightforward to hint and debug. It options superior options corresponding to having a selective command and insert mode with the primary being the default mode upon startup. It isn’t a phrase processor so fonts and different phrase processor options are to not be anticipated.
TextPad:
One of many quickest and best to make use of as a textual content editor for making RoR applications with simple interface and options principally adept to home windows customers. Although thought-about a textual content editor it’s able to syntax highlighting, search, spell verify and macro recording which makes it a selection of many builders.
ArachnoRuby:
Is deployable on each home windows based mostly and Unix based mostly methods and is taken into account to be the native editor of RoR. It was not too consumer pleasant so it shortly misplaced favor of many builders who turned to the opposite specified editors for programming code.
Reference: Rails Sample Examples and Tutorials