944件ヒット
[1-100件を表示]
(0.111秒)
ライブラリ
- ビルトイン (297)
- csv (44)
-
irb
/ cmd / load (22) -
json
/ add / exception (11) -
net
/ ftp (18) -
net
/ http (176) - optparse (22)
- pathname (44)
- rake (55)
-
rake
/ packagetask (11) - shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) - tempfile (22)
クラス
- CSV (44)
- Dir (132)
- Exception (22)
- File (11)
- IO (22)
-
IRB
:: ExtendCommand :: Load (11) -
IRB
:: ExtendCommand :: Source (11) - LoadError (11)
-
Net
:: FTP (18) -
Net
:: HTTP (143) -
Net
:: HTTPGenericRequest (22) -
Net
:: HTTPResponse (11) - OptionParser (22)
- Pathname (44)
-
Rake
:: Application (11) -
Rake
:: FileList (11) -
Rake
:: PackageTask (11) -
RubyVM
:: InstructionSequence (22) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - Tempfile (22)
-
Thread
:: Backtrace :: Location (33) - TracePoint (22)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) - Options (11)
- Rubyの起動 (11)
- Ruby用語集 (11)
-
absolute
_ path (22) - application (11)
- application= (11)
- ascend (11)
-
body
_ stream (11) -
body
_ stream= (11) -
caller
_ locations (22) - cgi (11)
- chdir (44)
- create (22)
- descend (11)
- execute (22)
- fdatasync (11)
- find (11)
- flush (11)
- get (22)
- get2 (22)
- inspect (22)
- irb (11)
- logger (11)
- mkdir (18)
- mlsd (18)
- new (22)
- open (88)
- opendir (22)
-
original
_ dir (22) -
package
_ dir _ path (11) - pathmap (11)
- post (22)
- post2 (22)
-
program
_ name (11) -
program
_ name= (11) - rdoc (11)
-
rdoc
/ generator / json _ index (11) -
read
_ body (11) -
request
_ get (22) -
request
_ post (22) -
require
_ relative (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
send
_ request (11) -
set
_ backtrace (11) -
test
/ unit (1) -
to
_ json (11) -
to
_ path (11) -
to
_ s (11) -
webrick
/ cgi (11) - セキュリティモデル (11)
- 変数と定数 (11)
検索結果
先頭5件
-
irb (26192.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......$ irb
irb(main):001:0>
あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。
irb(main):001:0> 1+2
3
irb(main):002:0> class Foo
irb(main):003:1> def foo
irb(main):004:2> print 1
irb(main):005:2> end
irb(main):006:1> end......サブ irb を停止します。
n は以下のいずれかの値で指定します。
//emlist{
* irb インタプリタ番号
* irb オブジェクト
* スレッド ID
* 各インタプリタの self (「irb(obj)」で起動した時の obj)
//}
: source(path)
: irb_source(path)... -
File
. path(filename) -> String (21295.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
...filename が文字列でない場合は、to_path メソッドを呼びます。
@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
class MyPath
def initialize(path)
@path......= path
end
def to_path
File.absolute_path(@path)
end
end
File.path("/dev/null") # => "/dev/null"
File.path(Pathname("/tmp")) # => "/tmp"
File.path(MyPath.new(".")) # => "/Users/user/projects/txt"
//}... -
RubyVM
:: InstructionSequence # path -> String (21225.0) -
self が表す命令シーケンスの相対パスを返します。
...いた
場合は "<compiled>" を返します。
例1: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, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see RubyVM::InstructionSequence#absolute_path... -
TracePoint
# path -> String (21225.0) -
イベントが発生したファイルのパスを返します。
...トが発生したファイルのパスを返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
trace.enable
foo 1
//}... -
Dir
# path -> String (21220.0) -
オープンしているディレクトリのパス名を文字列で返します。
...オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}... -
LoadError
# path -> String | nil (18213.0) -
Kernel.#require や Kernel.#load に失敗したパスを返します。
...Kernel.#require や Kernel.#load に失敗したパスを返します。
begin
require 'this/file/does/not/exist'
rescue LoadError => e
e.path # => 'this/file/does/not/exist'
end
パスが定まらない場合は nil を返します。... -
Pathname
# opendir -> Dir (15300.0) -
Dir.open(self.to_s, &block) と同じです。
...Dir.open(self.to_s, &block) と同じです。
@see Dir.open... -
Pathname
# opendir {|dir| . . . } -> nil (15300.0) -
Dir.open(self.to_s, &block) と同じです。
...Dir.open(self.to_s, &block) と同じです。
@see Dir.open... -
Rake
:: PackageTask # package _ dir _ path -> String (12213.0) -
パッケージに含むファイルを配置するディレクトリを返します。
...パッケージに含むファイルを配置するディレクトリを返します。
//emlist[][ruby]{
# Rakefile での記載例とする
require 'rake/packagetask'
Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.package_dir_path # => "pkg/sample-1.0.0"
end
//}... -
Pathname
# ascend {|pathname| . . . } -> nil (9360.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
... Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/to/......some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>
Pathname.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
# #<Pathname:path/to/some>
# #<Pathname:path/to>
# #<Pathname:path>
//}
ファイル...