別のキーワード
ライブラリ
クラス
- Array (12)
- Binding (12)
- Data (12)
- Exception (36)
- Hash (12)
- IO (12)
- Integer (24)
- MatchData (54)
- Module (180)
- NameError (24)
- NoMethodError (12)
- Object (36)
- Proc (19)
- Regexp (24)
- Ripper (10)
- String (48)
- Struct (48)
- Thread (72)
-
Thread
:: Backtrace :: Location (24) - ThreadGroup (12)
- TracePoint (12)
- UnboundMethod (12)
- WIN32OLE (12)
モジュール
キーワード
-
$ @ (12) -
$ CHILD _ STATUS (12) -
$ ` (12) - % (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Enumerator (12)
- Fail (6)
- Fiber (12)
- Integer (12)
- Location (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - NameError (12)
- NoMethodError (12)
- Proc (12)
- Raise (6)
- RegexpError (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Rubyの起動 (12)
- Singleton (12)
- Status (12)
- StringIO (12)
- Symbol (12)
- [] (18)
- args (12)
- backtrace (24)
-
backtrace
_ locations (36) - begin (12)
- bind (12)
- byteoffset (6)
- caller (36)
-
caller
_ locations (24) - chr (24)
-
default
_ proc= (12) -
did
_ you _ mean (12) - dump (24)
- enclose (12)
- end (12)
- exec (60)
- fail (36)
- format (12)
- freeze (12)
- getoptlong (12)
- include (12)
- inspect (24)
- irb (12)
- lambda (18)
- lex (5)
-
local
_ variable _ set (12) - logger (12)
- match (24)
-
module
_ function (36) - name (12)
- new (61)
-
object
_ id (12) - offset (24)
-
ole
_ show _ help (12) - optparse (12)
- private (48)
- proc (19)
- public (48)
-
public
_ class _ method (24) -
public
_ instance _ method (12) -
public
_ method (12) - putc (12)
- raise (36)
- rdoc (12)
- readline (12)
-
report
_ on _ exception (18) -
report
_ on _ exception= (18) -
require
_ relative (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
rubygems
/ commands / pristine _ command (12) -
rubygems
/ commands / server _ command (12) -
set
_ backtrace (12) - spawn (48)
- sprintf (12)
- sprintf フォーマット (12)
- squeeze (12)
- squeeze! (12)
- sysseek (12)
- system (48)
- timeout (21)
-
to
_ s (24) - tokenize (5)
- tr (12)
- transpose (12)
- tsort (12)
- クラス/メソッドの定義 (12)
- セキュリティモデル (12)
- パターンマッチ (12)
- メソッド呼び出し(super・ブロック付き・yield) (12)
- リテラル (12)
- 手続きオブジェクトの挙動の詳細 (12)
- 演算子式 (12)
検索結果
先頭5件
-
Kernel
. # `(command) -> String (18156.0) -
command を外部コマンドとして実行し、その標準出力を文字列として 返します。このメソッドは `command` の形式で呼ばれます。
...command を外部コマンドとして実行し、その標準出力を文字列として
返します。このメソッドは `command` の形式で呼ばれます。
引数 command に対しダブルクォートで囲まれた文字列と同様の解釈と式展開を行った後、
コマンド......必要がなく、単にコマンドを実行したいだけなら
Kernel.#system を使います。特に端末を制御するコマンドでは
`command` は失敗するかもしれません。
d:spec/literal#command も参照。
@param command コマンドとして実行する引数です。そ......返します。
@raise Errno::EXXX コマンドを実行できないときや失敗した場合に発生します。
//emlist[例][ruby]{
puts `ruby -v` #=> ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
puts $?.inspect #=> #<Process::Status: pid=3580,exited(0)>
//}
@see Kernel.#system,Kernel... -
Kernel
$ $ ` -> String | nil (6100.0) -
現在のスコープで最後に成功した正規表現のパターンマッチでマッチした 部分より前の文字列です。 最後のマッチが失敗していた場合には nil となります。
...す。
この変数はローカルスコープかつスレッドローカル、読み取り専用です。
Ruby起動時の初期値は nil です。
//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
p $`
end
#=> "<p>"
//}... -
NEWS for Ruby 3
. 0 . 0 (510.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ts forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It......can be used like a rightward assignment.
17260
* `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 i......16746
//emlist{
def square(x) = x * x
//}
* Interpolated String literals are no longer frozen when
`# frozen-string-literal: true` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments]... -
ruby 1
. 6 feature (246.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...らこちらは nil を返していた
p "foo".slice!(5,10)
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
-:2:in `slice!': index 5 out of string (IndexError)
from -:2
=> ruby 1.6.7 (2002-08-01) [i586-linux]
nil
nil
:......用します。以前までは $; が有効にな
るのは引数省略時だけでした。
$; = ":"
p "a:b:c".split(nil)
=> -:2:in `split': bad separator (ArgumentError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby 1.6.7 (2002-07-30) [i586-linux]......y"
h = Hash[a,"val"]
h.keys[0].upcase!
p a
=> ruby 1.6.7 (2002-03-01) [i586-linux]
"KEY"
=> -:3:in `upcase!': can't modify frozen string (TypeError)
from -:3
ruby 1.6.7 (2002-08-01) [i586-linux]
: 2002-06-10 Fixnum#>>, <<... -
NEWS for Ruby 3
. 1 . 0 (228.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...。このコードでは、
//emlist[][ruby]{
foo[0] = bar
//}
* 次の評価順序になります。
//emlist{
1. `foo`
2. `bar`
3. `[]=` called on the result of `foo`
//}
* Ruby 3.1.0より前は、多重代入の評価順序が上記のようではありませんでした。この......`a`
2. `b`
3. `foo`
4. `[]=` called on the result of `foo`
5. `bar`
6. `baz=` called on the result of `bar`
//}
* Ruby 3.1.0から単一代入と評価順序が一致するようになり、左が右より先に評価されます。
//emlist{
1. `foo`
2. `bar`
3. `a`
4. `b`......5. `[]=` called on the result of `foo`
6. `baz=` called on the result of `bar`
//}
* 4443
* ハッシュリテラルやキーワード引数の値が省略可能になりました。 14579
* {x:, y:} は {x: x, y: y} の糖衣構文です。
* foo(x:, y:) は foo(x: x, y: y) の糖... -
NEWS for Ruby 2
. 3 . 0 (90.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...、自動的に他の似た名前を提案してくれます。
//emlist{
"Yuki".starts_with?("Y")
# => NoMethodError: undefined method `starts_with?' for "Yuki":String
# Did you mean? start_with?
//}
* インデントされたヒアドキュメント:
* 新しい文字......トが追加されました
9098
=== 組み込みクラスの更新
* ARGF
* ARGF.read_nonblock は IO#read_nonblock と同じように `exception: false' オプションをサポートします
11358
* Array
* Array#bsearch_index を追加
10730
* Array#dig を......とを許可しますが、現在はファイルをバイナリモードで開いているときのみ効果があります。
11218
* `flags` オプションの追加。
this parameter is bitwise-ORed to oflags generated by normal mode argument.
11253
* IO#advise はもは... -
optparse (90.0)
-
コマンドラインのオプションを取り扱うためのライブラリです。
...e.rb:1428:in `complete': invalid option: -c (OptionParser::InvalidOption)
from /usr/local/lib/ruby/1.9/optparse.rb:1426:in `catch'
from /usr/local/lib/ruby/1.9/optparse.rb:1426:in `complete'
from /usr/local/lib/ruby/1.9/optparse.rb:1287:in `order!'......n `catch'
from /usr/local/lib/ruby/1.9/optparse.rb:1256:in `order!'
from /usr/local/lib/ruby/1.9/optparse.rb:1336:in `permute!'
from /usr/local/lib/ruby/1.9/optparse.rb:1363:in `parse!'
from /usr/local/lib/ruby/1.9/optparse.rb:1356:in `......se.rb:455:in `parse': missing argument: -a (OptionParser::MissingArgument)
from /usr/local/lib/ruby/1.9/optparse.rb:1295:in `order!'
from /usr/local/lib/ruby/1.9/optparse.rb:1256:in `catch'
from /usr/local/lib/ruby/1.9/optparse.rb:1256:in `order!'... -
ruby 1
. 8 . 4 feature (66.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...-:3:in `foo': method `foo' called on terminated object (0xb7e06970) (NotImplementedError)
from -:7
# => ruby 1.8.4 (2005-12-22) [i686-linux]
-:3:in `foo'-:3: warning: too many arguments for format string
: super: no superclass method `foo' (NoMe......Bar.new
# => ruby 1.8.3 (2005-09-21) [i686-linux]
-:3:in `initialize': method `initialize' called on terminated object (0xb7dd2bec) (NotImplementedError)
from -:10:in `initialize'
from -:14
# => ruby 1.8.4 (2005-12-16) [i686-linux......printf("%2147483648$d\n") # -e:1:in `printf': invalid index - -2147483648$ (ArgumentError)
printf("%2147483649$d\n") # -e:1:in `printf': invalid index - -2147483647$ (ArgumentError)
printf("%4294967296$d\n") # -e:1:in `printf': invalid index - 0$ (ArgumentError)... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (60.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...Proc.new {|a,b,c| p [a,b,c]}.call(1,2)
=> -:1: wrong # of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]
=> ruby 1.8.0 (2003-06-21) [i586-linux......[1, 2, nil]
Proc.new { break }.call
=> ruby 1.6.8 (2002-12-24) [i586-linux]
=> -:1:in `call': break from proc-closure (LocalJumpError)
from -:1
ruby 1.8.0 (2003-06-21) [i586-linux]
* lam......entError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]
=> -:1: wrong number of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (48.0)
-
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or plus minus ast slash hat sq period comma langl rangl eq tilde dollar at under lbrarbra lbra2rbra2 lbra3rbra3 dq colon ac backslash semicolon
...!nomad! #=> "nomad"
//}
: % ruby -e "puts 'Hello'"
コマンドラインへの入力を示す。rubyスクリプト上で入力を行うには `command` や system(command) などと書く
===[a:and] &
: xxx & yyy
論理積演算子。または類似の演算を行うメソッド。
//emlist{......EOS または <<-EOS 、<<"EOS" など。
ヒアドキュメントです。d:spec/literal#here。ヒアドキュメントは `<<識別子' を含む行の次の行から
`識別子' だけの行の直前までを文字列とする行指向のリテラルです。
: class Foo < Super
クラス......yyy
識別子の中では小文字と同じ扱い
: 123_456
文字コード以外の数値リテラルには、`_' を含めることができます。 ruby インタプリタは `_' を単に無視し、
特別な解釈は何もしません。 これは、大きな数値の桁数がひと目...