[#68137] improve semantics of manpages — "Anthony J. Bentley" <anthony@...>
Hi,
1 message
2015/02/17
[#68144] Re: Future of test suites for Ruby — Anthony Crumley <anthony.crumley@...>
FYI...
4 messages
2015/02/17
[#68343] [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault? — ruby@...
Issue #10916 has been reported by why do i need this acct just to create a bug report.
5 messages
2015/02/27
[#68373] Re: [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault?
— "Martin J. Dürst" <duerst@...>
2015/03/02
> * Author: why do i need this acct just to create a bug report
[#68358] [Ruby trunk - Bug #10902] require("enumerator") scans LOAD_PATH 2x on every invocation — ruby@...1.net
Issue #10902 has been updated by Aman Gupta.
3 messages
2015/02/28
[ruby-core:67989] [ruby-trunk - Bug #10818] Extrange behaviour when apliying a refinement inside eval
From:
pablodherrero@...
Date:
2015-02-04 00:45:58 UTC
List:
ruby-core #67989
Issue #10818 has been updated by Pablo Herrero.
OTOH that's also allowing you to leak the active refinement outside the lexical scope...
----------------------------------------
Bug #10818: Extrange behaviour when apliying a refinement inside eval
https://bugs.ruby-lang.org/issues/10818#change-51375
* Author: Pablo Herrero
* Status: Assigned
* Priority: Normal
* Assignee: Shugo Maeda
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
When you activate a refinement inside an a string using `eval` with a binding, the refinement is sill active the next time you call `eval` with the same binding.
Strangely enough, this will only happen if there is an assignment at the code evaluated the first time. If you delete the assignment everything works as expected.
```ruby
module M
refine String do
def foobar; puts 'foobar'; end
end
end
some_binding = class A; binding; end
str1 = <<EOF
a = 'something' # Without this everything works as expected
using M
'str'.foobar # Works fine
EOF
str2 = <<EOF
'str'.foobar # This time should fail but it doesn't
EOF
eval str1, some_binding
eval str2, some_binding
```
Acording to the [RefinmentsSpec](https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/RefinementsSpec): "when main.using is invoked in a string given as the first argument of Kernel#eval, Kernel#instance_eval, or Module#module_eval, the end of the scope is the end of the string."
Which contradicts with this code's behavior.
--
https://bugs.ruby-lang.org/