るりまサーチ

最速Rubyリファレンスマニュアル検索!
495件ヒット [401-495件を表示] (0.052秒)
トップページ > クエリ:IO[x] > クエリ:io[x] > クエリ:last[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io readlines
  5. io each_line

検索結果

<< < ... 3 4 5 >>

Open3.#pipeline_r(*cmds) -> [IO, [Thread]] (203.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最後の コマンドの標準出力を受けとる事ができます。

...options には Hash で指定します。
env には環境変数を Hash で指定します。
cmdname にはコマンド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。

(1) commandline
(2) [commandline, options]...
...(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]

@return ブロックを指定した場合はブロックの最後に評価された値を返します。
ブロックを指定しなかった場合は最後に実...

NEWS for Ruby 3.0.0 (150.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs...
...by]{
pr = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ......
...`in` is changed to return `true` or `false`. 17371

//emlist{
0 => a
p a #=> 0

{b: 0, c: 1} => {b:}
p b #=> 0
//}

//emlist{
# version 3.0
0 in 1 #=> false

# version 2.7
0 in 1 #=> raise NoMatchingPatternError
//}

* Find-pattern is added. [EXPERIMENTAL]
16828

//emlist{
case ["a", 1, "b",...

ruby 1.6 feature (138.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) ->...
...元に戻りました。

p "#{ "" }"

=> ruby 1.6.7 (2002-03-01) [i586-linux]
""

=> -:1: warning: bad substitution in string
ruby 1.6.7 (2002-09-12) [i586-linux]
"#{ }"

=> ruby 1.6.7 (2002-09-25) [i586-linux]
""

...
...-03-01) [i586-linux]
true
=> ruby 1.6.7 (2002-08-21) [i586-linux]
false

# : 2002-08-01 IO#read, gets ..., etc.
#
# File::NONBLOCK を指定した IO の読み込みで EWOULDBLOCK が発生すると、
# 途中まで読んだデータが失われることがあ...

Open3.#pipeline_rw(*cmds) {|first_stdin, last_stdout, wait_thrs| ... } -> () (105.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。

...options には Hash で指定します。
env には環境変数を Hash で指定します。
cmdname にはコマンド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。

(1) commandline
(2) [commandline, options]...
...(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]

@return ブロックを指定した場合はブロックの最後に評価された値を返します。
ブロックを指定しなかった場合は最初に実...

Open3.#pipeline_r(*cmds) {|last_stdout, wait_thrs| ... } -> () (103.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最後の コマンドの標準出力を受けとる事ができます。

...options には Hash で指定します。
env には環境変数を Hash で指定します。
cmdname にはコマンド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。

(1) commandline
(2) [commandline, options]...
...(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]

@return ブロックを指定した場合はブロックの最後に評価された値を返します。
ブロックを指定しなかった場合は最後に実...

絞り込み条件を変える

NEWS for Ruby 2.5.0 (78.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...非推奨になりました。C拡張のベースクラスでしたが、Rubyレベルに公開するのをやめました。3072

* Exception
* Exception#full_message を追加 14141 [実験的]
例外の文字列表現を取得します。その文字列は捕捉されない例外をRu...
...ンを指定するとテキストモードになります 13350
* File#path はFile::Constants::TMPFILE付きで開いたファイルに対して IOError を発生させます
13568
* File.stat, File.exist? など rb_stat() を使用しているメソッドではGVLを解放するよ...
...追加 8499

* IO
* IO.copy_stream は copy_file_range(2) を使うようになりました。また、その実装が使えない場合は他の実装へフォールバックするようにしました 13867
* IO#pread を追加 4532
* IO#pwrite を追加 4532
* IO#write 複数の...

ruby 1.8.4 feature (78.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

.../File.join [bug]>))
* ((<ruby 1.8.4 feature/Thread#pass [bug]>))
* ((<ruby 1.8.4 feature/Module#const_missing [bug]>))
* ((<ruby 1.8.4 feature/IO [bug]>))
* ((<ruby 1.8.4 feature/添付ライブラリ>))
* ((<ruby 1.8.4 feature/"Ruby/Tk">))
* ((<ruby 1.8.4 feature/REXML [compat]>))
* ((<...
...bug]>))
* ((<ruby 1.8.4 feature/IA64 [bug]>))

== Ruby本体

: Symbol [bug]

# * parse.y (dsym): prohibit empty symbol literal by interpolation.
# fixed: [ruby-talk:166529]

式展開で空のSymbolを作ることができたバグの修正。 ((<ruby-talk:166529>))

p :...
...# => ruby 1.9.0 (2005-12-10) [i686-linux]
"bar"


2) Symbol#inspect sometimes returns invalid symbol representations:

puts :"!".inspect
puts :"=".inspect
puts :"0".inspect
puts :"$1".inspect
puts :"@1"....

NEWS for Ruby 2.7.0 (30.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...omparable#clampや定数やDSLなどで便利かもしれません。
14799

//emlist[][ruby]{
ary[..3] # identical to ary[0..3]

case RUBY_VERSION
when ..."2.4" then puts "EOL"
# ...
end

age.clamp(..100)

where(sales: ..100)
//}

* 「$;」にnil以外の値を設定すると警告が出る...
...重代入でのrescue修飾子が単一の代入と同じ振る舞いになりました。 8279

//emlist[][ruby]{
a, b = raise rescue [1, 2]
# Previously parsed as: (a, b = raise) rescue [1, 2]
# Now parsed as: a, b = (raise rescue [1, 2])
//}

* 特異クラス構文での yield は警...
...* 実験的機能の警告を止める例:

//emlist{
$ ruby -e '0 in a'
-e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!

$ ruby -W:no-experimental -e '0 in a'
//}

* RUBYOPTで両方止めるにはスペース区切りで指定します:

/...

Enumerable#slice_before {|elt| bool } -> Enumerator (18.0)

パターンがマッチした要素、もしくはブロックが真を返した要素から 次にマッチする手前までを チャンク化(グループ化)したものを繰り返す Enumerator を 返します。

...e {|line| /\A\S/ === line }.each {|e| pp e}
}

# "svn proplist -R" の結果を分割する
# これは一要素が複数行にまたがっている

IO
.popen([{"LC_ALL"=>"C"}, "svn", "proplist", "-R"]) {|f|
f.lines.slice_before(/\AProp/).each {|lines| p lines }
}
#=> ["Properties on '.':\n", " s...
...より簡単な例も参照)。

//emlist[][ruby]{
a = [0,2,3,4,6,7,9]
prev = a[0]
p a.slice_before {|e|
prev, prev2 = e, prev
prev2 + 1 != e
}.map {|es|
es.length <= 2 ? es.join(",") : "#{es.first}-#{es.last}"
}.join(",")
#=> "0,2-4,6,7,9"
//}


@see Enumerable#chunk, Enumerable#slice_after...

Enumerable#slice_before(pattern) -> Enumerator (18.0)

パターンがマッチした要素、もしくはブロックが真を返した要素から 次にマッチする手前までを チャンク化(グループ化)したものを繰り返す Enumerator を 返します。

...e {|line| /\A\S/ === line }.each {|e| pp e}
}

# "svn proplist -R" の結果を分割する
# これは一要素が複数行にまたがっている

IO
.popen([{"LC_ALL"=>"C"}, "svn", "proplist", "-R"]) {|f|
f.lines.slice_before(/\AProp/).each {|lines| p lines }
}
#=> ["Properties on '.':\n", " s...
...より簡単な例も参照)。

//emlist[][ruby]{
a = [0,2,3,4,6,7,9]
prev = a[0]
p a.slice_before {|e|
prev, prev2 = e, prev
prev2 + 1 != e
}.map {|es|
es.length <= 2 ? es.join(",") : "#{es.first}-#{es.last}"
}.join(",")
#=> "0,2-4,6,7,9"
//}


@see Enumerable#chunk, Enumerable#slice_after...

絞り込み条件を変える

rss (18.0)

RSS を扱うためのライブラリです。

...参考

* RSS 0.91 http://backend.userland.com/rss091
* RSS 1.0 http://purl.org/rss/1.0/spec
* RSS 2.0 http://www.rssboard.org/rss-specification
* Atom 1.0 https://www.ietf.org/rfc/rfc4287.txt

=== 注意

RSS ParserはRSS 0.9x/1.0/2.0, Atom 1.0 をサポートしていますが,RSS 0.90...
...ュールはそれぞれ、
* Dublin Core モジュール http://web.resource.org/rss/1.0/modules/dc/
* Syndication モジュール http://web.resource.org/rss/1.0/modules/syndication/
* Content モジュール http://web.resource.org/rss/1.0/modules/content/
* Trackback モジュール http://...
...RSS::Parser クラスを使います。
RSS::Parser.parse は String の RSSを パースします(使用するXMLパー
サによっては File や IO オブジェクトなどでもパース可能です)。
* RSS 1.0をパースした場合は RSS::RDF オブジェクト
* RSS 0.9x/2.0をパー...
<< < ... 3 4 5 >>