`show-source <Class>#<method> --super` should support `--all` option #725

Open
kyrylo opened this Issue Oct 6, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Owner

kyrylo commented Oct 6, 2012

Given that:

[1] pry(main)> class Phrase
[1] pry(main)*   def hm
[1] pry(main)*     :hm
[1] pry(main)*   end  
[1] pry(main)* end  
=> nil
[2] pry(main)> class Lol < Phrase
[2] pry(main)*   def hm
[2] pry(main)*     :lol
[2] pry(main)*   end  
[2] pry(main)* end  
=> nil
[3] pry(main)> class Oops < Lol
[3] pry(main)*   def hm
[3] pry(main)*     :oops
[3] pry(main)*   end  
[3] pry(main)* end  
=> nil
[4] pry(main)> class Doh < Oops
[4] pry(main)*   def hm
[4] pry(main)*     :doh
[4] pry(main)*   end  
[4] pry(main)* end  
=> nil

We should get this output:

[5]pry(main)> show-source Doh#hm --super --all

From: (pry) @ line 17:
Number of lines: 3
Owner: Doh
Visibility: public

def hm
  :doh
end

From: (pry) @ line 12:
Number of lines: 3
Owner: Oops
Visibility: public

def hm
  :oops
end

From: (pry) @ line 7:
Number of lines: 3
Owner: Lol
Visibility: public

def hm
  :lol
end

From: (pry) @ line 2:
Number of lines: 3
Owner: Phrase
Visibility: public

def hm
  :hm
end

Friendly copy-pasta:

class Phrase
  def hm
    :hm
  end  
end  

class Lol < Phrase
  def hm
    :lol
  end  
end  

class Oops < Lol
  def hm
    :oops
  end  
end  

class Doh < Oops
  def hm
    :doh
  end  
end

show-source Doh#hm --super --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment