ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:79013] [Ruby trunk Bug#13115] `YAML.dump` outputs deperecated message even with delegated object
       [not found] <redmine.issue-13115.20170108115036@ruby-lang.org>
@ 2017-01-08 11:50 ` mtsmfm
  2017-01-18 12:30 ` [ruby-core:79124] [Ruby trunk Bug#13115][Assigned] " nobu
  2019-01-09 22:37 ` [ruby-core:90955] [Ruby trunk Bug#13115][Closed] " tenderlove
  2 siblings, 0 replies; 3+ messages in thread
From: mtsmfm @ 2017-01-08 11:50 UTC (permalink / raw)
  To: ruby-core

Issue #13115 has been reported by Fumiaki Matsushima.

----------------------------------------
Bug #13115: `YAML.dump` outputs deperecated message even with delegated object
https://bugs.ruby-lang.org/issues/13115

* Author: Fumiaki Matsushima
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
`YAML.dump` outputs deprecated message if it calls with delegated object
but doesn't with inherited object:

~~~ ruby
require 'yaml'
require 'delegate'

$VERBOSE = true
class Delegated < DelegateClass(Object)
  def initialize
    super(Object.new)
  end
end

puts 'YAML.dump(Delegated.new)'
YAML.dump(Delegated.new)

class Inherited < Object
end
puts 'YAML.dump(Inherited.new)'
YAML.dump(Inherited.new)

# $ ruby test.rb
# YAML.dump(Delegated.new)
# implementing to_yaml is deprecated, please implement "encode_with"
# YAML.dump(Inherited.new)
~~~

Is this intentional?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:79124] [Ruby trunk Bug#13115][Assigned] `YAML.dump` outputs deperecated message even with delegated object
       [not found] <redmine.issue-13115.20170108115036@ruby-lang.org>
  2017-01-08 11:50 ` [ruby-core:79013] [Ruby trunk Bug#13115] `YAML.dump` outputs deperecated message even with delegated object mtsmfm
@ 2017-01-18 12:30 ` nobu
  2019-01-09 22:37 ` [ruby-core:90955] [Ruby trunk Bug#13115][Closed] " tenderlove
  2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2017-01-18 12:30 UTC (permalink / raw)
  To: ruby-core

Issue #13115 has been updated by Nobuyoshi Nakada.

Status changed from Open to Assigned
Assignee set to Aaron Patterson

Psych warns if `to_yaml` method is defined by other than psych itself, and delegated methods are defined in `delegate.rb`.
You can avoid the warning by `undef to_yaml` in `class Delegated`.

----------------------------------------
Bug #13115: `YAML.dump` outputs deperecated message even with delegated object
https://bugs.ruby-lang.org/issues/13115#change-62536

* Author: Fumiaki Matsushima
* Status: Assigned
* Priority: Normal
* Assignee: Aaron Patterson
* Target version: 
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
`YAML.dump` outputs deprecated message if it calls with delegated object
but doesn't with inherited object:

~~~ ruby
require 'yaml'
require 'delegate'

$VERBOSE = true
class Delegated < DelegateClass(Object)
  def initialize
    super(Object.new)
  end
end

puts 'YAML.dump(Delegated.new)'
YAML.dump(Delegated.new)

class Inherited < Object
end
puts 'YAML.dump(Inherited.new)'
YAML.dump(Inherited.new)

# $ ruby test.rb
# YAML.dump(Delegated.new)
# implementing to_yaml is deprecated, please implement "encode_with"
# YAML.dump(Inherited.new)
~~~

Is this intentional?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:90955] [Ruby trunk Bug#13115][Closed] `YAML.dump` outputs deperecated message even with delegated object
       [not found] <redmine.issue-13115.20170108115036@ruby-lang.org>
  2017-01-08 11:50 ` [ruby-core:79013] [Ruby trunk Bug#13115] `YAML.dump` outputs deperecated message even with delegated object mtsmfm
  2017-01-18 12:30 ` [ruby-core:79124] [Ruby trunk Bug#13115][Assigned] " nobu
@ 2019-01-09 22:37 ` tenderlove
  2 siblings, 0 replies; 3+ messages in thread
From: tenderlove @ 2019-01-09 22:37 UTC (permalink / raw)
  To: ruby-core

Issue #13115 has been updated by tenderlovemaking (Aaron Patterson).

Status changed from Assigned to Closed

This has been fixed since Psych 3.0.0 https://github.com/ruby/psych/commit/712a65a53f3c15105cd86e8ad3ee3c779050ada4

----------------------------------------
Bug #13115: `YAML.dump` outputs deperecated message even with delegated object
https://bugs.ruby-lang.org/issues/13115#change-76161

* Author: mtsmfm (Fumiaki Matsushima)
* Status: Closed
* Priority: Normal
* Assignee: tenderlovemaking (Aaron Patterson)
* Target version: 
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
`YAML.dump` outputs deprecated message if it calls with delegated object
but doesn't with inherited object:

~~~ ruby
require 'yaml'
require 'delegate'

$VERBOSE = true
class Delegated < DelegateClass(Object)
  def initialize
    super(Object.new)
  end
end

puts 'YAML.dump(Delegated.new)'
YAML.dump(Delegated.new)

class Inherited < Object
end
puts 'YAML.dump(Inherited.new)'
YAML.dump(Inherited.new)

# $ ruby test.rb
# YAML.dump(Delegated.new)
# implementing to_yaml is deprecated, please implement "encode_with"
# YAML.dump(Inherited.new)
~~~

Is this intentional?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-09 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-13115.20170108115036@ruby-lang.org>
2017-01-08 11:50 ` [ruby-core:79013] [Ruby trunk Bug#13115] `YAML.dump` outputs deperecated message even with delegated object mtsmfm
2017-01-18 12:30 ` [ruby-core:79124] [Ruby trunk Bug#13115][Assigned] " nobu
2019-01-09 22:37 ` [ruby-core:90955] [Ruby trunk Bug#13115][Closed] " tenderlove

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).