54件ヒット
[1-54件を表示]
(0.011秒)
検索結果
-
logger (13.0)
-
ログを記録するためのライブラリです。
...ですが、評価されます)。
//emlist[][ruby]{
logger.debug("This is a " + potentially + " expensive operation")
//}
==== loggerのclose
logger.close
==== ログレベル設定
1. オリジナルインターフェイス
//emlist[][ruby]{
logger.sev_threshold = Logger::WARN
//}
2. (あ... -
shell (13.0)
-
Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。
...ir3", "dir5"]
unless sh.exists?(dir)
sh.mkdir dir
sh.cd(dir) do
f = sh.open("tmpFile", "w")
f.puts "TEST"
f.close
end
print sh.pwd
end
end
==== Example 2:
require 'shell'
sh = Shell.cd("/tmp")
sh.transact do
mkdir "shell-test-1" u......ir3", "dir5"]
if !exists?(dir)
mkdir dir
cd(dir) do
f = open("tmpFile", "w")
f.print "TEST\n"
f.close
end
print pwd
end
end
end
==== Example 3: Using Pipe
require 'shell'
sh = Shell.new
sh.cat("/etc/printcap") |... -
fcntl (7.0)
-
ファイルディスクリプタを扱う Unix のシステムコール IO#fcntl (つまり fcntl(2)) で使用できる定数を集めたモジュールです。
...:
require "fcntl"
m = s.fcntl(Fcntl::F_GETFL, 0)
f.fcntl(Fcntl::F_SETFL, Fcntl::O_NONBLOCK|m)
require 'fcntl'
fd = IO::sysopen('/tmp/tempfile',
Fcntl::O_WRONLY | Fcntl::O_EXCL | Fcntl::O_CREAT)
f = IO.open(fd)
f.syswrite("TEMP DATA")
f.close... -
net
/ ftp (7.0) -
FTP プロトコルを扱うライブラリです。
...gin
ftp.passive = true
ftp.chdir('pub/ruby')
files = ftp.list('ruby*')
ftp.getbinaryfile('ruby-1.9.1-p243.tar.bz2', 'ruby.bz2', 1024)
ftp.close
例2:
require 'net/ftp'
Net::FTP.open('ftp.example.org') do |ftp|
ftp.login
ftp.passive = true
ftp.chdir('pub/ruby')
files =... -
net
/ smtp (7.0) -
メールを送信するためのプロトコル SMTP (Simple Mail Transfer Protocol) を扱うライブラリです。
...ールを送ったら Net::SMTP#finish を呼んで
セッションを終了しなければいけません。
File のように GC 時に勝手に close されることもありません。
# using SMTP#finish
require 'net/smtp'
smtp = Net::SMTP.start('smtp.example.com', 25)
smtp.send_messa...