ããã¹ãæ¬ã«æ¸ããRubyã®ã³ã¼ããAutomatorã§è©ä¾¡ãã
移転ãã¾ãã â
"); // ãªãã¤ã¬ã¯ã setTimeout(function redirect(){ location.href = url; } , 5000); // canonical ã®æ¸ãæã var link = document.getElementsByTagName("link")[0]; link.href = url; -->æ¨æ¥ã¤ã¶ãããããã«ã¤ãã¦ã§ãã
é¸æããããã¹ããRubyã®ã³ã¼ãã¨ãã¦è©ä¾¡ãã¦çµæãç½®ãæããã¨ãããã¤ãããçµæ§åã«ç¥ã£ã¦ä½¿ã£ã¦ãªãã£ããã©ãããã£ã¦ã¿ãã¨ãã¡ããã¡ã便å©ãã¡ãã£ã¨ããè¨ç®ã¨ãã / âMac ãâ¦â http://t.co/qztBDb4wUY #ruby #automator #Mac
— 大éæµ©èª (@xoyip) April 17, 2014
å è¨äºã¯ã¿ã¤ãã«ã ã¨ãªãã®ãã¨ããããã«ããã®ã§ãããããã§ãããã¯ãã¼ã¯ã900以ä¸ã¤ãã¦ããã®ããããã
Mac ã使ã£ã¦ãããªãå¿
ã使ãã¹ã2ã¤ã®æ©è½ "Automator" 㨠"ãµã¼ãã¹" - kurainã®å£º
ä½ãã£ã¦ããã£ã¦ããã¨
1.Rubyã®ã³ã¼ããæ¸ãã¦é¸æ 1.Automatorã§ä½ã£ããµã¼ãã¹ãèµ·åãã 1.ãµã¼ãã¹ã§ã¯rubyã«ããã¹ãã渡ã 1.ãã£ãé¸æãã¦ããããã¹ããRubyã®ã³ã¼ãã¨ãã¦å®è¡ããã 1.çµæã§ç½®ãæãã
便å©ã£ã½ã使ãã©ãã
é£çªãæ¯ã
ãã£ãã®ãã£ããã£ã§ãããããã«ã¡ãã£ã¨ããé£çªãæ¯ãã®ã«ä¾¿å©ã§ããããããªãã¤ã
1. 2. 3. ... 10.
ããã§ããã¾ãã
(1..10).each {|i| printf "%2d.\n", i}
è¨ç®ãã
æ®éã®ååæ¼ç®ã¨ãã便å©ããã
p 1+2-3*4+5-6*7 # -46
ãããªæãã§æ¹è¡ããã®æ°å¤åã®åè¨ãæ±ãããã¨ãã¨ããï¼ã¡ãªã¿ã«ãã®ã©ã³ãã æ°å¤åã¯5.times { printf "%d\n", rand(1000) }
ã§åºãããã®ã§ãï¼
50 186 860 600 787
ãã¼ã¿ãå°ãããã£ã¦é ååãããã¨åè¨ãã¨ãã°ããã¾ãã
p [ 50, 186, 860, 600, 787 ].inject(:+) # 2483
ç½®æãã
ããã¯ã¨ãã£ã¿ã¼ã§ããã°ãããã ã£ãâ¦
ä»ã«ã便å©ãªã±ã¼ã¹ããã£ããç¥ãããã