114件ヒット
[1-100件を表示]
(0.021秒)
別のキーワード
種類
- インスタンスメソッド (72)
- モジュール関数 (24)
- 特異メソッド (12)
- 文書 (6)
クラス
- File (12)
- Pathname (12)
-
RubyVM
:: InstructionSequence (12) -
URI
:: Generic (48)
モジュール
- FileUtils (24)
キーワード
- - (12)
-
NEWS for Ruby 2
. 7 . 0 (6) - absolute? (24)
- chmod (12)
-
chmod
_ R (12) - path (12)
-
route
_ from (12) -
to
_ a (12)
検索結果
先頭5件
-
URI
:: Generic # absolute -> bool (18120.0) -
自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
...自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
例:
require 'uri'
p URI.parse('http://example.com/').absolute? #=> true
p URI.parse('./').absolute? #=> false... -
URI
:: Generic # absolute? -> bool (6120.0) -
自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
...自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
例:
require 'uri'
p URI.parse('http://example.com/').absolute? #=> true
p URI.parse('./').absolute? #=> false... -
Pathname
# absolute? -> bool (6119.0) -
self が絶対パス指定であれば真を返します。
...self が絶対パス指定であれば真を返します。
//emlist[例][ruby]{
require "pathname"
pathname = Pathname("/path/to/example.rb")
pathname.absolute? # => true
pathname = Pathname("../")
pathname.absolute? # => false
//}... -
FileUtils
. # chmod(mode , list , options = {}) -> Array (24.0) -
ファイル list のパーミッションを mode に変更します。
...ファイル list のパーミッションを mode に変更します。
@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します。
@param list ファイルのリストを指定します。 対象のファイルが一つの場合は文......列として返します。
//emlist[][ruby]{
# Absolute mode
require 'fileutils'
FileUtils.chmod(0644, %w(my.rb your.rb his.rb her.rb))
FileUtils.chmod(0755, 'somecommand')
FileUtils.chmod(0755, '/usr/bin/ruby', verbose: true)
# Symbolic mode
require 'fileutils'
FileUtils.chmod("u=wr,go=rr", %w(my... -
NEWS for Ruby 2
. 7 . 0 (18.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...以前のlazyではないEnumerator#with_indexのデフォルト実装から
lazyになりました。7877
//emlist[Enumerator.produce][ruby]{
require "date"
dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates
dates.detect(&:tuesday?) #=> next Tuesday
//}
//emlist[Enume......を発生させます。 10344
* File
* 新規メソッド
* パスが絶対パスかどうかをポータブルに判定するFile.absolute_path?メソッドが追加されました。 15868
* 変更されたメソッド
* Windows以外のプラットフォームでFile.extna......ionParser
* 不明なオプションに対して "Did you mean?" が表示されるようになりました。 16256
//emlist[test.rb][ruby]{
require "optparse"
OptionParser.new do |opts|
opts.on("-f", "--foo", "foo") {|v| }
opts.on("-b", "--bar", "bar") {|v| }
opts.on("-c", "--baz", "baz... -
File
. path(filename) -> String (12.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
...ath メソッドが定義されたオブジェクトを指定します。
//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("/... -
FileUtils
. # chmod _ R(mode , list , options = {}) -> Array (12.0) -
ファイル list のパーミッションを再帰的に mode へ変更します。
...ファイル list のパーミッションを再帰的に mode へ変更します。
@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します(FileUtils.#chmod 参照)。
@param list ファイルのリストを指定します。対象の......二つ以上指定する場合は配列で指定します。
@param options :noop と :verbose が指定可能です。
c:FileUtils#options
@return list を配列として返します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.chmod_R(0700, '/tmp/removing')
//}... -
RubyVM
:: InstructionSequence # to _ a -> Array (12.0) -
self の情報を 14 要素の配列にして返します。
...た場合は
"<compiled>"。
: #path
命令シーケンスの相対パス。文字列から作成していた場合は "<compiled>"。
: #absolute_path
命令シーケンスの絶対パス。文字列から作成していた場合は nil。
: #first_lineno
命令シーケンスの 1......配列。
: args
引数の指定が必須のメソッド、ブロックの引数の個数。あるいは以下のよう
な配列。
[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]
より詳細な情報につい......break など)の一覧。
: bytecode
命令シーケンスを構成する命令とオペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/Si... -
URI
:: Generic # -(src) -> URI :: Generic (12.0) -
与えられた URI を表す src からの相対パスを返します。
...す src からの相対パスを返します。
@param src 自身の相対パスを算出するための、ルートとなる Absolute URI を与えます。
例:
require 'uri'
p URI.parse('http://example.com/foo/bar.html') - 'http://example.com/'
#=> #<URI::Generic:0x20100256 URL:foo/bar.ht...