るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

モジュール

キーワード

検索結果

<< < ... 2 3 4 >>

Shell::Filter#foreach(path = nil, &block) -> () (23.0)

pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。

...pathがファイルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。

@param path ファイルもしくはディレクトリのパスを文字列で指定します。

使用例
require
'shell'
Shell.verbose = false
sh = Shell.new
sh.foreach("/tmp"){|...

Pathname#entries -> [Pathname] (19.0)

self に含まれるファイルエントリ名を元にした Pathname オブジェクトの配列を返します。

...rrno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。

//emlist[例][ruby]{
require
'pathname'
require
'pp'

pp Pathname('/usr/local').entries
# => [#<Pathname:.>,
# #<Pathname:..>,
# #<Pathname:bin>,
# #<Pathname:etc>,
#...
...#<Pathname:include>,
# #<Pathname:lib>,
# #<Pathname:opt>,
# #<Pathname:sbin>,
# #<Pathname:share>,
# #<Pathname:var>]
//}

@see Dir.entries...

Shell#glob(pattern) -> Shell::Filter (19.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Dir.[] を参照してください。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}

@see Dir.[]...

Shell::CommandProcessor#glob(pattern) -> Shell::Filter (19.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Dir.[] を参照してください。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}

@see Dir.[]...

Shell::Filter#glob(pattern) -> Shell::Filter (19.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Dir.[] を参照してください。

動作例
require
'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}

@see Dir.[]...

絞り込み条件を変える

Class#json_creatable? -> bool (13.0)

シリアライズされた JSON 形式の文字列から、インスタンスを作成するのにこのクラスを使用できる場合は 真を返します。そうでない場合は、偽を返します。

...json_create というメソッドを実装していなければなりません。
また json_create の第一引数は必要なデータを含むハッシュを期待しています。

//emlist[例][ruby]{
require
"json"

String.json_creatable? # => true
Dir
.json_creatable? # => false
//}...

Pathname#fnmatch(pattern, *args) -> bool (13.0)

File.fnmatch(pattern, self.to_s, *args) と同じです。

...ードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。

@param args File.fnmatch を参照してください。

//emlist[例][ruby]{
require
"pathname"

path = Pathname("testfile")
path.fnmatch("test*")...

Shell#cwd -> String (8.0)

カレントディレクトリのパスを文字列で返します。

...カレントディレクトリのパスを文字列で返します。

使用例
require
'shell'
sh = Shell.new
p sh.cwd
# 例
#=> "/Users/kouya/tall"...

Shell#getwd -> String (8.0)

カレントディレクトリのパスを文字列で返します。

...カレントディレクトリのパスを文字列で返します。

使用例
require
'shell'
sh = Shell.new
p sh.cwd
# 例
#=> "/Users/kouya/tall"...

Shell#pwd -> String (8.0)

カレントディレクトリのパスを文字列で返します。

...カレントディレクトリのパスを文字列で返します。

使用例
require
'shell'
sh = Shell.new
p sh.cwd
# 例
#=> "/Users/kouya/tall"...

絞り込み条件を変える

<< < ... 2 3 4 >>