るりまサーチ

最速Rubyリファレンスマニュアル検索!
462件ヒット [1-100件を表示] (0.067秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

ERB::Util.#h(s) -> String (18120.0)

文字列 s を HTML用にエスケープした文字列を返します。

... HTML用にエスケープした文字列を返します。

文字列 s 中に含まれる &"<> を、実体参照 &amp; &quot; &lt; &gt; にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。

@param s HTMLエスケープを行う文字列

//emlist[例][ruby...
...]{
require
"erb"
include ERB::Util

puts html_escape("is a > 0 & a < 10?")
# is a &gt; 0 &amp; a &lt; 10?
//}...

Benchmark.#benchmark(caption = "", label_width = nil, fmtstr = nil, *labels) {|rep| ...} -> [Benchmark::Tms] (9219.0)

Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。

...Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。

基本的には以下のように使います。
ブロックが Benchmark::Tms オブジェクトの配列を返した場合は、
それらの数値も追加の行に表示...
...します。
@param label_width ラベルの幅を指定します。
@param fmtstr フォーマット文字列を指定します。
この引数を省略すると Benchmark::FORMAT が使用されます。
@param labels ブロックが Benchmark::Tms オブジェクトの配...
...。Benchmark::Tms#utime
: %y
system CPU time で置き換えられます(Mnemonic: y of "s*y*stem")。Benchmark::Tms#stime
: %U
子プロセスの user CPU time で置き換えられます。Benchmark::Tms#cutime
: %Y
子プロセスの system CPU time で置き換えられます。Benchmark::...

Digest.#hexencode(string) -> String (6167.0)

引数である文字列 string を、16進数に変換した文字列を生成して返します。

.../emlist[][ruby]{
require
'digest'

p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Digest.hexencode("\xB0") # => "b0"

p digest = Digest::MD5.digest("ruby") # => "X\xE5=\x13$\xEE\xF6&_\xDB\x97\xB0\x8E\xD9\xAA\xDF"
p Digest.hexencode(...
...D5.hexdigest("ruby") # => "58e53d1324eef6265fdb97b08ed9aadf"

p digest = Digest::SHA1.digest("ruby") # => "\x18\xE4\x0E\x14\x01\xEE\xF6~\x1A\xE6\x9E\xFA\xB0\x9A\xFBq\xF8\x7F\xFB\x81"
p Digest.hexencode(digest) # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
p Digest::SHA1.hex...
...digest("ruby") # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
//}

文字列から16進数に変換したハッシュ値を直接得たい場合は、Digest::Base.hexdigest を使うこともできます。

@see Digest::Base.hexdigest, Digest::Base#hexdigest...

FileUtils.#chmod(mode, list, options = {}) -> Array (6149.0)

ファイル list のパーミッションを mode に変更します。

...ruby]{
# Absolute mode
require
'fileutils'
FileUtils.chmod(0644, %w(my.rb your.rb his.rb her.rb))
FileUtils.chmod(0755, 'somecommand')
FileUtils.chmod(0755, '/usr/bin/ruby', verbose: true)
# Symbolic mode
require
'fileutils'
FileUtils.chmod("u=wr,go=rr", %w(my.rb your.rb his.rb her.rb))
FileUtils.ch...
...mod("u=wrx,go=rx", 'somecommand')
FileUtils.chmod("u=wrx,go=rx", '/usr/bin/ruby', verbose: true)
//}

symbolic mode では以下の指定を 操作対象 演算子 権限 の順番で指定します。

操作対象(複数指定可。省略した場合は a)。

* "a": 全て(所有者、グルー...

FileUtils.#chown_R(user, group, list, options = {}) -> Array (6137.0)

list 以下のファイルの所有ユーザと所有グループを user と group へ再帰的に変更します。

...して返します。

//emlist[][ruby]{
require
'fileutils'
FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true

require
'fileutils'
FileUtils.chown_R 'www', 'www', '/var/www/htdocs'
FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', ver...

絞り込み条件を変える

FileUtils.#chown(user, group, list, options = {}) -> Array (6131.0)

ファイル list の所有ユーザと所有グループを user と group に変更します。

...ptions :noop と :verbose が指定可能です。
c:FileUtils#options

@return list を配列として返します。


//emlist[][ruby]{
require
'fileutils'
FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
//}...

ERB::Util.#html_escape(s) -> String (6120.0)

文字列 s を HTML用にエスケープした文字列を返します。

... HTML用にエスケープした文字列を返します。

文字列 s 中に含まれる &"<> を、実体参照 &amp; &quot; &lt; &gt; にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。

@param s HTMLエスケープを行う文字列

//emlist[例][ruby...
...]{
require
"erb"
include ERB::Util

puts html_escape("is a > 0 & a < 10?")
# is a &gt; 0 &amp; a &lt; 10?
//}...

FileUtils.#chmod_R(mode, list, options = {}) -> Array (6119.0)

ファイル list のパーミッションを再帰的に mode へ変更します。

...変更します。

@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します(FileUtils.#chmod 参照)。

@param list ファイルのリストを指定します。対象のファイルが一つの場合は文字列でも指定可能です。...
...二つ以上指定する場合は配列で指定します。

@param options :noop と :verbose が指定可能です。
c:FileUtils#options

@return list を配列として返します。

//emlist[][ruby]{
require
'fileutils'
FileUtils.chmod_R(0700, '/tmp/removing')
//}...

FileUtils.#touch(list, options = {}) -> () (6119.0)

list で指定されたファイルの最終変更時刻 (mtime) と アクセス時刻 (atime) を変更します。

...場合は配列で指定します。

@param options :mtime, :nocreate, :noop, :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require
'fileutils'
FileUtils.touch('timestamp')
FileUtils.touch('timestamp', mtime: Time.now)
FileUtils.touch(Dir.glob('*.c'))
//}...
<< 1 2 3 ... > >>