ï¼¼ééäºå®ã®ãµã¤ãã売ããããï¼ï¼ ã¢ã¯ã»ã¹ããªããµã¤ããã³ã³ãã³ã価å¤ã§å£²ããå ´åã⦠ãã¡ã¤ã³ã®æå¹æéãæ´æ°ãã¦ãµã¤ã売å´ã«ãã©ã¤ãã¦ã¿ã¾ããã
ï¼¼ééäºå®ã®ãµã¤ãã売ããããï¼ï¼ ã¢ã¯ã»ã¹ããªããµã¤ããã³ã³ãã³ã価å¤ã§å£²ããå ´åã⦠ãã¡ã¤ã³ã®æå¹æéãæ´æ°ãã¦ãµã¤ã売å´ã«ãã©ã¤ãã¦ã¿ã¾ããã
http://www.rubygarden.org/ruby?Irb/TipsAndTricks Ruby使ããªã誰ããæç¨ãã¦ãã(ã¨æããã)irbã®tipsãªã©ãæ¸ããã¦ããrubygardenã®1ãã¼ã¸ãªãã§ãããããã®riã使ã£ã¦ãªãã¡ã¬ã³ã¹å¼ãæ¹æ³ãè¶ ä¾¿å©ï¼refeã«å¤ãããé¼»è¡ãåºãã»ã©ä¾¿å©ã ã£ãã®ã§ç´¹ä»ãrefeã¨ã¯ã ã¯ã©ã¹åã¨ã¡ã½ããåãã Ruby ã®ãªãã¡ã¬ã³ã¹ããã¥ã¢ã«ã®ã¨ã³ããªãå¼ããã³ãã³ãã©ã¤ã³ç¨ã®ãã¼ã«ã§ããèªã¿ã¯ãããµããã ri ããã¯ã£ã¦æ¥æ¬èªã»RD ã«å¯¾å¿ããããã®ã§ãã http://i.loveruby.net/ja/prog/refe.html ã¨ããéæ¨ããä½ã®ãã¼ã«ã§ãæè¿ã¯gemåãããã¦ãã®ã§gem install refeã§ãä¸çºã¤ã³ã¹ãã¼ã«ãã§ãã¾ããã§ãå ã»ã©ã®ãµã¤ãã§æ¸ããã¦ãriã®ç®æãã¡ãã£ã¨å¤æ´ãã¦ã~/.irbrcã«
â [ruby] irbã使ãåã«ãã¦ããã¹ã3ã¤(+α)ã®è¨å® Rubyã§è©¦è¡é¯èª¤ããªããéçºãããã¨ãã«ã¯irbã使ãã®ã便å©ã§ãã ä»æ¥ã¯irbãããã«ä¾¿å©ã«ããè¨å®ãããã¤ãç´¹ä»ãã¾ãã ãã¼ã ãã£ã¬ã¯ããª*1ã« .irbrc ã¨ãããã¡ã¤ã«ã ä½ããããã«è¨å®ãæ¸ãã¦ããã¾ãã (1) ã¿ãè£å® # --- completion require 'irb/completion' ã¡ã½ããåãTABãã¼ã§è£å®ã§ããããã«ãªãã¾ãã ä¾ï¼ yhara@meteor:~ % irb >> a = [] => [] >> a.ind[TAB] a.index a.indexes a.indices (2) ãªãã¡ã¬ã³ã¹æ¤ç´¢ å·oã»-ã»ï¼ï¼2nd life - Irb/TipsAndTricksããã IRBä¸ãããrãã¨ããã¡ã½ããã§refeãå¼ããããã«ãªãã¾ãã ä¾ï¼ >> r :p
Rubyã«ã¯irb(1)ã¨å¼ã°ãããã¼ã«ãä»å±ãã¦ãããirb(interactive ruby)ã¯ãRubyã®å¯¾è©±çãªã·ã§ã«ã§ãæ¨æºå ¥åããRubyã®ã³ã¼ããå ¥åãã¦å®è¡ã§ãããexitãquitãjobsãfgãkillãªã©ã¤ã³ã¿ã©ã¯ãã£ãã·ã§ã«ã¨ãã¦åä½ããããã®æ¡å¼µã³ãã³ããç¨æããã¦ããã»ããããã³ããã®è¨å®æ©è½ãå±¥æ´æ©è½ãªã©ãæè¼ããã¦ããã å³1ã®ããã«irb(1)ã³ãã³ããå®è¡ããã°ã¤ã³ã¿ã©ã¯ãã£ãã·ã§ã«ãèµ·åããã®ã§ãã®ã¾ã¾æä½ããã°ããã å³.1 irb(1)æä½ä¾ â sh(1)ãcsh(1)ãªã©ã®åºæ¬çãªæ©è½ãåããã·ã§ã«ã«ããä¼¼ã¦ãã irb(1)ã«ã¯æ¡å¼µã»ããã¨ãã¦Wirbleã¨ããããã±ã¼ã¸ãç¨æããã¦ããã®ã ããåããã±ã¼ã¸ã使ãã¨ã¤ã³ã¿ã©ã¯ãã£ãã·ã§ã«ã«è²ãã¤ãããã«ãªãã»ããè£å®å ¥åãå¹ãããã«ãªããªã©ä¾¿å©ã ãå°æã¨ãã¦ç¥ã£ã¦ããã¦æã¯ãªãã®ã§ãç´¹ä»ãã¦
è¦ç´ irb 㯠Interactive Ruby ã®ç¥ã§ãã irb ã使ãã¨ãRuby ã®å¼ãæ¨æºå ¥åããç°¡åã«å ¥åã»å®è¡ãããã¨ãã§ãã¾ãã irb ã®ä½¿ãæ¹ Ruby ããç¥ã£ã¦ããã° irb ã使ãã®ã¯ç°¡åã§ãã irb ã³ãã³ããå®è¡ããã¨ã以ä¸ã®ãããªããã³ããã表ãã¾ãã $ irb irb(main):001:0> ãã¨ã¯ Ruby ã®å¼ãå ¥åããã ãã§ããã®å¼ãå®è¡ãããçµæã表示ããã¾ãã irb(main):001:0> 1+2 3 irb(main):002:0> class Foo irb(main):003:1> def foo irb(main):004:2> print 1 irb(main):005:2> end irb(main):006:1> end nil irb(main):007:0> ã¾ã irb ã³ãã³ã㯠readline ã©ã¤ãã©ãªã«ã
Ruby ã® irb ã¨ãã ã¤ã³ã¿ã©ã¯ãã£ããªã¢ã¼ã ã®è¨å®ãã¡ã¤ã«ã§ãã ãã¹ã¦æå¹ã«ããã¨ãããªãéããã§ãã require 'irb/completion' #require 'pp' #require 'open-uri' #require 'yaml' #require 'find' require 'pathname' require 'enumerator' #= for ActiveSupport #require 'rubygems' #require 'active_support' #= Irb IRB.conf[:SAVE_HISTORY] = 50000 IRB.conf[:AUTO_INDENT] = true IRB.conf[:USE_READLINE] = true #= Refe def refe arg puts `refe #{arg}` end
Dr. Nic is the CEO and founder of Stark & Wayne. He previously served as both VP of Technology and VP of Engineering at Engine Yard. He discovered Cloud Foundry in 2011, and launched Stark & Wayne in 2012 to help the enterprise world with successfully running application container platforms. Dr Nic is a heavy user and evangelist of Cloud Foundry, Kubernetes, Rancher, Concourse CI, and BOSH. He is
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}