资源描述:
《original_Pragmatic-Programming.Ruby.1.9.pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、ProgrammingRuby1.9ThePragmaticProgrammers’GuideDaveThomaswithChadFowlerandAndyHuntThePragmaticBookshelfRaleigh,NorthCarolinaDallas,TexasManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andThe
2、PragmaticProgrammers,LLC,wasawareofatrademarkclaim,thedesignationshavebeenprintedininitialcapitallettersorinallcapitals.Everyprecautionwastakeninthepreparationofthisbook.However,thepublisherassumesnoresponsibilityforerrorsoromissionsorfordamagesthatmayresultfromtheuseofinformatio
3、n(includingprogramlistings)containedherein.ThisbookisaheavilyrevisedversionofthebookProgrammingRuby,originallypublishedbyAddisonWesley.Thisbookisprintedwiththeirpermission.OurPragmaticcourses,workshops,andotherproductscanhelpyouandyourteamcreatebettersoftwareandhavemorefun.Formor
4、einformation,aswellasthelatestPragmatictitles,pleasevisitusathttp://www.pragmaticprogrammer.comCopyright©2009ThePragmaticProgrammers,LLC.Allrightsreserved.Nopartofthispublicationmayberepro-duced,storedinaretrievalsystem,ortransmitted,inanyform,orbyanymeans,electronic,mechanical,p
5、hotocopy-ing,recording,orotherwise,withoutthepriorconsentofthepublisher.PrintedintheUnitedStatesofAmerica.ISBN:1-934356-08-5ISBN-13:978-1-934356-08-1Textprintedonacid-freepaper.ContentsFOREWORD16PREFACE17ROADMAP22PARTIFACETSOFRUBY1GETTINGSTARTED25TheCommandPrompt.................
6、.............25InstallingRuby..................................27RunningRuby...................................30RubyDocumentation:RDocandri........................322RUBY.NEW35RubyIsanObject-OrientedLanguage......................35SomeBasicRuby.................................37
7、ArraysandHashes.................................40Symbols......................................42ControlStructures.................................43RegularExpressions................................45BlocksandIterators................................46Readingand’Riting..........
8、......................48Command-LineArgu