ruby
C/C++ã®åå¼·ãã¦ãã«æ¸ãã¦ã¿ããpopen()ãªãã¦åãã¦ä½¿ãã®ã§ä½¿ãæ¹ããããããã
pitãã©ããããã®ããã¨ããã®ã¯ä»¥ä¸ã®ãªã³ã¯ãåç §ãã¢ã«ã¦ã³ãæ å ±ã管çããã³ãã³ã pit - å¬éãã«æ¶ãè¡ãå¶æã¬ã¼ã«ã¯â夢ç©èªã«ãªã¢ã«ãæ±ããªãã - subtechä¹ ãã¶ãã«ä½¿ãã¨ãã£ããå¿ãã¦ãã®ã§ã¡ã¢ ã¢ã«ã¦ã³ãæ å ±ã®ç»é² ã¢ã«ã¦ã³ãæ å ±ã®ç»é²ã¯â¦
ãªãããgem installããã¤ãã®biné ä¸ã®ã³ãã³ãããã¤ã³ã¹ãã¼ã«ããã¦ããªãã£ã½ãã£ãã®ã§ãã¡ãã£ã¨èª¿ã¹ããã¨ããããã~/.gemrcã«ä»¥ä¸ã®ããã«æ¸ãã¦ããã°è¯ãã¿ããã ã£ãã®ã§æ¸ãã¦ããããã¤ã³ã¹ãã¼ã«ãããã gem: --bindir /usr/local/bin åâ¦
ä½ã£ã¦ã¿ãã ãªãããã¯ã¦ãªããã¯ãã¼ã¯ä»¶æ°åå¾APIï¼XML-RPCçï¼ãRubyããå©ãã¦ã¿ããã ãã©ãã¬ã¹ãã³ã¹ã®Content-Typeã"æå¾ ã¨éã"ã¨ãããã¨ã§ã¨ã©ã¼ã«ãªã£ã¦ãã¾ãã ã©ããXML-RPCã§ã¯Content-Typeã¯text/xmlãæå¾ ãã¦ããã¿ããã ããã¯ã¦ãªã®â¦
ruby 1.9.1ã 㨠Sinatra ãåããªãã®ã§ãUpdate ããã㨠brew install ruby ã¨å©ããã Warning: /usr/local/lib/ruby exists as a symlink The previous Ruby formula symlinked /usr/local/lib/ruby into Ruby's Cellar. This version creates this as aâ¦
ãããã¯ã¼ã¯ä¸ã§ä¸ç¹å®å¤æ°ãå ±æãããã¡ã¤ã«ããã¤æ´æ°ããã¦ããã確èªãããå ´åã£ã¦å¤ã ããã ããã§ããã¡ã¤ã«ã®æ´æ°æ¥ããã§ãã¯ãã¦ååã®æ´æ°æ¥ããå¤æ´ãããã° Growl ã§éç¥ããã¹ã¯ãªããããã¦ã¿ãã å®è¡ããã¨ããããªæãã§ãã¡ã¤ã«ã®æ´æ°â¦
ã¿ããªruby-listã«ã¯ãã£ã¨æ°æ¥½ã«æãã¦ããã¨æããã§ããã 2010-01-30 - ã¯ã¦ãªããã ããã ããã§ãããããããçç±ã¯ãªããã¨ããããã¨ã§æãã¦ã¿ãã
json_pureã使ã£ãã¹ã¯ãªãããexeåããã¨iconvã使ç¨ãã¦ããç®æã§ã¨ã©ã¼ãçºçããç¾è±¡ãèµ·ããã®ã§èª¿æ»ãã¦ã¿ãã以ä¸ã®ãããªRubyã¹ã¯ãªãããexeåãã¦ã¿ããï¼ãã¡ã¤ã«åã¯"text.rb"ã¨ããï¼ require 'iconv' UTF16toUTF8 = Iconv.new('utf-16be', 'â¦
ããããã¹ãã¬ã¹ãã¾ãæ°å³ã ã£ãã®ã§ãæ°å転æã«Rubyã§éãã§ã¿ãããããªæãã§ãºã©ãºã©ã¨æ¾éä¸ã®çªçµã表示ããã¾ããããã£ãã¨ããã¯ããªã¯ã¨ã¹ããæããã¨ãã«æååã®æå¾ã«"\0"ï¼ããããNULLæåï¼ãä»ãã¦ãããªãã¨ããµã¼ãããã¬ã¹ãã³ã¹ãâ¦
ããã¶ãåããã¤ã³ãã©ãããã§ã®Wikiã«ã¯PukiWikiãå°å ¥ãã¦ãã æè¿ãããã¸ã§ã¯ãããã·ã¥ãã¼ãçã«Wikiã使ãå§ãã¦ãã¦ãã¡ãã£ã¨ãããã©ã°ã¤ã³ãæ¸ããããªã£ããã©PHPã ã¨è¾ããªã¼ãã¨ãããã¨ã§ã©ãã«ãRubyã§æ¸ãæ¹æ³ã模索ãç°¡åãªæ¹æ³ãè¦ã¤â¦
å æ¥å ¬éãããWindowsçNotify.ioã¯ã©ã¤ã¢ã³ãã§ããããã®ç´å¾ã«Notify.ioã®APIä»æ§å¤æ´ ãããåãã¦ãã¾ããã§ãããããã£ã¨ã¾ã¨ã¾ã£ãæéãåãäºãã§ããæ°APIã¸å¯¾å¿ãããã¨ãã§ãã¾ãããããã¦ãã¢ããªã±ã¼ã·ã§ã³ã®ååã"Notify-io-client-4R"ã¨â¦
ãããã¬ã®èµ·å ruby -r debug <ã¹ã¯ãªãã> ç¾å¨ã®å®è¡è¡ã®å¨è¾ºã®ã³ã¼ãã表示 (rdb:x) l[ist] <è¡çªå·> ã¹ãããå®è¡ (rdb:x) s[tep] ãã¬ã¼ã¯ãã¤ã³ãã®è¨å® (rdb:x) b[reak] <è¡çªå·>ã¯ã©ã¹åãã¡ã½ããåã§è¨å®ãããã¨ãã§ãããããã*1 ãã¬ã¼ã¯ãã¤â¦
irbã§è©¦ãã¦ã¿ã irb(main):001:0> require 'vr/vruby' => true irb(main):002:0> SWin::Application.messageBox "Hello, VisualuRuby world." => 1^@ ããã¥ã¡ã³ããæ¢ãã®ãé£åã§ããã åè Application.rd
ã¡ãã£ã¨ææ§ãªã¨ããããããã©ãåãåããå¼ã³åºããã¨ãã§ããã®ã§ã¡ã¢ã£ã¨ããä»åãWindowsAPIã®SHChangeNotifyãå¼ã³åºãå¿ è¦ããã£ã¦ããã®æ¹æ³ã調ã¹ããirbã§ããããã¨ãã以ä¸ã®ãããªæãã§å¼ã³åºããã¨ã«æåããã irb(main):001:0> require â¦
ã¿ããªãã£ã¦ãã¨æããã©ãèªåã®ããã«ã¨ã³ããªã«ãã¨ãã 使ãæ¹ ä»¥ä¸ã®ãããªæãã§ä½¿ã $ echo "ã¡ã¼ã«æ¬æ" | ruby sendmail.rb smtp.yourdomain.com [email protected]ãã©ã¡ã¼ã¿ã¯é çªã« SMTPãµã¼ã ãã¦å ï¼éä¿¡å ï¼ã¡ã¼ã«ã¢ãã¬ã¹ åºæ¬çã«èªåã§â¦
ãªã³ã©ã¤ã³ã®ãªãã¡ã¬ã³ã¹ãèªãã§ããããããããã£ãã®ã§ã½ã¼ã¹ããã©è¦ãã ã¹ã¯ãªããèªèº«ãExerbã©ã³ã¿ã¤ã ã§å®è¡ããã¦ãããå¤å¥ãã Exerbã®ã©ã³ã¿ã¤ã ã§åãã¦ããéã$Exerbã°ãã¼ãã«å¤æ°ãtrueã«ãªã£ã¦ããã®ã§ãããã§å¤å¥ã§ããã if $Exerb â¦
å ã¨ãªãã¹ã¯ãªãããæ¢ã«åå¨ããç¶æ ãã ã¬ã·ããã¡ã¤ã«ã®ä½æ > mkexy <ã¹ã¯ãªããå>ã¾ã㯠> ruby -r exerb/mkexy <ã¹ã¯ãªããå>ã§ã¹ã¯ãªãããå®è¡ãããã¨ã§ãã¬ã·ããã¡ã¤ã«ãä½æãããã ã¬ã·ããã¡ã¤ã«ããexeãçæ > exerb <ã¹ã¯ãªããå>ã§eâ¦
ããããã㨠cronã¨ãã§ãèªåçã«ã¹ã¯ãªãããå®è¡ããã¨ãã«ããã®å®è¡éå§ï¼çµäºã®ã¿ã¤ãã³ã°ã§éå§æå»ï¼çµäºæå»ãæ¨æºåºåã«åºåãããã ãã㧠æ±ç¨çã«ä½¿ããã¡ãã£ã¨ããã¹ã¯ãªãããçµãã§ã¿ã以ä¸ã®ã¹ã¯ãªããããtimestamp.rb ã¨ããååã§ä½â¦
æåã³ã¼ãé¢ä¿ã¯è¦æ ãã£ã¨ããæ¹æ³ããããããããªã... class String def jleft(len) result = "" total_len = 0 self.split(//).each do |c| break if (c.size + total_len) > len result << c total_len += c.size end result end end (1..18).each {â¦
èªåã®å ´å Googleã¢ã«ã¦ã³ãã®èªè¨¼ã Mechanizeã§éããã¨ããã¨ãã®ãã®ã¨ã©ã¼ã«ééããã /opt/local/lib/ruby/gems/1.8/gems/mechanize-0.9.3/lib/www/mechanize/util.rb:40:in `iconv': can't convert nil into String (TypeError) from /opt/local/liâ¦
以ä¸ãåèã«æ¸ãã¦ã¿ãã codeãªã«ãã::Rubyã§Excelä»æ§ã®CSVãã¡ã¤ã«ã®èªã¿è¾¼ã¿ã¨è¡¨ç¤º require 'csv' source = <
以ä¸ã®ãµã¤ããã Proper way to detect Windows platform in Ruby - The Empty WayMac OS X 10.5.8 ã§ã®çµæ irb(main):004:0> Config::CONFIG['host_os'] => "darwin8" Cygwinã§ã®çµæ irb(main):002:0> Config::CONFIG['host_os'] => "cygwin" Windowsã§â¦
.bashrcã¨ãã§aliasãã¨ãã¨ãããã alias spec='spec -c'
ãã¾ããèããªãã #!/usr/bin/ruby print "Content-type: text/plain\r\n\r\n" print "Hello, Ruby" CGIã©ã¤ãã©ãªä½¿ç¨ãã¼ã¸ã§ã³ #!/usr/bin/ruby require 'cgi' cgi = CGI.new("html3") cgi.out {"<h1>hello, ruby</h1>"}
å¿ è¦ã«ãã¾ããã¦ãã¡ããã£ã¨rubyã§æ¸ãã¦ã¿ãããã¶ããã³ã³ããã¼ã«ããã«ã®ãããã°ã©ã ã®è¿½å ã¨åé¤ãã«è¡¨ç¤ºããã¦ãããã®ã¯åºã¦ããã¨æãã è¿½è¨ ã©ããå 容ãéè¤ããå ´åããããããªã®ã§ã ruby list_apps.rb | sort | uniqã¨ããæãã§éè¤ãã®â¦
Sinatraã®ãã¼ã«ã«éçºç¨ã¨ãã¦WEBrickã§ãã¹ãç¨CGIãµã¼ãæ¸ãã¦ã¿ããã*1 WEBrickã®ããã©ã«ãã 㨠'.cgi'ãCGIã¹ã¯ãªããã¨ãã¦èªèããããã«ãªã£ã¦ãã¦ãå®æããã¢ããªããããã¤ããåã«'.rb'ã«æ»ãããããã®ãé¢åã ããã©ãã«ã®å ã«ãªããããªã®â¦
Sinatraã§ã対å¿ãã¦ã軽éï¼ã·ã³ãã«ãªãã³ãã¬ã¼ãã¨ã³ã¸ã³Hamlã«ã¤ãã¦ããã¹ã¦ã¿ãã ãã®ãã¥ã¼ããªã¢ã«ãåæã«è¦ç´ãã¦ã¿ã ERBã¨æ¯è¼ãã¦ã¿ãã¨ãã®ã·ã³ãã«ãããããããã ã¿ã°ã¨ãã®ã³ã³ãã³ã ãã³ãã¬ã¼ãã¨ã³ã¸ã³ è¨è¿° ERB <strong><%= item.title %></strong>â¦
ã¨ããããæãã¦ãããidããã¹ã¯ã¼ããcronãµã¼ãã¹ããå©ãããã®apikeyãªã©ã®æ å ±ã¯å¤é¨ãã¡ã¤ã«ã«ä¿åãã¦ããã
ã¯ããã¦Sinatraããã£ããã©ããããç°¡åã§ã¤ã¤ãDSLã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ãAppjetã«ã¡ãã£ã¨ä¼¼ã¦ãé¨åãããã®ãããã£ãã®ããã 第ä¸ã«ã¯ããã¨ãã¨ã®ã¢ããªãåç´ãããã£ã¦ã®ããããã©....以ä¸ãHerokuã«ç§»æ¤ããã¢ã㪠Twitterã®ãã£ã¼ããåãã㤠iâ¦
Running a Ruby Program as a Windows Service? - Stack Overflow ã³ã¼ãã¯ä¸è¨ã®ãµã¤ãã®ä¸¸åã ã¨ãããããWindowsãµã¼ãã¹ãä½ããã®ã§èªåã¡ã¢ä¸è¨ã³ã¼ããåããããã«ã¯ win32-service ã¨ããgemãå¿ è¦ äºåã« gem install win32-service -rã§ã¤ã³ã¹â¦