Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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´úÂë


<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 680460288 22 0 262145 0;}
@font-face
{font-family:"Cambria Mat ......

Ruby 101£º¶¯Ì¬±à³Ì


Ruby 101£º¶¯Ì¬±à³Ì
Written by Allen Lee
µ±method_missingµÄħ·¨Ê§Ð§Ê±……
      ÔÚÉÏһƪÎÄÕÂÀÎÒÃÇͨ¹ýÖØÐ´HashÀàµÄmethod_missing·½·¨°ÑHash¶ÔÏóÄ£Äâ³ÉÄäÃû¶ÔÏ󣬵«ÊÇ£¬ÕâÖÖ×ö·¨ÓÐʱ»á²úÉúһЩĪÃûÆäÃîµÄÎÊÌ⣬¾Ù¸öÀý×Ó°É£¬¼ÙÈçÎÒ°Ñprocess·½·¨£¨ÍêÕûʵÏֲμûÉÏһƪÎÄÕ ......

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 ......

RubyµÄ×°ÊÎÆ÷ģʽʵÏÖ

class Tree
def initialize
puts "Make a normal tree"
end
def decorate
puts "Make sure the tree won\'t fall"
end
end
class RedBalls < Tree
def initialize(tree)
@parent = tree;
end
def decorate
@parent.decorate
puts "Put on some red balls"
end
end ......

Rails¡¢Ruby¡¢JAVAǰ¾°±È½Ï

        ÔÚÂÛ̳Àï¿´ÁËdaquan198163ËùдµÄ¡¶³õѧRORµÄÒÉ»ó¡·ÕâÆªÎÄÕ£¬robbinÔڻظ´ÖиøÁËÏêϸµÄ½â´ð£¬¿ÉÊÇ¿´Íê½â´ðÖ®ºó£¬ÎÒÒ²²úÉúÁËһЩÒÉ»ó£¬ÔÚ´ËÏëÎÊÎÊ¡£
        ÔÚrobbinËù¸ø³öµÄ½â´ðµ±ÖУ¬¸ü¶àµÄÊDzûÊörailsµÄºÃ´¦£¬È»¶ø´ó¼Ò¶¼ÖªµÀ£¬railsÖ»Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ