[#89806] [Ruby trunk Bug#15306] Generate prelude.c using miniruby — v.ondruch@...
Issue #15306 has been reported by vo.x (Vit Ondruch).
3 messages
2018/11/15
[ruby-core:89687] [Ruby trunk Bug#15278] Refinements don't work well with Forwardable
From:
cardoso_tiago@...
Date:
2018-11-03 00:06:42 UTC
List:
ruby-core #89687
Issue #15278 has been reported by chucke (Tiago Cardoso).
----------------------------------------
Bug #15278: Refinements don't work well with Forwardable
https://bugs.ruby-lang.org/issues/15278
* Author: chucke (Tiago Cardoso)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.5.1
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Refined methods become unreachable when called through def_delegator.
```ruby
require "forwardable"
module URIExtensions
refine URI::Generic do
def authority
port_string = port == default_port ? nil : ":#{port}"
"#{host}#{port_string}"
end
def origin
"#{scheme}://#{authority}"
end
end
end
using URIExtensions
class Container
extend Forwardable
def_delegator :@uri, :origin
def_delegator :@uri, :authority
def initialize(uri)
@uri = uri
end
end
u = URI("https://google.com")
container = Container.new(u)
puts container.origin
puts container.authority
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>