別のキーワード
種類
- インスタンスメソッド (73)
- 文書 (33)
- 特異メソッド (11)
モジュール
-
Rake
:: TaskManager (11)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
create
_ rule (11) - get (22)
- mlsd (18)
- pathmap (11)
-
ruby 1
. 8 . 3 feature (11) -
sub
_ ext (11)
検索結果
先頭5件
-
File
. path(filename) -> String (18183.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
...は、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"
//}... -
String
# pathmap(spec = nil) { . . . } -> String (6136.0) -
与えられた書式指定文字列に応じてパス(自身)を変換します。
...ト自身を表します。
%d は数値のプレフィクスを取ることができます。
例:
'a/b/c/d/file.txt'.pathmap("%2d") # => 'a/b'
'a/b/c/d/file.txt'.pathmap("%-2d") # => 'c/d'
また、%d, %p, %f, %n, %x, %X には単純な文字列置換を行うための
置換パター......".pathmap("%{^src,bin}X.class")
#=> "bin/org/onestepback/proj/A.class"
置換文字列に '*' を指定した場合は、置換文字列を計算するためにブロックを評価します。
例:
"/path/to/file.TXT".pathmap("%X%{.*,*}x") { |ext| ext.downcase }
#=> "/path/to/file.txt"... -
Pathname
# sub _ ext(replace) -> Pathname (3106.0) -
拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。
...で置き換えた Pathname オブジェクトを返します。
自身が拡張子を持たない場合は、与えられた文字列を拡張子として付加します。
@param replace 拡張子を文字列で指定します。
//emlist[例][ruby]{
require "pathname"
Pathname('/usr/bin/shutd......#<Pathname:/usr/bin/shutdown.rb>
Pathname('/home/user/test.txt').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test.').sub_ext('.pdf') # => #<Pathname:/home/user/test..pdf>
Pathn......ame('/home/user/.test').sub_ext('.pdf') # => #<Pathname:/home/user/.test.pdf>
Pathname('/home/user/test.tar.gz').sub_ext('.xz') # => #<Pathname:/home/user/test.tar.xz>
//}... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (130.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......さい。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定し.......html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: HTTP # get(path , header = nil , dest = nil) {|body _ segment| . . . . } -> Net :: HTTPResponse (130.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。
header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という......さい。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。
@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定し.......html' )
# net/http version 1.2
response = http.get('/index.html')
# compatible in both version
response , = http.get('/index.html')
response.body
# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}
@see Net::HTTP#request_get... -
Net
:: FTP # mlsd(pathname = nil) -> [Net :: FTP :: MLSxEntry] (106.0) -
pathname で指定したディレクトリに含まれているファイルの詳細な情報を得ます。
...
pathname で指定したディレクトリに含まれているファイルの詳細な情報を得ます。
ディレクトリの各ファイルの情報が
Net::FTP::MLSxEntry のオブジェクトの配列として得られます。
どのような情報を取り出せるかは Net::FTP::MLSxEn......当に解釈する必要がありますが、
このコマンドの結果は適切に解釈された結果を直接得ることができます。
pathname を省略した場合はカレントディレクトリを指定したことになります。
ブロックを渡した場合にはディレク......# @facts=
# {"modify"=>2004-12-22 08:56:36 UTC,
# "perm"=>"adfr",
# "size"=>1128,
# "type"=>"file",
# "unique"=>"801U1FEF97",
# "unix.group"=>0,
# "unix.mode"=>420,
# "unix.owner"=>106},
# @pathname="README.txt">,
# :
# ]
end... -
Net
:: FTP # mlsd(pathname = nil) {|entry| . . . } -> () (106.0) -
pathname で指定したディレクトリに含まれているファイルの詳細な情報を得ます。
...
pathname で指定したディレクトリに含まれているファイルの詳細な情報を得ます。
ディレクトリの各ファイルの情報が
Net::FTP::MLSxEntry のオブジェクトの配列として得られます。
どのような情報を取り出せるかは Net::FTP::MLSxEn......当に解釈する必要がありますが、
このコマンドの結果は適切に解釈された結果を直接得ることができます。
pathname を省略した場合はカレントディレクトリを指定したことになります。
ブロックを渡した場合にはディレク......# @facts=
# {"modify"=>2004-12-22 08:56:36 UTC,
# "perm"=>"adfr",
# "size"=>1128,
# "type"=>"file",
# "unique"=>"801U1FEF97",
# "unix.group"=>0,
# "unix.mode"=>420,
# "unix.owner"=>106},
# @pathname="README.txt">,
# :
# ]
end... -
NEWS for Ruby 2
. 0 . 0 (24.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ect は #to_s を呼び出さなくなりました。再定義された #to_s を呼び出すためです。
* LoadError
* 追加: LoadError#path ロードできなかったファイルのパスを返します
* Module
* 追加: Module#prepend 指定したモジュールを self の継......uctionSequence.of to get the instruction sequence
from a method or a block.
* 追加: RubyVM::InstructionSequence#path,
RubyVM::InstructionSequence#absolute_path,
RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#base_label,
RubyVM::InstructionSequence#......* `gem server` はHTMLを生成するために RDoc::Servlet を使います。
* https://github.com/rubygems/rubygems/blob/master/History.txt
* shellwords
* Shellwords#shellescape 与えられたオブジェクトを to_s で文字列化するようになりました
* Shellwor... -
Rake
:: TaskManager # create _ rule(*args) { . . . } (18.0) -
与えられたパラメータに従ってルールを作成します。
...に与えるパラメータを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
rule = Rake.application.create_rule '.txt' => '.md' do |t|
"#{t}"
end
p rule # => 0x0000558dd2e32d20 /path/to/Rakefile:5>
end
//}... -
ruby 1
. 8 . 3 feature (18.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...-e:1:in `join': can't convert Fixnum into String (TypeError)
from -e:1
=== 2005-09-16
: File.extname [ruby] [compat]
与えられた pathname がピリオドで終る場合、ピリオドではなく空の文字列を返すようになりました。
$ ruby-1.8.2 -e 'p File.extn......そちらを優先して使うようになりました。
((<ruby-dev:26235>))
=== 2005-05-27
: mkmf [lib] [bug]
MSYS 環境下において、PATHの区切り値にセミコロンを使うよう修正しました。((<ruby-dev:26232>))
=== 2005-05-24
: getopts [lib] [obsolete]
getopts が de......c_authentication})) オプションの追加
((<ruby-core:4416>))
: OpenSSL::X509::Store#set_default_paths [lib][new]
追加 ((<ruby-dev:25670>))
=== 2005-02-06
: Resolv::DNS::Resource::TXT#strings [lib] [new]
: Resolv::DNS::Message::MessageEncoder#put_string_list [lib] [new]
: Resolv::DNS::M...