るりまサーチ

最速Rubyリファレンスマニュアル検索!
160件ヒット [1-100件を表示] (0.013秒)

別のキーワード

  1. tsort each_strongly_connected_component_from
  2. prime int_from_prime_division
  3. _builtin from_name
  4. socket connect_from
  5. addrinfo connect_from

検索結果

<< 1 2 > >>

Kernel.#eval(expr, bind, fname = "(eval)", lineno = 1) -> object (18263.0)

文字列 expr を Ruby プログラムとして評価してその結果を返しま す。第2引数に Binding オブジェクトを与えた場合、 そのオブジェクトを生成したコンテキストで文字列を評価します。

...列を評価します。

expr の中のローカル変数の扱いはブロックの場合と同じです。すなわち、eval
実行前に補足されていた変数は eval 実行後にブロック外に持ち出せます。

fname と lineno が与えられた場合には、ファイル
fname...
...きます。

bind によらずに特定のオブジェクトのコンテキストで expr を評価したい場合、
Module#module_eval, BasicObject#instance_eval が使えます。

@param expr 評価する文字列です。
@param bind 評価コンテキストです。
@param fname スタッ...
...ruby]{
a = nil
eval
('a = RUBY_RELEASE_DATE')
p a #=> "2007-03-13"

eval
('def fuga;p 777 end')
fuga #=> 777

eval
('raise RuntimeError', binding, 'XXX.rb', 4)
#=> XXX.rb:4: RuntimeError (RuntimeError)
# from ..:9
//}

@see Kernel.#binding,Module#module_eval,BasicObject#instance_eval,Object#metho...

Kernel.#eval(expr) -> object (18163.0)

文字列 expr を Ruby プログラムとして評価してその結果を返しま す。第2引数に Binding オブジェクトを与えた場合、 そのオブジェクトを生成したコンテキストで文字列を評価します。

...列を評価します。

expr の中のローカル変数の扱いはブロックの場合と同じです。すなわち、eval
実行前に補足されていた変数は eval 実行後にブロック外に持ち出せます。

fname と lineno が与えられた場合には、ファイル
fname...
...きます。

bind によらずに特定のオブジェクトのコンテキストで expr を評価したい場合、
Module#module_eval, BasicObject#instance_eval が使えます。

@param expr 評価する文字列です。
@param bind 評価コンテキストです。
@param fname スタッ...
...ruby]{
a = nil
eval
('a = RUBY_RELEASE_DATE')
p a #=> "2007-03-13"

eval
('def fuga;p 777 end')
fuga #=> 777

eval
('raise RuntimeError', binding, 'XXX.rb', 4)
#=> XXX.rb:4: RuntimeError (RuntimeError)
# from ..:9
//}

@see Kernel.#binding,Module#module_eval,BasicObject#instance_eval,Object#metho...

RubyVM::InstructionSequence.load_from_binary(binary) -> RubyVM::InstructionSequence (6113.0)

RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

...りません。自分が変換したバイナリデータを使うべきです。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}

@see RubyVM::InstructionSequence#to_binary...

ruby 1.6 feature (288.0)

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

....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

: 2002-07-05 String#split

最初の引数に 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]
["a", "b", "c"]

: 2002-06-15 Dir.glob...
...が定義されていない場合例外 NameError を起こ
すようになりました。((<ruby-bugs-ja:PR#216>))

Object.new.instance_eval {
p remove_instance_variable :@foo
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil

=> -:2:in `remove_ins...

ruby 1.8.4 feature (150.0)

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

...1.8.4 (2005-12-22) [i686-linux]
:foo!
:bar?

4) :$- always treats next character literally:

p eval(":$-\n") # => :"$-\n"
p :$-( # => :"$-("
p :$- # => :"$- "
p :$-#.object_id # => 3950350

# => ru...
...Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (rb_call_super): should call method_missing if super is
# called from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# information.

: super [bug]

Kerne...
...xb7e06970) (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' (NoMethodError)
from
-:7

: 正規表現 [bug]

#We...

絞り込み条件を変える

1.6.8から1.8.0への変更点(まとめ) (102.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-linu...
...c.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]

* lambda および proc が返す Proc は引数...
...END__ は、スクリプトの終りとみなさなくな
りました。((<ruby-dev:17513>))

# p "
#__END__
#"
p eval(%Q(p "\n__END__\n"))

: ((<?<whitespace>|リテラル/数値リテラル>)) [parser] [change]

?スペース、?改行、?TAB 等はリテラル...

NEWS for Ruby 3.0.0 (84.0)

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

...かれた全ての変更のリストはリンク先を参照してください。

== 言語仕様の変更

* Keyword arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183...
...class/module, a RuntimeError is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class variable from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.

== Comma...
...sent and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754

=== `--backtrace-limit` option

The `--backtrace-limit` option limits the maximum length of a backtrace.
8661

== Core classes updates...

NEWS for Ruby 2.1.0 (72.0)

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

...無視します。

* Kernel.#eval, Kernel.#instance_eval, Module#module_eval
元の環境のスコープ情報をコピーするようになりました。これは、引数なしの
private, protected, public, module_function を文字列として eval しても
その外側には影...
...響を与えないという意味です。
以下のコードは Foo#foo をプライベートにしません。
//emlist{
class Foo
eval
"private"
def foo
end
end
//}

* Object#untrusted?,Object#untrust,Object#trust
* これらのメソッドは非推奨になり...
...or を発生させるようになりました。

* Proc
* Returning from lambda proc now always exits from the Proc, not from the
method where the lambda is created. Returning from non-lambda proc exits
from
the method, same as the former behavior.

* String
* 以下のコ...

irb (60.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...れます。

IRB.conf[:AUTO_INDENT] = false
IRB.conf[:BACK_TRACE_LIMIT] = 16
IRB.conf[:DEBUG_LEVEL] = 1
IRB.conf[:ECHO] = nil
IRB.conf[:EVAL_HISTORY] = nil
IRB.conf[:HISTORY_FILE] = nil
IRB.conf[:IGNORE_EOF] = true
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:INSPECT_MODE] = nil
IR...
...# サブ irb を起動
irb#1(main):001:0> x # x を表示
NameError: undefined local variable or method `x' for main:Object
from
(irb#1):1:in `Kernel#binding'

起動時のインタプリタでローカル変数 x を定義しましたが、
「irb」でサブ irb を起動...
...Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.

>> String#match
String#match

(from ruby core)
------------------------------------------------------------------------------
str.match(pattern) -> matchdata or nil
s...

NEWS for Ruby 2.0.0 (36.0)

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

...ence
from
a method or a block.
* 追加: RubyVM::InstructionSequence#path,
RubyVM::InstructionSequence#absolute_path,
RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#base_label,
RubyVM::InstructionSequence#first_lineno to retrieve information from whe...
...:
* added main.define_method which defines a global function.
* added main.using, which imports refinements into the current file or
eval
string. [experimental]

=== 組み込みクラスの互換性 (機能追加とバグ修正を除く)

* Array#values_at
上を参照...
...readable は IO#wait の別名です。

* json
* 1.7.7 に更新

* net/http
* 新機能
* Proxies are now automatically detected from the http_proxy environment
variable. See Net::HTTP.new for details.
* gzip and deflate compression are now requested for all reques...

絞り込み条件を変える

<< 1 2 > >>