175件ヒット
[1-100件を表示]
(0.141秒)
別のキーワード
クラス
- CSV (36)
- Dir (12)
- File (12)
-
File
:: Stat (12) - Object (12)
- Proc (7)
-
RubyVM
:: InstructionSequence (48) -
WIN32OLE
_ TYPE (12) -
Zlib
:: GzipWriter (24)
キーワード
- << (19)
-
absolute
_ path (12) -
add
_ row (12) -
base
_ label (12) - chardev? (12)
- close (12)
- finish (12)
- flock (12)
- helpfile (12)
- label (12)
- path (12)
- read (12)
-
respond
_ to? (12)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # base _ label -> String (32125.0) -
self が表す命令シーケンスの基本ラベルを返します。
...1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "he......lo, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::Instructio... -
RubyVM
:: InstructionSequence # label -> String (32125.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...rb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, wor......ld"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"
@see RubyVM::InstructionSequence#base_la... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (32119.0) -
self が表す命令シーケンスの絶対パスを返します。
...irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, wor......ld"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # path -> String (32119.0) -
self が表す命令シーケンスの相対パスを返します。
...irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, wor......ld"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see RubyVM::InstructionSequence#absolute_path... -
CSV
# puts(row) -> self (15256.0) -
自身に row を追加します。
...自身に row を追加します。
データソースは書き込み用にオープンされていなければなりません。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値......列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
CSV.open("test.csv", "a") do |csv|
csv.puts(["5", "saburo", "kondo", "34"])
end
print File.read("test.csv")
# => id,first name,last na......me,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CS... -
File
# flock(operation) -> 0 | false (9317.0) -
ファイルをロックします。
...クの取得に成功した場合は 0 を返します。
File::LOCK_NB (ノンブロッキング) を指定すると、本来ならブロックされる場合に
ブロックされずに false を返すようになります。
@param operation ロックに対する操作の種類を示す定数を......@raise IOError 自身が close されている場合に発生します。
@raise Errno::EXXX operation に不正な整数を与えた場合などに発生します。
引数 operation に有効な定数は以下の通りです。定数は File::Constants で定義されていますが、
File......クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::LOCK_SH などとして参照可能です。
: LOCK_SH
共有ロック。複数のプロセスが同時にロックを共有できます。
システムによってはロッ... -
File
:: Stat # chardev? -> bool (9125.0) -
キャラクタスペシャルファイルの時に真を返します。
...キャラクタスペシャルファイルの時に真を返します。
//emlist[][ruby]{
Dir.glob("/dev/*") {|bd|
if File::Stat.new(bd).chardev?
puts bd
end
}
#例
#...
#=> /dev/tty1
#=> /dev/stderr
#...
//}... -
WIN32OLE
_ TYPE # helpfile -> String | nil (6219.0) -
オブジェクトに関連付けられたヘルプファイルのフルパス名。
...@return オブジェクトに関連付けられたヘルプファイルのフルパス名を文字列で返します。
ヘルプファイルが未定義の場合はnilを返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Worksheet')
puts tobj.helpfile #......=> C:\...\VBAXL9.CHM
WIN32OLE.ole_show_help tobj.helpfile, tobj.helpcontext
# 注)WIN32OLE.ole_show_help(tobj) の呼び出しが望ましい
当メソッドがフルパス名を返しても、ヘルプファイルがインストールされてい
ない場合があることに注意して......ください。
また、返送値はOLEサーバの登録値をそのまま利用するため、Rubyのパス名形式
(ディレクトリ区切りは「/」)ではなく、Windowsのパス名形式(ディレクト
リ区切りは「\」)です。... -
Object
# respond _ to?(name , include _ all = false) -> bool (6203.0) -
オブジェクトがメソッド name を持つとき真を返します。
...きることをいいます。
Windows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発生する場合は false を返します。
※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライ......メソッドのみです。
Rubyで実装されたメソッドで NotImplementedError が発生する場合は true を返します。
メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Symbol または文字......です。
@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。省略した場合
は false(含めない) を指定した事になります。
//emlist[][ruby]{
class F
def...