RubyKaigi2009 ä¸æ¥ç®ã¡ã¢
ããããæçµæ¥ãã¹ã¿ããã®ã¿ãªãã¾ãæ¬å½ã«ãã¤ãããã¾ã§ããã
ããã¦ãä»å¹´ããããã¨ããããã¾ããã <(_ _)>
ã½ã±ããã©ã¤ãã©ãªã®æ¹å
- TCPServerãUDPServer ã¯ãããã³ã«ä¾å
- TCPServer.open(9999) 㯠IPv4 ãåãã¤ããªããã¨ããã
- IPv6 ã®æ¨å¥¨ã¯ãããã³ã«éä¾å
- æ°ã«ãããªãã£ããã¨
- åããã«ããå¼æ° (SOCKETãSOCKETãSOCKET..)
- æ»ãå¤ããã¤ããª
- port,host ã®é çª
- ãããã³ã«éä¾å㪠UDP ã¯é£ãã
- ãµã¼ãã¯å¾ ã¦ã°ãããã¯ã©ã¤ã¢ã³ã㯠3 way hand shake ããªãã®ã§å¤å®ã§ããªã
- ãã«ããã¼ã ç°å¢ã§å±ããã¢ãã¬ã¹ããè¿ããã
- ä»ã® Socket ã©ã¤ãã©ãªã¯å¤§ã¯ã©ã¹ä¸»ç¾©ãèªèããã¦ãªãé ã®è¨è¨ãã
- ã ããä»å㯠TCPServer ã§ã¯ãªããSocket ã«éãã
- ã§ã使ãå´çã«ã¯åããã«ãããï¼ã£ã¦ãã質åããã£ã
- ãã¶ã¤ã³ãã·ã¸ã§ã³
- inspect å¯è½ = æå³ããªãã¸ã§ã¯ãå ã§æ±ºã¾ãã¨ãããã¨
- ä½ããªãã¸ã§ã¯ããã¹ããã«ãã¤ãªãã£ã¦ãã
ã¹ã¯ãªããè¨èª Ruby
- ããããã¡ã¤ã«ã« Ruby ãåãè¾¼ã
- -x ãªãã·ã§ã³
- ããã㨠Ruby ã®å ±åãå¯è½ã«ãªã
- Unix Tools
- 渡辺å²ä¹ããã®ã¹ã¯ãªããé
- fork ã¯ãããããªãã®ã§ spawn ã使ã£ã¦ãã ãã
RubyGems ã®è½ã¨ãç©´
- Web ã«è»¢ãã£ã¦ããäºä¾ã¨ã㦠reliable-msg ãç»å ´ãã
- ããã¦èªåã®ããã° (^^;
- ãã㦠irc ã«ã¯ MDD..
- å¦æ¹ç®
- è¤æ°ãã¼ã¸ã§ã³ã® gem ã¯æ··ããªã
- GEM_HOME ã§å®å ¨ã«åããã¨ãï¼
- .gemrc ã«è¿½å ããã¨ããããã
- --format-executable
Ruby製ã¢ããªãé å¸ãã n åã®æ¹æ³
- æè¿ã¯ Ruby ã®ä»æ§ãæ¸ãã¦ããã¨ã®ãã¨
- ããããªãã£ããé£ã®ã²ã¨ (ã¾ã¤ãã¨ãã) ã«èããããw
- ãã¹ã¯ãããã¢ããªã®é
å¸
- Ruby ã¤ã³ã¿ããªã¿å¿ è¦
- native ã³ã¼ãã«å¤æãã¦ãããå®ç¨çãªã©ã¤ãã©ãªã¯ã¾ã ãªã
- ã©ãåãã«ãã©ãã§ããã±ã¼ã¸ä½æããããåé¡
- RubyScript2Exe (03-07)
- éçºã¯ã¨ã¾ã£ã¦ãã
- åããã¨ã¯åãããã # Ruby1.8.6 以éã§åããªãããã
- Ruby ã®ã¤ã³ã¿ããªã¿ãã¨ã²ã¨ã¾ã¨ãã«ããã®ã§ãèµ·åãé ã
- Exerb (02-09)
- ã¯ãã¹ã³ã³ãã¤ã«ã§ãã
- require ãæ¸ãããã¦ã
- Ocra (09-)
- Crate (08-)
- sqlite3 ã« Ruby ã®ãã¡ã¤ã«ãã¤ã£ããã§ãå®è¡ãã¡ã¤ã« 1ã¤
- Zip
- Win ç¨ã® Ruby ã解åãã¦èªåã®ãã¡ã¤ã«ãã¤ã£ããã§èµ·åã¹ã¯ãªããæ¸ãã¦ãåã³åºãã
- æå¼·w
- Rails ã§ãã¹ã¯ãããã¢ããª
- Ramaze ã Sinatra ã§ãã§ãã
- zip it
- HTML 㨠JavaScript ã§ãã£ããæè»ã«ããã
- ããport ãè¦ããããªããªã
- RubyStation
- Gem ã®æ©æ§ããã®ã¾ã¾ä½¿ã£ã¦ãã
- ã¤ã³ã¿ããªã¿ã®åé¡ã¯ RubyStation ãåãã¦ããªãã¤ã³ã¿ããªã¿ããã¯ãã£ã¦ãã¨ã§éã
- ããå°ãéçºãé²ãã°ãRubyStation ã®ã¤ã³ã¹ãã¼ã«ããã¾ãããããã¨ã®ãã¨
- github
- port ã®ç®¡çã¯ï¼
- RubyStation ãé©å½ã«ã©ã³ãã ã«ãã¦ã¦ã
- ã¢ã¯ã»ã¹å¶å¾¡
- 127.0.0.1 以å¤ããè¹´ãï¼
- ã§ã家åºå LAN ã§ä½¿ããããã
- RubyStation ã§è¨å®å¯è½ãªã¤ã³ã¿ã¼ãã§ã¼ã¹ãæä¾ããã®ãæ£è§£ããª
tDiary ã® Ruby 1.9 対å¿ã®éç¨ã¨ä»å¾ã®ãã¼ãããã
- 1.9 対å¿
- éå»ãã¼ã¸ã§ã³ã¨ã®éäºæé¨å
- æåã¨ã³ã³ã¼ãã£ã³ã°ã®å¤æ´
- compatible.rb
- for 1.9: String.each_lineãString.to_a
- for 1.8: String.force_encodingãString.byte_size
- æå¤ã¨ã»ãã®ã¢ããªã§ã require ããã ã㧠1.9 対å¿ã§ãããã
- 1è¡ç®ã«ä»»æã®æååãæ¿å
¥ããã¯ã³ã©ã¤ãã¼ãããã«æãã¤ãï¼
- sed ã使ããã www
- File.open(FILE__NAME, 'r:UTF-8')
- ç´°ãããã¨
- ãã®ä»
- cache ãã©ã«ãã« cache ãããªããã¼ã¿ããã
- æ¶ãã¨ä¸å¹¸ãªãã¨ã«w
Haml 㨠Sass
%div{ :class => "block"} %div.block .block
- ãµã¤ãã« Ruby ãè©ä¾¡ããã
- eruby ã§ãããã¡ãªã¿ã°ã®ãªãã«ã¿ã°ãå ¥ããããªãã¨ããªã
- ã¡ãªã¿ã« end ãã¤ãã㨠Syntax ã¨ã©ã¼w
- ã¡ã½ãããã§ã¼ã³ããã¨ãã«éã£ã¦ end ãã¤ãããã
- Sass
- ãã´ãå¤ãªã®ã¯ä½è ã®ã»ã³ã¹
- CSS ã¯ãã¹ã¦ã®ã«ã¼ã«ããã©ãã
- Sass ã ã¨ã¤ã³ãã³ãã§æ§é åã§ãã
- ! ã§ã¯ãã¾ãã®ãå¤æ°
- color = !base_color-#666 ã¿ãããæ¼ç®ãã§ãã
- ã=ãããã¯ãã§ã+ãã§å±éããã
- ããã« 2.2. ãã㯠mixin ã«å¼æ°ã¾ã§ã¨ããããã«ãªã£ã!
- ããã§ã¹ã¿ã¤ã«ã·ã¼ããããã°ã©ãã§ãã§ããããã«
get install haml haml --rails path/to/rails_app
- ãã¶ã¤ãã¨ã®åæ¥ã¯ï¼
- å°é£
- html2haml ã³ãã³ãããã
- css2sass ããã (å¤æ精度ã¯ãã¾ãæå¾ ããªãã»ãããã)
- ãã¼ã¸åä½ã§ã®æ®µéçãªç§»è¡ãå¯è½
- :ugly ãªãã·ã§ã³
- æå®ããã¨ããã©ã¼ãã³ã¹ã¯ãããªãããã¤ã³ãã³ããã¤ããªããªã
- ããã©ã¼ãã³ã¹ã®å£å㯠20% ãããã
Erubis å¾¹åºè§£èª¬
- Erubis ã¯é«æ©è½ãã¤æ¡å¼µæ§ãé«ã
- è¨è¨ãç¾ãã
- Enhancer æ©è½è¿½å ã®ããã®ã¢ã¸ã¥ã¼ã«
- include / extend ããã ã
- ã³ãã³ãã©ã¤ã³ãããæå®ã§ãã
- <%=== %> ã§ãããã°ããªã³ã
- eRuby ã® (ã«é¢é£ãã) åé¡ç¹ã¨ãã®è§£æ±ºç
- binding ã使ãã¨ãã¼ã«ã«å¤æ°ããã¼ã«ã«ã§ãªããªã£ã¦ãã¾ã
- ERB ã®è§£æ±ºç: Struct ã使ãæ¹æ³@Seki3ã®ããã°
- Erubis ã®è§£æ±ºç: Binding ã®ãããã« Hash ã使ã
- ä½åãªæ¹è¡
- å¼ã¨æã§æåãå¤ããã ãã§å¯¾å¿
- åãã«è¦ãããã©ãå®ã¯ã¡ãããã®ã¨èªèãããã¨ãéè¦
- Ruby 㨠HTML ã®æ··å¨
- ã³ãã³ãã©ã¤ã³ã§ Ruby ã ã表示ããã..
- ãã³ãã¬ã¼ãã·ã¹ãã ã®å°æ¥
- ãã³ãã¬ã¼ãã¯ä¸ç¨®ã®ã¡ã½ãããã³ã³ããã¹ããã¼ã¿ã¯å¼æ°ã¨ã¿ãªãã
- ãã³ãã¬ã¼ãã«ãä»®å¼æ°å®£è¨ãå¯è½ã«ãªã£ãããããª..
- Django ã®ãã³ãã¬ã¼ãã«ã¯ç¶æ¿ããã
- eruby ã®ä»æ§çã«ã¯ parse (æ§æ解æ) ã¾ã§ã¯ãã¦ããªã
- ããã«ãããã¯ã®èªèãé£ãã (ã»ãã® if ã® end ã¨ãã¨è¢«ã)
- ã ãã merb ã§ã¯ãè¨å·ãã¤ãã¦æ¡å¼µãã¦ãã
- ERB ã Erubis ãæ代é
ã
- ããããããã¹ãããã»ããµãªã®ã§ããã³ãã¬ã¼ãã¨ã³ã¸ã³ã¨ãã¦ã®æ©è½ã貧弱
- ããã§ãé«éé«æ©è½ãªãã³ãã¬ã¼ãã¨ã³ã¸ã³ãTenjin
- ãããããï¼