ruby
æè¿Elixirã人æ°ã§ããããErlang VMä¸ã§OTPã®æ©æµãåããªããç°¡æ½ãªè¨æ³ã§ä¸¦è¡å¦çãæ¸ããè¨èªã¨ãããã¨ã§è©±é¡ã«ãªã£ã¦ãã¾ããª? Elixirã¯é¢æ°åããã°ã©ãã³ã°ã®ã¨ãã»ã³ã¹ãåãå ¥ãã¦ããã¨è¨ããã¦ããããã®ã²ã¨ã¤ã«Pipeæ¼ç®å(|>) ãããã Enumeâ¦
ã¹ã©ã¤ãã§ã æ¬å½ã¯æããªã¼ãã³ã¯ã©ã¹ã¨DuckTyping - 表åé.rb #4ã¾ããããã話ãããªããã§ããããããããã¯ã¹ã®ç»åãã¹ã¯ãªã¼ã³ã«å¤§åãã§ããã®ã§ãã®ç¹ã ãã§å人çã«ã¯æºè¶³ãã¦ãã¾ããåãè®ããã
ãã¾ãã«ããã¹ãéããªãã®ã§ãã¹ã¡ã¿ã«è´ãå§ããâ â°â°â°â°null (@yuroyoro) 2015, 7æ 2ãã®ãããªäºããã£ãã®ã§èªååããã Macéå®ã ãããªæããsuccessã ã¨ã¬ãã«ãã¢ã¬ããäºåã«bash-itunes ã¨ããã³ãã³ãã©ã¤ã³ãã¼ã«ãå ¥ãã¦ããã iTunesãæ¥æ¬â¦
ä½ããã£ã¦ããã®ãã¨ããã¨ããããããã¨ã§ãrubyã§ãobj.send(pred) ãtrueãªãã°selfããè£ ã§ç¡ãå ´åã¯nil ãè¿ãã¡ã½ãã欲ããâ â°â°â°â°null (@yuroyoro) August 28, 2014foo.present? ? foo : other ã¿ãããªã®æ¸ãã®ãã«ãã®ã§â â°â°â°â°null (@yuroyoro) â¦
ä»ã¾ã§ãrspecã³ãã³ãã§ã¯ä»»æã®å¼æ°ã渡ããã¨ã¯ã§ããªãã£ãã®ã§ãç°å¢å¤æ°çµç±ã§å¼ã渡ãã¨ããæ¹æ³ãã¨ã£ã¦ããã ( ;ï¾ç¿ï¾)ï¾ï½¼Î£ ï¾ï½¨ï¾ï½·ï¾ï½¨ï½¨ï½°ï½°ï½¯!!! MY_OPT1=true rspec spec/my_spec.rbç°å¢å¤æ°ã§æ¸¡ãã®ã¯ãã«ãã®ã§ãªãã¨ããããã¨æãã`--tag`ãªãã·ã§ã³â¦
3å¹´ã»ã©åã«ãGitterbã¨ããGitãªãã¸ããªã®ã³ããããã°ãå¯è¦åãããã¼ã«ãä½ã£ãã ã¼ãã®ããããããããããã®Git Repository Browser - ( êªâêª) ããããæ¥è¨ Gitterb by yuroyoro yuroyoro/gitterb · GitHub ãã®ã¢ããªã±ã¼ã·ã§ã³ã¯Ruby1.9/Rails3â¦
arr = [ ["foo", "", "bar"], nil, ].sample arr.try(:reject, &:blank?) #=> [âfooâ, âbarâ] Object#tryã¯nil-safeãªcallã¨ãã¦ä½¿ãã blockãåãã¡ã½ããã®symbolã渡ããå ´åã«ã第äºå¼æ°ã«procã渡ãã¦ãåä½ãã è¦activesupport.gem tryã¨é¢æ°åæã¯â¦
ååããä¸å¹´ä»¥ä¸ãçµéãã¦ãããã©ãæè¿lambda_driver.gemã«æ©è½ã追å ããã®ã§ããã®ãã¨ã«ã¤ãã¦æ¸ããã¨æãã Rubyã§ãã¢ãâ¦â¦ã£ã½ãé¢æ°åæãå®è£ ãã話ã ãRubyã§é¢æ°åæã¨ããããã®ã§ lambda_driver.gem ã¨ããã®ãä½ã£ã - ( êªâêª) ããããæ¥â¦
ãããªã³ã¼ãããã£ãã blockã®è©ä¾¡çµæãå½ã ã£ããã¨ã©ã¼ã«ãããã¨ããæå³ã ã¨ã def die!(&block)! yield || raise("error") end å®è¡ irb(main):008:0> die! { true } RuntimeError: error from (irb):6:in `die!' from (irb):8 from /usr/local/var/â¦
LambdaDriver by yuroyoroRubyã§ãProcãlambdaã§é¢æ°åæã§ããããã«ãããã£ãã®ã§ãlambda_driver.gemã¨ããã®ãä½ã£ãã å 容çã«ã¯ãã®è¾ºã§æ¸ããã¤ããgemã«ããæãã ãé¢æ°åRubyãã¨ããç (2) - é¢æ°åæ Proc#compose - ( êªâêª) ããããæ¥è¨ â¦
yajl(Yet Another JSON Library)ã£ã¦ããé«éãªJSONã©ã¤ãã©ãªããã£ã¦ãyajl ããã¤ãrubyãã使ããããã«ããyajl-rubyã£ã¦gemããã£ã¦ããããMultiJsonã®Backendã«å¤æ´ãããã¨ã§ãRailsã«ãããJSONå¦çã®é«éåãæå¾ ã§ãããã¹ãbrianmario/yajl-rubâ¦
ãã£ã¤ãã§é©å½ã«æ¸ãã¦ã¿ããyuroyoro/rmruby · GitHubä¸ä½ä½ããããã®ãâ¦â¦ã irb(main):001:0> require 'rmruby' => true irb(main):002:0> Rmruby.eval('3.times do |n| puts "hello #{n}!" end') hello 0! hello 1! hello 2! 3 => nil æ¯åmrbã¤ã³ã¹ã¿â¦
ãã©ã³ãã³ã°ã¢ãã«ã¨ãã¦git-flowã使ã£ã¦ãã¦ãã¡ã¤ã³ã©ã¤ã³ã¨ãã¦ãæ¬çªé©ç¨ä¸ã®masterãã©ã³ãã¨ã次æãªãªã¼ã¹ç¨ã®release/9999ãã©ã³ãã¨ãã¡ã¤ã³éçºãã©ã³ãã®developãããã ã¨ããããéçºä¸ã¯é »ç¹ã«ãã©ã³ãã移åãããããã©ã³ãã«ãã£ã¦DBã®â¦
ååããããªãæéã空ãã¦ãã¾ã£ãããä»åããRubyã«ããã¦nilã¨ããã«éããã«ã¤ãã¦æ¸ãã æ¬è¨äºã¯ä»¥ä¸ç¥ãããã( ï¾Ð´ï¾)ã Object#try Object#tryã¯ActiveSupportã§æä¾ãããã¡ã½ãããã¬ã·ã¼ãã¼ãnilãããªãå ´åã«å¼æ°ã®Symbolã®ã¡ã½ãããå¼ã³åºâ¦
Rubyã®ããã©ã«ãå¼æ°ã§ã¯ãä»ã®å¼æ°ã«ä¾åããå¼ãæ¸ãããå°å³ã«ä¾¿å©ã [1] pry(main)> def foo(a, b = a * 2) [1] pry(main)* puts b [1] pry(main)* end => nil [2] pry(main)> foo(3) 6 => nil å帰ãããããããã©ã«ãå¼æ°ã§å帰ããã¦ãã£ããã£ã¦ã¿â¦
æ¬è¨äºã¯ãRubyãæ¸ãã«ããã£ã¦ãããã«ãããã¯ãæ¸ããã«ãã¾ããããã追æ±ããã誰å¾ãªé£è¼ã§ããããlambdaã®æé»é¢ãã«å ã¡ãããã°ã©ããå¯èªæ§ã¨ãã¡ã³ããã³ã¹æ§ã¨ãç¡è¦ãã¦å¥½ãæ¾é¡ã³ã¼ãæ¸ããããããªã£ããæªæ°ã¯ãªãã£ããããããããæçâ¦
æ¬è¨äºã¯ãRubyãæ¸ãã«ããã£ã¦ãããã«ãããã¯ãæ¸ããã«ãã¾ããããã追æ±ããã誰å¾ãªé£è¼ã§ããã ããã°ã©ãå¨äºç ããããããã¨ãããªããããã¨ã«ãªãã¨ããå®ä¾ã示ããã®ã§ãã£ã¦ãå¯èªæ§ãã¡ã³ããã³ã¹æ§ã«ã¤ãã¦ã®ããã³ãã¯ãé æ ®é¡ããããâ¦
æ¬è¨äºã¯ãRubyãæ¸ãã«ããã£ã¦ãããã«ãããã¯ãæ¸ããã«ãã¾ããããã追æ±ããã誰å¾ãªé£è¼ã§ããã 注æç¹ã¨ãã¦ããã®è¨äºã¯ãããã°ã©ãå¨äºç ã®ã²ã¨ã¤ã§ãããã©ã ãçå群(λ-Syndrome)ãã«ç½¹æ£ããæ£è ã«Rubyãæ¸ãããã¨ãã©ããªããããã¨ã«ãªãâ¦
ãã®è¨äºã¯ãRubyãæ¸ãã«ããã£ã¦ãããã«ãããã¯ãæ¸ããã«ãã¾ããããã追æ±ããã誰å¾ãªé£è¼ã§ããã ã ã£ã¦ããããã¯ã£ã¦æ±ããããï¼ä»®å¼æ°ã®|x|ã¨ããã¢ã¤ã Symbol#to_proc åºæ¬ä¸ã®åºæ¬ãinstance method Symbol#to_proc以ä¸ã®ãããªArrayããã£â¦
ã¨ããã®ãä½ã£ãã¾ãããã¡ããã¡ããæ©è½æ¹åãã¦ã¾ãã yuroyoro/git-issue · GitHub git-issue | RubyGems.org | your community gem host ä»äºã§ã¯ãç°è管çã·ã¹ãã ã¯Redmineã使ã£ã¦ãã¦ãä½æ¥ã¯sshã§ãµã¼ãã«å ¥ã£ã¦ã³ã¼ãæ¸ãã¦ãããã§ãã ã§ã次â¦
以åæ¸ãããã ã¡ãã£ã¨ã®æéã§RSpecã®åºåããã¬ã¤ã«ããããã«named_letã¨ããã®ãæ¸ãã¦ã¿ã - ããããæ¥è¨ããã ã¡ããã¨ããGemã«ãã¦rubygems.orgã«ç»é²ãã¾ããã named_let | RubyGems.org | your community gem host ã½ã¼ã¹ã³ã¼ãã¯Githubã«ãâ¦
Java使ãã¯ããªãã¿ã®OGNL(Object Notation Graph Language)ã£ã½ãè¨æ³ã§ãRubyã®ãªãã¸ã§ã¯ãã°ã©ãã辿ãã¢ã¬ãæ¸ãã¦ã¿ããevalããã°ã£ã¦ããã³ãã¯ãªãã§ããªã å³å¯ã«OGNLã«ãªã£ã¦ãªãã¦ãã©ã£ã¡ãã£ã¦ããã¨Rubyã£ã½ã表ç¾ã«ãªã£ã¦ããã©ãéåæãªãâ¦
RSpecã®è©±ã§ãã RSpecã¯ããã¹ãã³ã¼ãããã®ã¾ã¾ä»æ§ãè¨è¿°ããããã¥ã¡ã³ãã«ãªããã¨ããã®ã大ããªå©ç¹ã®ä¸ã¤ã§ãã ããããrspecã³ãã³ãã«-dãªãã·ã§ã³ã渡ãã¦åºåãããããã¥ã¡ã³ãã¯ãå¿ ãããèªããæç« ã«ãªã£ã¦ããã¨ã¯éãã¾ããã ä¾ã¨ãã¦â¦
ãããªã¤ããã¢ãµã¤ãã¯ãã¡ã http://gitterb.yuroyoro.net/ Gitã§ããç¨åº¦éç¨ãã¦ãã¨ããã©ã³ãããã£ã±ãã«ãªã£ã¦ãã¤ã©ãããçããã®ãããããªããªã£ãããã©ã®ãã©ã³ãããã¼ã¸ããã¦ããææ¡ã§ããªãã£ããã¨ããããã¨æãã ãã¨ãã°git log --gâ¦
俺å¾ã¡ã¢ããã3åãããåããã¨èª¿ã¹ããã§ããå æ¸ã¡ã¢æ®ãã¦ããã Net::HTTP ã«set_debug_outputã£ã¦ã¡ã½ããããã£ã¦ã³ã¤ãã«åºåå ã渡ãã°ãããæ®å¿µãªãããã®set_debug_outputã¯ããã¥ã¡ã³ãã«ã¯è¼ã£ã¦ãªãã®ã§net/httpã®ã½ã¼ã¹è¦ã¦ãã require 'nâ¦
scanlé¢æ°ã¯ã(a -> b -> a)åã®é¢æ°ã¨ãåæå¤aã¨ãªã¹ã[b]ãä¸ãããã¦ãé çªã«å¼æ°ã«æ¸¡ãããé¢æ°ãé©ç¨ããè¨ç®ããã¦è¨ç®çµæã®ãªã¹ããè¿ãé¢æ°ãfoldlã®è¨ç®ã®ä¸éçµæãéãããªã¹ããè¿ãã¨ã¤ã¡ã¼ã¸ãã¦ãããã°ã scanl :: (a -> b -> a) -> a -> â¦
è¡ã£ã¦ãã¾ããã大森ã¾ã§ã åå ãããçããããç²ãæ§ã§ããã named_scopeã«ã¤ãã¦ãããã ããã¯ãããã®ã»ãã·ã§ã³ã è³æã¯ããâ named_scopeã«ã¤ãã¦ãããã - moroã®æ¥è¨ãã¬ã¼ã³è³æã説æã¨ãã«ããããããã£ãã§ãã Javaã®ORM(Hibenateãibaâ¦