るりまサーチ

最速Rubyリファレンスマニュアル検索!
3233件ヒット [1-100件を表示] (0.027秒)
トップページ > クエリ:sh[x] > クエリ:ruby[x]

別のキーワード

  1. rake sh
  2. fileutils sh
  3. constants lock_sh
  4. _builtin lock_sh
  5. sync sh

ライブラリ

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

shell (26176.0)

Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。

...Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。

sh
/csh の制御文は Ruby の機能を用いて実現します。

=== サンプル

==== Example 1:

require 'shell'
sh
= Shell.cd("/tmp")
sh
.mkdir "shell-test...
...-1" unless sh.exists?("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"...

FileUtils#ruby(*args) {|result, status| ... } (18135.0)

与えられた引数で Ruby インタプリタを実行します。

...与えられた引数で Ruby インタプリタを実行します。

@param args Ruby インタプリタに与える引数を指定します。

例:
ruby
%{-pe '$_.upcase!' <README}

@see Kernel.#sh...

Hash.ruby2_keywords_hash?(hash) -> bool (15391.0)

Module#ruby2_keywordsやProc#ruby2_keywordsによる ruby2_keywords フラグが設定されているかどうかを返します。

...Module#ruby2_keywordsやProc#ruby2_keywordsによる
ruby
2_keywords フラグが設定されているかどうかを返します。

このメソッドはデバッグや調査、シリアライゼーションのために本当に必要な場合のために
用意されていて、普通のプログ...
...れていません。

ruby
2.7.1 で追加されたため、ruby 2.7.0 では定義されていません。

//emlist[][ruby]{
ruby
2_keywords def foo(*args)
Hash.ruby2_keywords_hash?(args.last)
end
foo(k: 1) # => true
foo({k: 1}) # => false
//}

@see Module#ruby2_keywords, Proc#ruby2_keywords...

rubygems/digest/sha1 (12000.0)

Digest::SHA1 をラップするためのライブラリです。

...Digest::SHA1 をラップするためのライブラリです。...

rubygems/digest/sha2 (12000.0)

Digest::SHA256 をラップするためのライブラリです。

...Digest::SHA256 をラップするためのライブラリです。...

絞り込み条件を変える

Hash#shift -> [object, object] | nil (9112.0)

ハッシュからキーが追加された順で先頭の要素をひとつ取り除き、 [key, value]という配列として返します。

...ue]という配列として返します。

sh
iftは破壊的メソッドです。selfは要素を取り除かれた残りのハッシュに変更されます。

Ruby
3.2以前は、ハッシュが空の場合、デフォルト値(Hash#defaultまたはHash#default_procのブロックの値か、...
...

//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}
p h.shift #=> [:ab, "some"]
p h.shift #=> [:cd, "all"]
p h #=> {}
p h.shift #=> nil

h1 = Hash.new("default value")
p h1 #=> {}
p h1.shift #=> "d...
...efault value"

h2 = Hash.new {|*arg| arg}
p h2 #=> {}
p h2.shift #=> [{}, nil]
//}


@see Array#shift...

Hash#hash -> Integer (9106.0)

自身が保持するキーと値のハッシュ値を元にして算出した整数を返します。 自身が保持するキーや値が変化すればこのメソッドが返す値も変化します。

...自身が保持するキーと値のハッシュ値を元にして算出した整数を返します。
自身が保持するキーや値が変化すればこのメソッドが返す値も変化します。

//emlist[例][ruby]{
a = {}
p a.hash #=> 0
a[1] = :x
p a.hash #=> 329543
//}...

Hash#rehash -> self (9106.0)

キーのハッシュ値を再計算します。

...raise RuntimeError Hash#eachなどのイテレータの評価途中でrehashすると発生します。
@return selfを返します。

//emlist[例][ruby]{
a = [ "a", "b" ]
h = { a => 100 }

p h[a] #=> 100

a[0] = "z"
p h[a] #=> nil

h.rehash
p h[a] #=> 100
//}

@see Object#hash...

Hash#shift -> [object, object] | nil (9106.0)

ハッシュからキーが追加された順で先頭の要素をひとつ取り除き、 [key, value]という配列として返します。

...します。

sh
iftは破壊的メソッドです。selfは要素を取り除かれた残りのハッシュに変更されます。


ハッシュが空の場合、デフォルト値に関わらず nil を返します。

//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}
p h.shift...
...> [:ab, "some"]
p h.shift #=> [:cd, "all"]
p h #=> {}
p h.shift #=> nil

h1 = Hash.new("default value")
p h1 #=> {}
p h1.shift #=> nil

h2 = Hash.new {|*arg| arg}
p h2 #=> {}
p h2.shift #=...
...> nil
//}


@see Array#shift...

Hash#to_hash -> self (9106.0)

self を返します。

...self を返します。

//emlist[例][ruby]{
hash = {}
p hash.to_hash # => {}
p hash.to_hash == hash # => true
//}

@see Object#to_hash, Hash#to_h...

絞り込み条件を変える

Rubyの起動 (6291.0)

Rubyの起動 * cmd_option * shebang

...Rubyの起動
* cmd_option
* shebang

Ruby
インタプリタの起動は以下の書式のコマンドラインにより行います。

ruby
[ option ...] [ -- ] [ programfile ] [ argument ...]

ここで、option は後述のcmd_option
のいずれかを指定します。-- は、オプシ...
...Ruby スクリプトを記述したファイ
ルです。これを省略したり`-' を指定した場合には標準入力を Ruby
クリプトとみなします。

programfile が `#!' で始まるファイルである場合、特殊な解釈
が行われます。詳細は後述のshebang...
...Object::ARGV の初
期値として設定されます。標準のシェルがワイルドカードを展開しない環境
(platform/Win32)では、Ruby インタプリタが自前でワイルドカードを展開して
Object::ARGV に設定します。この場合ワイルドカードとして
`*'...
<< 1 2 3 ... > >>