Project

General

Profile

Actions

Bug #3617

closed

respond_to?(:gem) is false in 1.9.2-rc2

Added by sunaku (Suraj Kurapati) over 14 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2010-07-11 revision 28618) [i686-linux]
Backport:
[ruby-core:31485]

Description

=begin
Please compare the new behavior:

ruby 1.9.2dev (2010-07-11 revision 28618) [i686-linux]

respond_to? :gem
=> false
method :gem
=> #<Method: Object(Kernel)#gem>

Against the old behavior:

ruby 1.9.1p429 (2010-07-02 revision 28523) [i686-linux]

respond_to? :gem
=> true
method :gem
=> #<Method: Object(Kernel)#gem>

I think the new behavior is strange. How
can #respond_to? fail when #method succeeds?

Thanks for your consideration.
=end


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #3480: gem_prelude: activation should accomodate for '=' and gem 'gem_name', 'version'Rejectednobu (Nobuyoshi Nakada)06/25/2010Actions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

=begin
Hi,

At Mon, 26 Jul 2010 16:07:12 +0900,
Suraj Kurapati wrote in [ruby-core:31485]:

ruby 1.9.2dev (2010-07-11 revision 28618) [i686-linux]

respond_to? :gem
=> false
method :gem
=> #<Method: Object(Kernel)#gem>

$ ./ruby -v -e 'p respond_to?(:gem, true)'
ruby 1.9.2dev (2010-07-24 revision 28749) [i386-darwin9.8.0]
true

I think the new behavior is strange. How
can #respond_to? fail when #method succeeds?

Kernel#respond_to? returns false if the method is private.

--
Nobu Nakada

=end

Actions #2

Updated by naruse (Yui NARUSE) over 14 years ago

=begin
On 1.9.1, Kernel#gem is public, but on 1.9.2 it is private.
But why it is changed.
=end

Actions #3

Updated by tenderlovemaking (Aaron Patterson) over 14 years ago

=begin
On Mon, Jul 26, 2010 at 06:50:06PM +0900, Yui NARUSE wrote:

Issue #3617 has been updated by Yui NARUSE.

On 1.9.1, Kernel#gem is public, but on 1.9.2 it is private.
But why it is changed.

Kernel#gem is private in rubygems. gem_prelude made it public. I
believe it was fixed in gem_prelude to match the rubygems API.

Kernel#gem is also private in 1.8.7.

Check r26127 and [ruby-dev:39838]

--
Aaron Patterson
http://tenderlovemaking.com/

Attachment: (unnamed)
=end

Actions #4

Updated by sunaku (Suraj Kurapati) over 14 years ago

=begin
Thank you for explaining. I agree that this is not a bug.
=end

Actions #5

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0