Ruby ÃüÁîÐÐ ³£ÓÃÃüÁî
´ÓÃüÁîÐÐÆô¶¯Ruby½âÊÍÆ÷ʱ£¬Äã²»½ö¿ÉÒÔÌṩ³ÌÐòÎļþµÄÃû×Ö£¬¶øÇÒ¿ÉÒÔÌṩһ¸ö»ò¶à¸öÃüÁîÐпª¹Ø¡£ÄãÑ¡ÔñµÄ¿ª¹ØÖ¸Ê¾½âÊÍÆ÷ÒÔÒ»ÖÖÌØ¶¨µÄ·½Ê½ÔËת£¬²¢ÇÒ/»òÕßÖ´ÐÐÌØ¶¨µÄ²Ù×÷¡£
RubyÃüÁîÐпª¹ØÓÐ20¶à¸ö£¬ÆäÖÐÓÐЩºÜÉÙʹÓã¬ÓÐЩÔòÿÌì±»ºÜ¶àRuby³ÌÐòԱʹÓá£ÔÚÕâÀïÎÒÃǽ«ÔÙ¿´¼¸¸ö×î³£Óõġ££¨ÄãÒѾ¿´µ½¹ýÆäÖеÄÁ½¸ö£¬-cºÍ–w£¬ËüÃǽáºÏÔÚÒ»ÆðʹÓᣣ©ÕâЩ³£ÓõĿª¹Ø×ܽáÔÚ±í1-2ÖУ¬ÎÒÃǽ«·Ö±ð¸øÓè½âÊÍ¡£
±í1-2 ³£ÓõÄRubyÃüÁîÐпª¹Ø×ܽá
ÃüÁîÐпª¹Ø
Ãè¡¡¡¡Êö
Àý ×Ó
-c
²»Ö´ÐгÌÐò£¬Ö»¼ì²é£¨check£©³ÌÐòÎļþµÄÓï·¨
ruby –c c2f.rb
-w
ÔÚ³ÌÐòÖ´Ðйý³ÌÖиø³ö¾¯¸æ£¨warnig£©ÐÅÏ¢
ruby –w c2f.rb
-e
Ö´ÐУ¨execute£©ÔÚÃüÁîÐÐÖÐÒýºÅÄڵĴúÂë
ruby –e 'puts"code demo! "'
-v
ÏÔʾRuby°æ±¾£¨version£©ÐÅÏ¢£¬ÔÚÏêÐÅ£¨verbose£©Ä£Ê½ÏÂÖ´ÐгÌÐò
ruby –v
-l
ÐУ¨line£©Ä£Ê½£ºÈç¹ûûÓл»ÐÐÔòÔÚÿһÐÐÊä³öºóÊä³öÒ»¸ö»»ÐÐ
ruby –l –e 'print "Will jump down! "'
-rname
¼ÓÔØÖ¸¶¨µÄÀ©Õ¹£¨require£©
ruby –rprofile
--version
ÏÔʾRuby°æ±¾£¨version£©ÐÅÏ¢
ruby --version
Ïà¹ØÎĵµ£º
require 'win32ole'
excel = WIN32OLE::new('excel.Application')
workbook = excel.Workbooks.Open('E:\RubyApp\bmk.xls')
worksheet = workbook.Worksheets(1) #get hold of the first worksheet
worksheet.Select #bring it to the front -need sometimes to run macros, not for working with a worksheet from ru ......
¹«Ë¾ÀïÔ½À´Ô½¶àµÄ½Ó¿ÚÒÔICE·½Ê½ÌṩÁË£¬ÒÔǰû½Ó´¥¹ý£¬ËùÒÔÎÒÕâÁ½ÌìÒ²³éÁ˵ãʱ¼äÑо¿ÁËÏÂICE£¬²Î¿¼ÁËÍøÉϺܶàÌû×Ó£¬²ÅÖÕÓÚÅÜͨµÚÒ»¸ö¼òµ¥µÄICE
½ÓÏÂÀ´ÌùÉÏÎÒËùÓл·¾³µÄ´î½¨¹ý³ÌÒÔ¼°´úÂ룬ºÍ´ó¼Ò·ÖÏíÏÂICEËù´øÀ´µÄ¿ìÀÖ
ICEÊÇʲôÎҾͲ»¶à˵ÁË
1¡¢ Ò»¿î¸ßÐÔÄܵÄÖмä¼þ£¬»ùÓÚICE¿ÉÒÔʵÏÖµçÐż¶µÄ½ ......
Ëɱ¾ÐкêÈçÔ¼ÓÚÊ¥µ®½Ú·¢²¼ÁËRuby 1.9¡£¸ù¾ÝRubyµÄ¹ßÀý£¬Ð¡ÊýµãºóÃæµÚһλÈç¹ûÊǵ¥Êý£¬ÄÇô¾Í±íÃ÷ÕâÊÇÒ»¸öʵÑé°æ±¾£¬²»ÍƼöÓÃÓÚ²úÆ·»·¾³¡£Ëùν“²úÆ·»·¾³”£¬¶ÔÓÚĿǰµÄRubyÀ´Ëµ£¬»ù±¾ÉϾÍÊÇRuby on Rails¡£´ÓĿǰRoRÉçȺµÄ·´Ó³À´¿´£¬È·ÊµÓÐÈËÕýÔÚ³¢ÊÔÓÃRuby 1.9ÅäºÏRoR£¬µ«ÊÇÉÐÊô ......
ÒòΪһ´ÎżȻµÄ»ú»á½Ó´¥ÁËRubyÓïÑÔ¡£È»ºóÏÂÔØÁËRuby Shoes¹¤¾ß¡£
·¢ÏÖRuby»¹ÊÇÂùÓÐȤµÄ¡£
»¨ÁËÒ»¶Îʱ¼äÊìϤÁËËüµÄÓï·¨¡£
ÏÂÃæÀ´ÊÔÊÔËüµÄÊó±ê¹¦ÄÜ¡£
Shoes.app do
#ͼƬ³õʼ»¯
@img = image "http://www.google.cn/intl/zh-CN/images/logo_cn.gif"
#ͼƬ¹ØÓÚÊó±êµÄµ÷ÓÃ
& ......
ÔÎÄÁ¬½Ó£º http://hi.baidu.com/%B7%CF%B2%C5%CB%FB%B8%E7/blog/item/09c19411244152daf7039ec4.html
ͨ¹ýÃüÁîÐв鿴ruby°æ±¾ÐÅÏ¢£º
ruby -v
ÃüÁîÐÐÔËÐгÌÐò£º
·½·¨1.
ruby -e 'print "hello ruby"'
-e ±íʾ½«ºóÃæµÄÒ»ÐÐ×÷Ϊruby³ÌÐò
print ÊÇrubyµÄÒ»¸öÄÚÖú¯Êý
·½·¨2.½»»¥±àÒë»·¾³
irb £¨ÃüÁîÐÐÊäÈëºó£¬ ......