Skip to content

show-source throws lots of warnings, and doesn't totally work #775

Closed
epitron opened this Issue Dec 8, 2012 · 3 comments

2 participants

@epitron
pry member
epitron commented Dec 8, 2012

Without understanding how show-source is implemented, I can't really explain why this is happening. But, here it is, just in case you wanted to know. :)

This one breaks (using the 'riel' gem):

[2] pry(main)> ASCIITable
=> RIEL::ASCIITable
[3] pry(main)> $ ASCIITable
/home/epi/code/pry/lib/pry/helpers/module_introspection_helpers.rb:7: warning: instance variable @module_object not initialized
/home/epi/code/pry/lib/pry/wrapped_module.rb:232: warning: instance variable @all_source_locations_by_popularity not initialized
Error: Cannot find a definition for RIEL::ASCIITable module!
[4] pry(main)>

The problem is that the ASCIITable module is defined in a few files (asciitable/cell.rb, asciitable/column.rb, etc.).

This one works, but has many "instance variable not initialized" warnings:

[4] pry(main)> module Wat; def uhhh; :hurrr; end; end
=> => nil
[5] pry(main)> $ Wat
/home/epi/code/pry/lib/pry/helpers/module_introspection_helpers.rb:7: warning: instance variable @module_object not initialized
/home/epi/code/pry/lib/pry/wrapped_module.rb:232: warning: instance variable @all_source_locations_by_popularity not initialized
/home/epi/code/pry/lib/pry/module_candidate.rb:71: warning: instance variable @source_location not initialized
/home/epi/code/pry/lib/pry/module_candidate.rb:52: warning: instance variable @source not initialized
/home/epi/code/pry/lib/pry/code.rb:327: warning: instance variable @with_marker not initialized
/home/epi/code/pry/lib/pry/code.rb:337: warning: instance variable @with_indentation not initialized

From: (pry) @ line 1:
Number of lines: 1

module Wat; def uhhh; :hurrr; end; end
[6] pry(main)> 
@banister
pry member
banister commented Dec 8, 2012

In the first example does RIEL::ASCIITable have any defined methods? can you show me the source for this class?

Regarding warnings..i guess we'll try to eliminate them before the next release. How are invoking pry such that it's showing warnings? i don't get them

@banister
pry member

Is this still reproducible on the new gem (0.9.11.3) ?

@epitron
pry member
epitron commented Nov 27, 2013

I haven't seen this in recent memory. I'm going to assume it's fixed. :bread: :+1: :dancer:

@epitron epitron closed this Nov 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.