Professional Documents
Culture Documents
Author:MayankJani,RubyonRailsDeveloper,
CodalInc.
Ruby
isadynamic,objectoriented,opensourceandgeneralpurpose
programminglanguage.Itisfocusonsimplicityandproductivity.Ithasan
elegantsyntaxthatisnaturaltoreadandeasytowrite.
RubyprogramminglanguagewasdesignedanddevelopedbyYukihiro
"Matz"MatsumotoinJapanandreleasedinmid1990s.RubywasinfluencedbyPerl,
Smalltalk,Eiffel,Ada,andLisp.
Rubyisfree,freeofcharge,freetouse,copyit,modifyitanddistributeit.
RubyonRailsframeworkisverypopular,itisdevelopedusingRubyprogramming
language.Rubyhaskeyfeatureslikeobjectoriented,mixins,dynamic,singleton
classes,metaprogramming,flexibility,variables&scope,blocks,exceptionsforerror
handling,garbagecollector,etc.RubyissupportedwithoperatingsystemlikeMACOS
X,Windows,Linux,DOS,etc.
RubyVersions
Untilnow,somanyRubyversionsreleasedwithdifferentfeatureslikeRuby1.8,Ruby
1.9,Ruby2.0,Ruby2.1,Ruby2.2.
Rightnow,Ruby2.3(latestversion)isavailableinthemarketandhasmanynew
featurescomparedtopreviousversions.Someofthesefeaturesinclude:frozenstring
literals,safenavigationoperator,hashcomparison,anddigmethodofhash&array.
Ruby2.3.0isnowalsosupportedonHeroku(cloudplatformasaservice).
YoucaninstallsingleRubyversionintoyourmachineforyourapplicationaswellas
multipleversionsusing
RVM
(RubyVersionManager).MultipleRubiesarehelpfulwhen
yourapplicationsaresupportedwithdifferentRubyversions.Forexample,BlogRails
ApplicationsupportedwithRuby1.9.3andSchoolManagementSystemRails
ApplicationsupportedwithRuby2.3.0.
RubyCode
Rubyisusedtowritebothbasicandsimpleprogramsaswellascomplexapplications.
HereisexampleofabasicRubyprogram:
codal.rb
classCodal
definitialize
putsCodalisaUXdesignanddevelopmentagencybasedinChicago.
end
end
#createanewobject
Codal.new
#runaboveprogramonterminal
$rubycodal.rb
#outputonterminalscreenCodalisaUXdesignanddevelopmentagencybasedin
Chicago.
Rubyprogramfilesextensionis.rbandRubyfileisrunwith
Ruby
commandon
terminal.
Rubyalsoincludesirb(interactiveruby),aninteractivecommandlineinterpreterthat
canbeusedtotestcodequickly.Thefollowingsamplecoderepresentsanirbsession:
$irb
irb(main):001:0>putsHelloWorld
HelloWorld
=>nil
irb(main):002:0>1+2
=>3
GemsareRubypackageswhichcanbeinstalledviacommandlineandwilluseinto
manyRubyandRoRapplications.Mostofthegemsarelibrarieswhicharehostedon
GitHub.
TherearemanyresourcesavailableinthemarketforRubylanguagesuchasonline
courses,screencasts,ebooks,IRCchannels,communities,blogs,forums,etc.
Conclusion:RapidlyGrowingLanguage
Finally,asRubyprogramminglanguageisrapidlygrowingintothemarket,webbased
companiesarechoosingtheRubylanguagefor
webapplicationdevelopment
morethan
everbefore.Rubyiseasytolearn,somanywebdevelopersareselectingRubytolearn
asafirstlanguage.OneofthemainreasonsthatRubyisgrowingsorapidlyisbecause
ofitspopularframework,calledRubyonRails.