Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

½»»¥Ê½ Ruby Shell irb

irb ÊÇ´ÓÃüÁîÐÐÔËÐеÄ
irb µÄÃüÁîÐÐÑ¡Ïժ×Ô¡¡Porgramming Ruby µÚ¶þ°æ£©
-f
½ûÖ¹¶ÁÈ¡~/.irbrc¡¡Suppress reading ~/.irbrc.
-m
Êýѧģʽ£¨Ö§³Ö·ÖÊýºÍ¾ØÕ󣩡¡Math mode (fraction and matrix support is available).
-d
ÉèÖÃ#DEBUGΪtrue(ͬruby -dÒ»Ñù)¡¡¡¡Set $DEBUG to true (same as ``ruby -d'').
-r load-module
ͬruby -r¡¡Same as ``ruby -r''.
--inspect
ʹÓÃObject#inspectÀ´¸ñʽ»¯Êä³ö£¨Ä¬ÈÏ·½Ê½£¬³ýÊýѧģʽÍ⣩¡¡Use ``inspect'' for output (the default, unless in math mode).
 
--noinspect
²»Ê¹ÓÃinspect½øÐÐÊä³ö¡¡Do not use inspect for output.
--readline
ʹÓÃReadlineÀ©Õ¹Ä£¿é¡¡Use Readline extension module.
--noreadline
²»Ê¹ÓÃReadlineÀ©Õ¹Ä£¿é¡¡Do not use Readline extension module.
--prompt prompt-mode
Çл»Ìáʾ·û¡£Ô¤¶¨ÒåµÄģʽ°üÀ¨£¨null,default,simple,xmpÒÔ¼°inf-ruby£©¡¡Switch prompt mode. Predefined prompt modes are ``default'', ``simple'', ``xmp'', and ``inf-ruby''.
--prompt-mode prompt-mode
Same as --prompt.
 
--inf-ruby-mode
ÉèÖÃirbÒÔEmacsµÄinf-ruby-modeģʽÔËÐУ¬¸ü¸ÄÌáʾ·û²¢·ÏÖ¹-readline¡¡Sets up irb to run in inf-ruby-mode under Emacs. Changes the prompt and suppresses --readline.
 
--simple-prompt
ʹÓüòµ¥µÄÌáʾ·û¡¡Simple prompt mode.
--noprompt
²»ÏÔʾÌáʾ·û¡¡Do not display a prompt.
--tracer
ÏÔʾÃüÁîÖ´Ðеĸú×Ù¡¡Display trace for execution of commands.
--back-trace-limit n
ÏÔʾ×î¶¥²¿ºÍβ²¿µÄnÏî»ØËÝÐÅÏ¢¡£Ä¬ÈÏֵΪ16¡¡Display backtrace information using the top n and last n entries. The default value is 16.
 
--irb_debug n
½«ÄÚ²¿µ÷ÊÔ¼¶±ðÉèÖÃΪn(Ö»¶ÔirbµÄ¿ª·¢ÓÐÓã©¡¡Set internal debug level to n (only for irb development).
 
-v, --version
ÏÔʾirbµÄ°æ±¾ºÅ¡¡Print the version of irb.
ÃüÁîÐпªÊ¼Ö´Ðкó£¬irbÏÔʾһ¸öÌáʾ·û²¢µÈ´ýÊäÈë¡£
ʹÓÃirbµÄĬÈÏÌáʾ·û£¬ËüÏÔʾµ±Ç°µÄ°ó¶¨¡¢Ëõ½ø£¨Ç¶Ì×£©¼¶±ðÒÔ¼°Ðкš£
È磺
C:\>irb
irb(main):001:0> elvuel="elvuel"
=> "elvuel"
irb(main):002:0> elvuel.class
=> String
 
¿ÉÒÔͨ¹ýexit »ò quit,»òÕßͨ¹ýÊäÈëÒ»¸öÎļþ½áÊø·ûºÅ£¨Èç¹ûûÓÐÉèÖÃIGNORE_EOFģʽ£©À´Í˳ö


Ïà¹ØÎĵµ£º

Ruby on Rails°²×°ÓëÅäÖÃ

Ò»£¬Ruby°²×°£º
http://rubyforge.org/frs/download.php/29263/ruby186-26.exe
¹Ù·½ÍøÕ¾ÏÂÔØruby186-26(for windows)£¬Ä¬Èϰ²×°ruby£»
·¾¶c:\ruby
¶þ£¬railsÏÂÔØ°²×°£º
http://rubyforge.org/frs/download.php/29361/rails-2.0.2.zip
ÏÂÔØrails2.0.2.zip£¬½«ÆäcopyÖÁruby°²×°Â·¾¶£¬²¢¸ÄÃûΪrails.zip£»
³¢ÊÔ²»½âÑ¹Ö ......

rubyµÄExcel²Ù×÷

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×î¼òµ¥ÊµÏÖ ¸½ÉÏruby¡¢C++ ¿Í»§¶Ë´úÂë

¹«Ë¾ÀïÔ½À´Ô½¶àµÄ½Ó¿ÚÒÔICE·½Ê½ÌṩÁË£¬ÒÔǰû½Ó´¥¹ý£¬ËùÒÔÎÒÕâÁ½ÌìÒ²³éÁ˵ãʱ¼äÑо¿ÁËÏÂICE£¬²Î¿¼ÁËÍøÉϺܶàÌû×Ó£¬²ÅÖÕÓÚÅÜͨµÚÒ»¸ö¼òµ¥µÄICE 
½ÓÏÂÀ´ÌùÉÏÎÒËùÓл·¾³µÄ´î½¨¹ý³ÌÒÔ¼°´úÂ룬ºÍ´ó¼Ò·ÖÏíÏÂICEËù´øÀ´µÄ¿ìÀÖ 
ICEÊÇʲôÎҾͲ»¶à˵ÁË 
  1¡¢ Ò»¿î¸ßÐÔÄܵÄÖмä¼þ£¬»ùÓÚICE¿ÉÒÔʵÏÖµçÐż¶µÄ½ ......

Ruby 1.9²»»áɱËÀPython

      Ëɱ¾ÐкêÈçÔ¼ÓÚÊ¥µ®½Ú·¢²¼ÁËRuby 1.9¡£¸ù¾ÝRubyµÄ¹ßÀý£¬Ð¡ÊýµãºóÃæµÚһλÈç¹ûÊǵ¥Êý£¬ÄÇô¾Í±íÃ÷ÕâÊÇÒ»¸öʵÑé°æ±¾£¬²»ÍƼöÓÃÓÚ²úÆ·»·¾³¡£Ëùν“²úÆ·»·¾³”£¬¶ÔÓÚĿǰµÄRubyÀ´Ëµ£¬»ù±¾ÉϾÍÊÇRuby on Rails¡£´ÓĿǰRoRÉçȺµÄ·´Ó³À´¿´£¬È·ÊµÓÐÈËÕýÔÚ³¢ÊÔÓÃRuby 1.9ÅäºÏRoR£¬µ«ÊÇÉÐÊô ......

×Ô¶¯»¯²âÊÔ֮·£¨Èý£© rubyÀïµÄgetÓëset·½·¨

ÕÕÀý¿ÉÒÔÏÈ¿´¶Ë³ÌÐò
class Person
 
  def initialize( name,age=18 )
    @name = name
    @age = age
    @motherland = "China"
  end
 
  def talk
    puts "my name is "+@name+", age is "+@age.to_s
 &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ