2009-05-01ãã1ã¶æéã®è¨äºä¸è¦§
Rubyã«ã¯ã%è¨æ³ãã¨å¼ã°ããæååãªãã©ã«ãæ£è¦è¡¨ç¾ãªãã©ã«ãè¨è¿°ããå¥ã®è¨æ³ãããã¾ããååã¯èãããã¨ãã£ããã©ä½¿ã£ããã¨ã¯ãªãã£ãã®ã§ããã説æãèªãã§ã¿ãã¨ä½¿ãããªãã°ã¹ãã¼ããªè¨è¿°ãã§ããããã¨ãããã¨ã§ã便å©ãããªä½¿ãéãã¾ã¨ãâ¦
ãªãã ãã®rescueã¨æã£ããã def foo # å¦ç rescue LoadError # ãªãã ãã end ã¡ã½ããå®ç¾©ã®ä¸é¨ã§ãããããããæ¸ãæ¹ãã§ããã®ãã¼ã def foo puts "start" raise "test" puts "end" rescue puts "rescue" ensure puts "ensure" end foo å®è¡çµæâ¦
javax.annotation.Generatedã¯ãèªåä½æãããã³ã¼ãã示ãã¢ããã¼ã·ã§ã³ã§ãã @Generated( comments="ããã¯èªåçæãããã¯ã©ã¹ã§ãã", date="2001-07-04 12:08:56", value= {} // ä½ãå ¥ããã°ããã®ãããããããã ) public class AutoGenerated â¦
ãã¹ãã¯ã©ã¹ãjarã«åºãã¦installããã«ã¯ãpom.xmlã«è¨å®ãæ¸ãã»ãããjar:test-jarãã´ã¼ã«ã使ã£ã¦ã³ãã³ãã©ã¤ã³ã§installããæ¹æ³ãããã¾ãã ãjar:test-jarãã ãã ã¨ããã¹ãã¯ã©ã¹ã®ã³ã³ãã¤ã«ã¯è¡ãªã£ã¦ãããªãããinstallããããªãã®ã§ã以â¦
PrivateModuleã使ãã¨ãã¢ã¸ã¥ã¼ã«ã«ç»é²ãããã³ã³ãã¼ãã³ãã®å ¬é/éå ¬éãå¶å¾¡ã§ãã¾ãã ããã©ã«ãã¯éå ¬éã ã³ã³ãã¼ãã³ãã¯ãç»é²ãããã¢ã¸ã¥ã¼ã«å ã§ã®ã¿å©ç¨å¯è½(ä»ã®ã³ã³ãã¼ãã³ãã«Injectå¯è½)ã§ãã å¤é¨ããåå¾ãããã¨ããã¨ã¨ã©ã¼ã«ãªâ¦
ããå¿ããã¨ãä½ãã§ãããæ¥è¨æ¸ãã®ãä¸è¦å´ãä¾ã«ãã£ã¦ããããç¶ãã¾ããã容赦ã
âã®å ´åã¯æ¹è¡ãæã®åºåãã«ãªããªãã®ãããµãã puts "<abc>". gsub(/</, ''). gsub(/>/, '') å®è¡çµæã§ãã abc
Sinatraã0.9.2ã«updateããã¨ã以ä¸ã®ã¨ã©ã¼ã«ãªã£ã¦çµã¿è¾¼ã¿ã®WEBrickã§åããªããªã£ã¦ãã¾ã£ãã /usr/lib/ruby/gems/1.8/gems/sinatra-0.9.2/lib/sinatra/base.rb:930:in `detect_rack_handler': Server handler (thin,mongrel,webrick) not found. (Runâ¦
ãã¢ããã¥ã¡ã³ãã®èå¥åã®å¾(âã®ä¾ã§ã¯ã puts (<<-HTML).gsub(/^ {2}/, '') <html> <head>...</head> <body>...</body> </html> HTML å®è¡çµæã§ãããgsub(/^ {2}/, '')ãã«ããå é ã®ã¤ã³ãã³ããæ¶ãã¦ãã¾ãããµãã <html> <head>...</head> <body>...</body> </html>
Provider Methodsã¯ãModuleã®é¢æ°ã¨ãã¦å®ç¾©ããã¡ã½ããããã³ã³ãã¼ãã³ããåå¾ããéã®Providerã¨ãã¦ä½¿ãæ©è½ã§ãã ã¤ã³ã¹ã¿ã³ã¹çææã«åæåãå¿ è¦ã ã£ããããå ´åãProviderã§ã³ã³ãã¼ãã³ããç»é²ããããã¾ãããProviderã¯ã©ã¹ããã®ã¤ã³ã¹ã¿â¦
ChildInjectorã¯ãä»»æã®Injectorããããã®Injectorãæã¤ã¢ã¸ã¥ã¼ã«ã®å 容ãç¶æ¿ããåInjectorãä½æããæ©è½ã§ãã åInjectorã§ã¯è¦ªã®ã³ã³ãã¼ãã³ããåç §ã§ããã¤ã³ã¹ã¿ã³ã¹ãåå¾ããããInjectãããã§ãã¾ãã åInjectorä½ææã«ã¯Moduleã渡ããâ¦
Google Guice 2.0ããªãªã¼ã¹ãããã¾ãã!ã¨ãããã¨ã§ãæ°æ©è½ãå°ããã¤è©¦ãã¦ã¿ããã¨ã«ãã¾ããã¾ãã¯ãMultibindings 㨠MapBindingsã æ©è½ Multibindings,MapBindings ã¯ç»é²ããè¤æ°ã®ã³ã³ãã¼ãã³ãããSetãMapã§åå¾ or Injectããæ©è½ã§ããContâ¦
Kernel#autoloadã§ä»»æã®å®æ°ãåç §ããå ´åã«ãæå®ãããã¡ã¤ã«ãrequireããããã«è¨å®ã§ãã¾ãã # å®æ°Fooãåç §ããå ´åã«ãfooãrequireãã autoload :Foo, "foo" module Var # å®æ°Var::Hogeãåç §ããå ´åã«ãvar/hoge ãrequireãã autoload :Hoâ¦
Sinatraã®FAQã«Basicèªè¨¼ãè¡ããµã³ãã«ããã£ãã®ã§è©¦ãã¦ã¿ã¾ããã¨ãã£ã¦ãããset Rack::Auth::Basicããå¼ã³åºãã ãã require 'rubygems' require 'sinatra' # èªè¨¼ãè¨å®ã # ã¦ã¼ã¶ã¼åããfooã,ãvarãã®å ´åã®ã¿ã¢ã¯ã»ã¹ã許å¯ããã use Rack::â¦
yamlãrequireããã¨ãå¼æ°ã§æå®ããããªãã¸ã§ã¯ããyamlå½¢å¼ã§åºåãããKernel#yãã¡ã½ããã追å ããã¾ããKernelã«è¿½å ãããã®ã§ãçµã¿è¾¼ã¿é¢æ°ã¨ãã¦ä½¿ãã¾ãã require 'yaml' list = [ { :name => "mii", :age=>1 }, { :name => "tora", :age=>0 }â¦
Sinatraã§Sessionã使ãç°¡åãªãµã³ãã«ã§ããæé ã¯ä»¥ä¸ã ãset :sessions, trueãã§ã»ãã·ã§ã³ãæå¹åã(ãã®ã¸ãã«èª¬æãããã¾ãã) å¾ã¯ããsession[]ãã§ã»ãã·ã§ã³ã®å¤ã«ã¢ã¯ã»ã¹å¯è½ã§ãã ã¡ãªã¿ã«ãsessionã¯Sinatra::Helpersã¢ã¸ã¥ã¼ã«ã§å®ç¾©ãâ¦
Sinatraã¯ãRubyã§ç°¡åã«WebApplicationãä½æã§ããDSL(ãã¡ã¤ã³ç¹åè¨èª)ã§ãã ã¤ã³ã¹ãã¼ã« $ gem install sinatra ã·ã³ãã«ãªãµã³ã㫠以ä¸ã¯ã"/"ã«GETã§ã¢ã¯ã»ã¹ãããå ´åã"Hello World"ãè¿ãWebãµã¼ãã¼ãèµ·åããã ãã®åç´ãªãµã³ãã«ã§ãã reqâ¦
æå®ãããã³ã³ããã¹ãã§ã®ãã¼ã«ã«å¤æ°ã®ä¸è¦§(ååã¨å¤ã®ããã·ã¥)ãåå¾ããé¢æ°ãæ¸ãã¾ãããæ¦ç¥ã¯ä»¥ä¸ã§ãã ãeval( "local_variables", binding )ãã§bindingã§ã®ãã¼ã«ã«å¤æ°åä¸è¦§ãåå¾ã Kernel#local_variablesã¯ç¾å¨ã®ã¹ã³ã¼ãã§å®ç¾©ããã¦ãâ¦
ä»æ¥è¦ã¤ããã³ã¼ãããªãã ã³ã¬ãã¨æã£ããã·ã³ã°ã«ãã³ã¤ã³ã¹ã¿ã³ã¹ã®ä½æã§ããã class Kitten # ãªãã ã³ã¬ã¨æã£ããã·ã³ã°ã«ãã³ã¤ã³ã¹ã¿ã³ã¹ã®ä½æã ã£ãã Singleton = new def meow puts "meow" end end # ã·ã³ã°ã«ãã³ã¤ã³ã¹ã¿ã³ã¹ã使ãã Kittâ¦
æãè¡ãã§ã®æ±ºæ¸æ³¨æã«å¯¾å¿ãã¾ããã âGithub - unageanu / clickclient_scrap æå¤ãéæå¤ãOCOã§ã®æ±ºæ¸ã¯æªå®è£ ã§ãã ãµã³ã㫠以ä¸ã¯ã建çä¸è¦§ãåå¾ãããã¹ã¦ã®å»ºçã決æ¸ãããµã³ãã«ã§ãã $: << "../lib" require 'clickclient_scrap' require â¦
建çä¸è¦§ã®åå¾ã«å¯¾å¿ãã¾ããã âGithub - unageanu / clickclient_scrap é«éåã®ããã注æä¸è¦§ã¨åããä¸è¦§ç»é¢ããåå¾ã§ããæ å ±ã®ã¿ãè¿ãã¾ãã ãµã³ãã« $: << "../lib" require 'clickclient_scrap' require 'constants' # ãã°ã¤ã³ c = ClickClieâ¦
é常注æã®ãã£ã³ã»ã«æ©è½ãå®è£ ãã¾ããã âGithub - unageanu / clickclient_scrap ã¾ãã注æAPIã®æ»ãå¤ã¨ãã¦æ³¨æçªå·ãè¿ãå¦çãå®è£ ãã¾ããã注æâ(è¿ããã注æçªå·ãå¼æ°ã¨ãã¦)注æããã£ã³ã»ã«ããå¯è½ã§ãããªããé常注æ以å¤ã®æ³¨æ(æãè¡ãâ¦
æ¨æ¥ã®ãµã³ãã«ã§zipãã¡ã¤ã«ã®éä»ã¯ã§ããããã§ãããããã ã¨zipã®å 容ãä¸æ°ã«èªãã§éã£ã¦ããã®ã§ã転éããããã¡ã¤ã«ãµã¤ãºã大ãããªã£ãã¨ããã¡ã¢ãªã足ããªããªãåé¡ãããã¾ããæ¬æãStreamã§æå®ã§ããã°ããã®ã ãã©ãTMailã§ã®ããæ¹ããâ¦
TMail+Net::SMTPã§ãzipãã¡ã¤ã«ãã¡ã¼ã«ã§éä»ãããµã³ãã«ã§ãã(â»æ·»ä»ãã¡ã¤ã«ã¨ãã¦éä»ãã¦ããããã§ã¯ãªãã®ã§ã注æãã¡ã¼ã«ã®æ¬æãzipã§ãã) å¦çã¨ãã¦ã¯ã ã¡ã¼ã«ã®bodyã¨ãã¦èªã¿è¾¼ãã ãã¡ã¤ã«ãBase64ã¨ã³ã³ã¼ããããã®ãæå®ã content_tyâ¦
Ubuntu9.0.4ã§apacheããªãã¼ã¹ãããã·ãµã¼ãã¼ã«ãã¦ãåããã·ã³ã®8080ãã¼ãã§åä½ãã¦ããWebrickãµã¼ãã¼ã«å¤é¨ããã¢ã¯ã»ã¹ã§ããããã«ããæé ã§ãã æ¦è¦ proxyã¢ã¸ã¥ã¼ã«ã®æå¹å è¨å®ãã¡ã¤ã«ã®ç·¨é apacheã®åèµ·å 1.proxyã¢ã¸ã¥ã¼ã«ã®æå¹å â¦
ãã¢ãµã¤ãã«ç¹ãããªããªã£ã¦ããã®ãä¿®æ£ãã¾ããã åå ãµã¼ãã¼ã®ç½®ãæãå¾ãã«ã¼ã¿ã§ã®ã«ã¼ãã£ã³ã°è¨å®ãããã£ãã®ã§ãããå¤æ´å¾ã«ã¼ã¿ãåèµ·åããªãã¨è¨å®ãåæ ãããªããããããããã¹ã«ã¼ãã¦ããã®ãåå ã§ããUIã«ãåæ ããã¿ã³ããã£ãâ¦
ç³ã訳ããã¾ãããç¾å¨ãjijiã®ãã¢ãµã¤ãã«æ¥ç¶ã§ããªããªã£ã¦ããããã§ãã é£ä¼ä¸ã«èªå® ãµã¼ãã¼ãå¤æ´ããã®ã§ãã©ããã§è¨å®ããã¹ã£ã¦ãããã®ã¨æããã¾ããorz.ãã°ãããå¾ ã¡ãã ããã
jiji 1.1.0ããªãªã¼ã¹ãã¾ãããæ¬ãã¼ã¸ã§ã³ããã証å¸ä¼ç¤¾ã¸ã®ã¢ã¯ã»ã¹ãã¸ãã¯ããã©ã°ã¤ã³ã§å¾ãã追å ã§ããããã«ãªã£ã¦ãã¾ããâãªã¼ãã³ã»ããªã¼ã®FXèªååå¼ã·ã¹ãã ãjiji (ã¸ã¸) ã âGithub - unageanu/jiji ã¢ã¯ã»ã¹ãã©ã°ã¤ã³èªä½ã¯ãã¾ã ãã¯â¦
æ°ãã¤ãã¨ãWindowsã®ã¿ã¹ã¯ããã¼ã¸ã£ãæ ã ãã«ãªã£ã¦ããã æ ã ããªã®ã§ããéããããã¿ã³ããæå°åããã¿ã³ããªããé表示åã§ããªãã ã¨ã¯ã¹ããã¼ã©ã¼ããã°ã£ãã®ããªãã¨æã£ã¦åèµ·åããããç¶æ³ã¯å¤ãããã 調ã¹ã¦ã¿ãã¨ã以ä¸ã®ãµã¤ãããâ¦
ãStruct.newãã®ç¬¬ä¸å¼æ°ã§ãæ§é ä½ã®ååãæå®ã§ããããã¾ãã ååãæå®ããå ´åãStructã®ã¯ã©ã¹å®æ°ã¨ãã¦çæãããæ§é ä½ãå®ç¾©ããã¾ãã å®ç¾©å¾ã¯ãStruct::ãã§ä½æããæ§é ä½ã«ã¢ã¯ã»ã¹ã§ãã¾ãã å¤æ°ãå®æ°ã«ä»£å ¥ããå¿ è¦ã¯ããã¾ããã(代â¦