2009-04-01ãã1ã¶æéã®è¨äºä¸è¦§
çµã¿è¾¼ã¿é¢æ°ãwarn ãã§æ¨æºã¨ã©ã¼åºåã«æååãåºåãã¾ãã warn "foo" å®è¡çµæã§ãã fooãããªã®ããã£ãã¨ã¯ãã¡ãªã¿ã«ã$VERBOSEã§è¦åã®åºåãæå¶ã§ãã¾ãããã¨ãã°ä»¥ä¸ã®ã³ã¼ããå®è¡ãã¦ãä½ãåºåããã¾ããã # $VERBOSEãnilã«ããã¨åºåãâ¦
GMailã®SMTPãµã¼ãã¼ã«æ¥ç¶ããã¡ã¼ã«ãéä¿¡ãããµã³ãã«ã§ãã TMailå©ç¨ãã¦ã¡ã¼ã«ãä½æã ããã使ãã¨ãæ¥æ¬èªã¡ã¼ã«ãæ·»ä»ãã¡ã¤ã«ä»ãã¡ã¼ã«ãããã£ã¨ä½æã§ããã¿ããã§ãã ã¡ã¼ã«ã®éä¿¡ã¯Rubyä»å±ã®Net::SMTPã§ã GMailã®smtpãµã¼ãã¼ã§ã¯ãTLSã«â¦
aptã®åºæ¬çãªä½¿ãæ¹ã å©ç¨å¯è½ãªããã±ã¼ã¸ä¸è¦§ãæ´æ°ããã $ sudo apt-get updateå®æçã«å®è¡ããã¨åã ããã±ã¼ã¸ãååã§æ¢ãã $ apt-cache search rubygems ããã±ã¼ã¸ããã¡ã¤ã«åã§æ¢ãã $ dpkg -S gemãdpkgãã£ã¦ãªãã ãã ããã±ã¼ã¸ãã¤ã³â¦
Ubuntu9ããªãªã¼ã¹ãããã®ã§ãèªå® ãµã¼ãã¼ããªãã¬ã¼ã¹ããã¹ãä½æ¥ä¸ããã2-3å¹´ã¯ãã£ã¨CentOSã ã£ãã®ã§åºæ¬çãªã¨ããã§æ¸æã£ããã rootã§ãã°ã¤ã³ã§ããªããã¨ããããã¤ã³ã¹ãã¼ã©ã§å ¥åããè¦ãããªããã ãã©ãã©ãããã¨! âUbuntuã§ã¯ãsudoãâ¦
Object#freezeã§ãã¤ã³ã¹ã¿ã³ã¹ã®å¤æ´(ã¤ã³ã¹ã¿ã³ã¹å¤æ°ã®å¤æ´)ãç¦æ¢ã§ãã¾ãã class Kitten def name @name end def name=(name) @name = name end end mii = Kitten.new mii.name = "mii" #åçµã mii.freeze #åçµå¾ã¯ã¤ã³ã¹ã¿ã³ã¹å¤æ°ãå¤æ´ã§ããªããâ¦
ãã©ã°ã¤ã³ãã¼ãã¼ã試ä½ãã¾ããã æ¹é ãã©ã°ã¤ã³ã¯Gemã§ã ãã£ãããªã®ã§rubygemsã使ã£ã¦ããã©ã°ã¤ã³ãç°¡åã«è¿½å /åé¤ã§ããããã«ãããã ãªã®ã§ãgemã®å½¢å¼ã§ãã©ã°ã¤ã³ãæä¾ã§ããããã«ããã gemã«ãã¦ããã°jijiã¸ã®çµã¿è¾¼ã¿ã容æãjijiã®â¦
ä»æ¥è¦ã¤ããã³ã¼ãã puts "%-21s: %s" % ["key", "value"] String#%ã§ãã©ã¼ããããã§ããã®ãããµããå®è¡çµæã¯ä»¥ä¸ã§ãã key : value
Gem#latest_load_paths()ã§ãã¤ã³ã¹ãã¼ã«ããã¦ããGemã®ãã¼ããã¹ã®ä¸è¦§ãåå¾ã§ãã¾ãã æ§ãã¼ã¸ã§ã³ã®Gemã®ãã¹ã¯å«ã¾ãã¾ããã $LOAD_PATHã®ãã¹ãå«ã¾ãã¾ããã require 'rubygems' puts Gem.latest_load_paths() å®è¡çµæã§ãã ... /usr/lib/rubâ¦
ä»æ¥è¦ã¤ããã³ã¼ãã for ( String path : paths ) try { // å¦ç1 // å¦ç2 } catch (Exception e) { // ä¾å¤çºçæã¯ãã°ã ãåºåãã¦ç¶ç¶ } ãã¼ãããã¾ã§ãã¦ã¤ã³ãã³ãæ¸ããããã¨ã¯æããªãããªã
RubyGemsã«ã¯ãã©ã°ã¤ã³ã®ä»çµã¿ããã£ã¦ã以ä¸ã®ããã«ãã©ã°ã¤ã³ãæ¤åºãã¦ãã¼ãããã¨ã®ãã¨ã Gem ã® rdoc ããã RubyGems PluginsAs of RubyGems 1.3.2, RubyGems will load plugins installed in gems or $LOAD_PATH. Plugins must be named ârubygeâ¦
Gem#find_filesã使ãã¨ãæå®ãããã¹ã«ããããããã¡ã¤ã«ãæ¢ç´¢ã§ãã¾ãã ãã¹ã«ã¯ã¯ã¤ã«ãã«ã¼ãã使ãã¾ãã(Gem::GemPathSearcherã¨åãããDir#globãã¦ããæ§åã) åãGemã®å¥ãã¼ã¸ã§ã³ã«å«ã¾ãããã¡ã¤ã«ã¯ãããããå¥ã®ãã¡ã¤ã«ã¨ãã¦ããããâ¦
ä¸å ·å1件ãä¿®æ£ãã jiji 1.0.3 ããªãªã¼ã¹ãã¾ãããâãªã¼ãã³ã»ããªã¼ã®FXèªååå¼ã·ã¹ãã ãjiji (ã¸ã¸) ã âGithub - unageanu/jiji å¤æ´å 容 ãã°ã©ãã®è²ãå¤æ´ãã¦ããªãã¼ãããã¨å ã«æ»ããä¸å ·åãä¿®æ£ã åå : è²ã®ãã¼ã¿ã示ãMapã®ãã¼ãããâ¦
ããã·ã¥ã®ãã¼ãã·ã³ãã«ã«å¤æãããã¨ãã¦ãâã®ããã«æ¸ãããåããã hash = {"a"=>"aaa", "b"=>"bbb"} p hash.map{|entry| [entry[0].to_sym, entry[1]] } å®è¡çµæã§ãã [[:a, "aaa"], [:b, "bbb"]]Rubyãªãã¡ã¬ã³ã¹ããã¥ã¢ã«ã®Enumerable#mapã«ãâ¦
Gem::GemPathSearcherã使ãã¨ããã¼ã«ã«ã«ã¤ã³ã¹ãã¼ã«ãããGemã®ä¸ãããç¹å®ã®ãã¡ã¤ã«ãå«ãGemãæ¢ç´¢ãããã¨ãã§ãã¾ãã findã§æåã«è¦ã¤ãã£ã1ã¤ãã find_allã§ããããããã®å ¨ã¦ãåå¾ã§ãã¾ãã find_allã®æ¹ã¯æ§ãã¼ã¸ã§ã³ã®ãã®ãããããâ¦
ãã¢ãµã¤ãã®ã¬ã¼ãæ å ±åå¾ãæ¨æ¥ã®10:20åé ããæ¢ã¾ã£ã¦ã¾ããªã¼ãorzã ãã°ãè¦ãéãã§ã¯é¢é£ããããªã¨ã©ã¼ã¯åºã¦ãªããã ãã©ã»ã»ã»ãã©ããããã®é ã«å®è¡ããããã¹ããæªããæãããã¼ããªãããã°ãããã®ãããã¨ããã°ã©ãã®è²ãå¤æ´ãã¦ããªâ¦
ãã£ã¡ã«ã±ã¼ã¹ãåèªã«åå²ãããã¨ãã«ã¯ããã¼ãå¹ ã®è¯å®å èªã¿ãã使ãã¨ããã£ã¨ã§ãã¾ãã // åå²ããæåå String str = "StringIndexOutOfBoundsException"; // å°æåã¨å¤§æåã®éã§åå² String[] strs = str.split( "(?<=[a-z])(?=[A-Z])" ); foâ¦
Gemã®APIã§åå¾å¯è½ã§ãã require ã Gem::activate ã§Gemãæå¹åããã¨ã ãã¼ãããã gem ã® Gem::Specification ã Gem.loaded_specs ã«ä¿æããã¾ãã ãã¨ã¯ãGem::Specification ãããã¼ã¸ã§ã³ãåå¾ããã°OKã ãã¼ã¸ã§ã³ã®åã¯Gem::Versionã§ãâ¦
","ã§æååãåå²ããã ãã ãã"\"ã«ç¶ã","ã¯ã¨ã¹ã±ã¼ãããã¦ããã¨è¦ãªãã¦åå²ããªããã¨ãã£ãã¨ãã«ã¯ããã¼ãå¹ ã®å¦å®çå¾èªã¿ãã¨ããã®ã使ãã°OKã§ãã // åå²ããæåå String str = "\\,a\\,a,bb\\,,cc\\,,\\,\\,,"; // ã\ã«ç¶ããªã,ãã§â¦
åçãªãªã¼ã¹å¾ã«æ°ãã¤ããä¸å ·åã4件ã»ã©ä¿®æ£ãã¾ããã ã·ã¹ãã ãåèµ·åããã¨ãåä½ä¸ã®ã¨ã¼ã¸ã§ã³ããå ¨ã¦åæ¢ç¶æ ã¨ãªãã ãªã¢ã«ãã¬ã¼ãã§å»ºçã«ã¨ã¼ã¸ã§ã³ãåãè¨å®ãããªãå ´åãããã ãªã¢ã«ãã¬ã¼ãã§è¿½å ããã¨ã¼ã¸ã§ã³ãã®ã°ã©ãè¨å®ãã§â¦
OCO注æã«å¯¾å¿ã âGithub - unageanu / clickclient_scrap æè¡æ³¨æãå®è£ ãã¦ã¿ã¾ããããä¼æ¥ã¯æãè¡ãã§ã®æ³¨æã¯åæ¢ä¸ãããåä½ç¢ºèªãã§ãã¦ãã¾ããã ãµã³ãã« $: << "../lib" require 'clickclient_scrap' # â»sample.rbã¨åããã£ã¬ã¯ããªã«user,paâ¦
jijiã§åéãããçºæ¿ã¬ã¼ããåå©ç¨ããã«ã¯ãCSVãã¡ã¤ã«ã«ä¿åããããã¼ã¿ãå©ç¨ããã»ããjijiãæä¾ããJSON-RPCã¤ã³ã¿ã¼ãã§ã¤ã¹ãå©ç¨ãã¦åå¾ãããã¨ãã§ãã¾ãã å ·ä½çã«ã¯ã以ä¸ã®ãããªæ¬æãããhttp://:/json/rateãã«postããã°OKã {"methâ¦
reportã¿ã¹ã¯ã§ãã¢ã¸ã¥ã¼ã«ã®ä¾åé¢ä¿ãªãã¼ããä½æã§ãã¾ãã <project default="report" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant"> <property name="ivy" value="ivy"/> <target name="report" depends="download-ivy" > <ivy:resolve /> </ivy:resolve></target></property></project>
ãªãã¶ã¼ãã¼ã®ä»çµã¿ã¯java.util.Observableã使ãã¨ããã£ã¨ä½ãã¾ããããã©ã¡ã¼ã¿ã§æ¸¡ãããã¤ãã³ã?ãªã©ãObjectåã«ãªã£ã¦ãã¦ã¡ãã使ãã«ãããããã§ãã¤ãã³ãã®åããã©ã¡ã¼ã¿ã§æå®ã§ããããã«ããã©ããã¼ãæ¸ãã¦ã¿ã¾ããã /** * ã¿ã¤ãã»â¦
dual ãªã¾ã«ãã使ãã¨ãjarã¨ivy.xmlãããããå¥ã®ãªã¾ã«ãã使ã£ã¦åå¾ãããã¨ãã§ãã¾ããéivyãªjarããã£ã¦ã¢ã¯ã»ã¹å¯è½ãªURLã§å ¬éããã¦ããå ´åããã¼ã«ã«ã«ivy.xmlãç¨æãdualãªã¾ã«ãã§URLä¸ã®jarã¨ãã¼ã«ã«ã®ivy.xmlããããããåå¾ãããã¨â¦
Ivyã§ã¨ã©ã¼ã«ãªã㨠[ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILSã¨ããããã¾ããããããå ´åã¯ãAntã®èµ·åãªãã·ã§ã³ã§ã-vã¨ã-dã¨ãã¤ããã¨OKã $ ant -d -v retriveã-dãã-vãã¨ãã«antã®æ©è½ã§ããããããããã°ã¢ã¼â¦
Ivyã§è¨å®ãã¡ã¤ã«ãivysettings.xmlããæ示ããæ¹æ³ã«ã¤ãã¦ã å¤æ°ãivy.settings.fileãã§æå®ããæ¹æ³ ãivy:settingsãã¿ã¹ã¯ã§è¨å®ããæ¹æ³ ã®2ã¤ãããã¾ãã 1.å¤æ°ãivy.settings.fileãã§æå®ããã ãivy.settings.fileãã®å¤ã¨ãã¦ãivysettingâ¦
ãjijiããèµ·åããã¨çºæ¿ã¬ã¼ããå®æçã«åéããããã¼ã«ã«ã«CSVå½¢å¼ã§ä¿åããã¾ããCSVå½¢å¼ãªã®ã§ãã³ãã¼ãã¦ä»ã®ã¢ããªã±ã¼ã·ã§ã³ã§ããã£ã¨å©ç¨ãããã¨ãå¯è½ããã¼ã½ã¯è¶³ãã£ã¼ã表示æ©è½ãã¤ããçºæ¿ã¬ã¼ãåéãµã¼ãã¼ã¨ãã¦ãjijiãã使ããã¨â¦
å é±å ¬éãããªã¼ãã³ã»ããªã¼ã®Fxèªååãå¼ãã·ã¹ãã ãjijiãã§ãããæéã®é½åããã£ã¦ããã¿ã¨ãã¦ã¯èãããã©å®è£ ã§ããªãã£ãæ©è½ãªã©ãããããããããã§ãã ãã¢ãã¬ã¼ã以å¤ã®è¨¼å¸ä¼ç¤¾ã®ãµãã¼ã ã¯ãªãã¯è¨¼å¸Webãµã¼ãã¹ã®å ¬éåæ¢ããã£ã¦ãâ¦
Ivyã§ä¾åã¢ã¸ã¥ã¼ã«ã®åå¾æã«è¤æ°ã®ãµã¼ãã¼ã«åãåãããããã«ããæ¹æ³ã§ãããchain ãªã¾ã«ãã使ãã°è¯ããã§ãããã®ã¾ã¾ãã°ããªè§£èª¬ããã¡ãã«ããã¾ããå ·ä½çã«ã¯ã <ivysettings> <settings defaultResolver="chain"/> <resolvers> <chain name="chain"> <url name="url-resolver"> </url></chain></resolvers></settings></ivysettings>
URLãªã¾ã«ããå©ç¨ããã°ãç¹å®ã®URLã§å ¬éããã¦ããã¢ã¸ã¥ã¼ã«ããä¾åã¢ã¸ã¥ã¼ã«ã¨ãã¦Ivyã§åå¾ãããã¨ãã§ãã¾ãã å ·ä½çã«ã¯ã ãivysettings.xmlããä½æããURLãªã¾ã«ãã®è¨å®ã追å ã artifactè¦ç´ ã®å¤ã¨ãã¦ãåå¾å URLãæå®ã[revision]ã[artâ¦