462件ヒット
[1-100件を表示]
(0.223秒)
別のキーワード
ライブラリ
- abbrev (12)
- benchmark (60)
- bigdecimal (24)
-
bigdecimal
/ math (72) - cmath (78)
- digest (12)
- erb (24)
- fileutils (120)
- json (48)
- readline (12)
モジュール
キーワード
- E (12)
- PI (12)
- abbrev (12)
- atan (12)
- benchmark (12)
- bm (12)
- bmbm (12)
- cbrt (6)
- cbrt! (6)
- chdir (24)
- chmod (12)
-
chmod
_ R (12) - chown (12)
-
chown
_ R (12) - cos (12)
- cos! (6)
- exp (18)
- exp! (6)
- generate (12)
- hexencode (12)
-
html
_ escape (12) - log (24)
- log! (12)
- measure (12)
- mkpath (12)
-
pretty
_ generate (12) -
pretty
_ unparse (12) - readline (12)
- realtime (12)
-
remove
_ entry (12) - sin (12)
- sin! (6)
- sqrt (18)
- sqrt! (6)
- tan! (6)
- touch (12)
- unparse (12)
- uptodate? (12)
検索結果
先頭5件
-
ERB
:: Util . # h(s) -> String (21220.0) -
文字列 s を HTML用にエスケープした文字列を返します。
... HTML用にエスケープした文字列を返します。
文字列 s 中に含まれる &"<> を、実体参照 & " < > にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。
@param s HTMLエスケープを行う文字列
//emlist[例][ruby......]{
require "erb"
include ERB::Util
puts html_escape("is a > 0 & a < 10?")
# is a > 0 & a < 10?
//}... -
ERB
:: Util . # html _ escape(s) -> String (12220.0) -
文字列 s を HTML用にエスケープした文字列を返します。
... HTML用にエスケープした文字列を返します。
文字列 s 中に含まれる &"<> を、実体参照 & " < > にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。
@param s HTMLエスケープを行う文字列
//emlist[例][ruby......]{
require "erb"
include ERB::Util
puts html_escape("is a > 0 & a < 10?")
# is a > 0 & a < 10?
//}... -
FileUtils
. # touch(list , options = {}) -> () (12219.0) -
list で指定されたファイルの最終変更時刻 (mtime) と アクセス時刻 (atime) を変更します。
...list で指定されたファイルの最終変更時刻 (mtime) と
アクセス時刻 (atime) を変更します。
list で指定されたファイルが存在しない場合は空のファイルを作成します。
@param list 対象のファイル。一つの場合は文字列も指定可......場合は配列で指定します。
@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'))
//}... -
Digest
. # hexencode(string) -> String (9367.0) -
引数である文字列 string を、16進数に変換した文字列を生成して返します。
...文字列 string を、16進数に変換した文字列を生成して返します。
@param string 文字列を指定します。
//emlist[][ruby]{
require 'digest'
p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Digest.hexencode("......p digest = Digest::MD5.digest("ruby") # => "X\xE5=\x13$\xEE\xF6&_\xDB\x97\xB0\x8E\xD9\xAA\xDF"
p Digest.hexencode(digest) # => "58e53d1324eef6265fdb97b08ed9aadf"
p Digest::MD5.hexdigest("ruby") # => "58e53d1324eef6265fdb97b08ed9aadf"
p digest = Digest::SHA1.digest("ruby") #......1"
p Digest.hexencode(digest) # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
p Digest::SHA1.hexdigest("ruby") # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
//}
文字列から16進数に変換したハッシュ値を直接得たい場合は、Digest::Base.hexdigest を使... -
Benchmark
. # benchmark(caption = "" , label _ width = nil , fmtstr = nil , *labels) {|rep| . . . } -> [Benchmark :: Tms] (9325.0) -
Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。
...Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。
基本的には以下のように使います。
ブロックが Benchmark::Tms オブジェクトの配列を返した場合は、
それらの数値も追加の行に表示......。
@param caption レポートの一行目に表示する文字列を指定します。
@param label_width ラベルの幅を指定します。
@param fmtstr フォーマット文字列を指定します。
この引数を省略すると Benchmark::FORMAT が使用さ......ックが Benchmark::Tms オブジェクトの配列を返す場合に指定します。
=== フォーマット文字列
フォーマット文字列として以下が使用できます。
: %u
user CPU time で置き換えられます。Benchmark::Tms#utime
: %y
system CPU time で置き換... -
FileUtils
. # chmod(mode , list , options = {}) -> Array (9255.0) -
ファイル list のパーミッションを mode に変更します。
...ファイル list のパーミッションを mode に変更します。
@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します。
@param list ファイルのリストを指定します。 対象のファイルが一つの場合は文......m options :noop と :verbose が指定可能です。
c:FileUtils#options
@return list を配列として返します。
//emlist[][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.chmod("u=wrx,go=rx", 'somecommand')
FileUtils.chmod("u=wrx,go=rx", '/usr/bin/ruby', verbose: true)
//}
symbolic mode では以下の指定を 操作対... -
FileUtils
. # mkpath(list , options = {}) -> Array (9243.0) -
ディレクトリ dir とその親ディレクトリを全て作成します。
...します。
例えば、
//emlist[][ruby]{
require 'fileutils'
FileUtils.mkdir_p('/usr/local/lib/ruby')
//}
は以下の全ディレクトリを (なければ) 作成します。
* /usr
* /usr/local
* /usr/local/bin
* /usr/local/bin/ruby
@param list 作成するディレクトリ。一......つの場合は文字列でも指定できます。
二つ以上指定する場合は配列で指定します。
@param options :mode, :noop, :verbose が指定できます。
c:FileUtils#options
@return ディレクトリ名文字列の配列を返します。... -
FileUtils
. # chown _ R(user , group , list , options = {}) -> Array (9237.0) -
list 以下のファイルの所有ユーザと所有グループを user と group へ再帰的に変更します。
...list 以下のファイルの所有ユーザと所有グループを
user と group へ再帰的に変更します。
user, group に nil または -1 を渡すとその項目は変更しません。
@param user ユーザー名か uid を指定します。nil/-1 を指定すると変更しませ......st ファイルのリストを指定します。対象のファイルが一つの場合は文字列でも指定可能です。
二つ以上指定する場合は配列で指定します。
@param options :noop と :verbose が指定可能です。
c:FileUtils#options
@retu......rn list を配列として返します。
//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', 'c... -
FileUtils
. # chown(user , group , list , options = {}) -> Array (9231.0) -
ファイル list の所有ユーザと所有グループを user と group に変更します。
...ファイル list の所有ユーザと所有グループを user と group に変更します。
user, group に nil または -1 を渡すとその項目は変更しません。
@param user ユーザー名か uid を指定します。nil/-1 を指定すると変更しません。
@param group......st ファイルのリストを指定します。対象のファイルが一つの場合は文字列でも指定可能です。
二つ以上指定する場合は配列で指定します。
@param options :noop と :verbose が指定可能です。
c:FileUtils#options
@retu......rn list を配列として返します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
//}...