287件ヒット
[1-100件を表示]
(0.019秒)
種類
- 特異メソッド (144)
- インスタンスメソッド (133)
- ライブラリ (6)
- 文書 (4)
ライブラリ
- ビルトイン (60)
- csv (120)
- json (12)
-
minitest
/ unit (1) - rake (24)
-
rubygems
/ source _ info _ cache (12) -
rubygems
/ spec _ fetcher (12) - shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12)
クラス
- CSV (120)
-
Gem
:: SourceInfoCache (12) -
Gem
:: SpecFetcher (12) - IO (24)
-
MiniTest
:: Unit (1) -
Rake
:: TaskArguments (24) - Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - String (12)
モジュール
- GC (12)
-
JSON
:: Generator :: GeneratorMethods :: String (12)
オブジェクト
- ENV (12)
キーワード
- Rubyの起動 (4)
- [] (18)
- closed? (12)
- filter (36)
- flush (12)
- hash (12)
-
latest
_ cache _ data (12) -
latest
_ gc _ info (12) -
latest
_ specs (12) - new (12)
- open (48)
-
process
_ args (1) - read (12)
- readlines (12)
- reject (12)
- shell (6)
-
to
_ hash (12) -
to
_ json (12) -
with
_ defaults (12)
検索結果
先頭5件
-
shell (26202.0)
-
Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。
...上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。
sh/csh の制御文は Ruby の機能を用いて実現します。
=== サンプル
==== Example 1:
require 'shell'
sh = Shell.cd("/tmp")
sh.mkdir "shell-test-1" u......shell-test-1")
sh.cd("shell-test-1")
for dir in ["dir1", "dir3", "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" unless exists?("shell-test-1")
cd("shell-test-1")
for dir in ["dir1", "dir3", "dir5"]
if !exists?(dir)
mkdir dir
cd(dir) do
f = open("tmpFile", "w")
f.print "TEST\n"
f.close... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (18171.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: CommandProcessor # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (18171.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (18171.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
GC
. latest _ gc _ info(result _ hash = {}) -> Hash (6300.0) -
最新のGCの情報を返します。
...最新のGCの情報を返します。
@param result_hash 戻り値のためのハッシュを指定します。省略した場合は新
しくハッシュを作成します。result_hash の内容は上書き
されます。
@param key 得られる情報か......す。
//emlist[例][ruby]{
latest = GC.latest_gc_info
latest # => {:major_by=>nil, :gc_by=>:newobj, :have_finalizer=>false, :immediate_sweep=>false, :state=>:sweeping}
stat = GC.stat
merged = GC.latest_gc_info(stat)
merged == latest.merge(stat) # => true
GC.latest_gc_info(:gc_by) # => :newobj... -
Rake
:: TaskArguments # to _ hash -> Hash (6212.0) -
パラメータ名と対応する値を格納したハッシュを返します。
...納したハッシュを返します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments.to_hash # => {:name1=>"value1", :name2=>"value2"}
end
//}... -
Gem
:: SourceInfoCache # latest _ cache _ data -> Hash (6200.0) -
最新のキャッシュデータを返します。
最新のキャッシュデータを返します。 -
Gem
:: SpecFetcher # latest _ specs -> Hash (6200.0) -
キャッシュされている最新の gemspec を返します。
キャッシュされている最新の gemspec を返します。 -
IO
# flush -> self (6112.0) -
IO ポートの内部バッファをフラッシュします。
...ープンされていなければ発生します。
@raise Errno::EXXX fflush(3) が失敗した場合に発生します。
//emlist[例][ruby]{
require "tempfile"
Tempfile.open("testtmpfile") do |f|
f.print "test"
File.read(f.path) # => ""
f.flush
File.read(f.path) # => "test"
end
//}... -
String
# hash -> Integer (6112.0) -
self のハッシュ値を返します。 eql? で等しい文字列は、常にハッシュ値も等しくなります。
...self のハッシュ値を返します。
eql? で等しい文字列は、常にハッシュ値も等しくなります。
//emlist[例][ruby]{
"test".hash # => 4038258770210371295
("te" + "st").hash == "test".hash # => true
//}
@see Hash... -
MiniTest
:: Unit # process _ args(args = []) -> Hash (3100.0) -
optparse を使ってコマンドライン引数を解析した結果を返します。
optparse を使ってコマンドライン引数を解析した結果を返します。
@param args コマンドライン引数を指定します。
@see optparse -
Shell
# [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (3071.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest...