Add super option for show-source command and add three tests #660

Merged
merged 8 commits into from Jul 25, 2012

Projects

None yet

3 participants

@TreyLawrence

@aerenchyma and I are submitting a new pull request in response to pull request #654. This is rebasing with all the latest pry merges.

We are adding the show-source -super option and a few tests. This will also work with multiple super options.

@travisbot

This pull request fails (merged 5bd86d4 into f6ddc1f).

@TreyLawrence

Accidentally deleted process_sourcable_object. Ammended commit. Please reattempt merge.

@travisbot

This pull request passes (merged fd0d786 into f6ddc1f).

@banister

why did you get rid of the should here? without it, you're not actually testing anything ;)

@banister

You should be lazily initializing @module_object with the result of sup otherwise it'll be recalculated every time someone uses module_object

Also, You should use Module#ancestors rather than Class#superclass to find the relevant superclass, so that included modules are considered too.

:)

@travisbot

This pull request passes (merged 0cc176c into f6ddc1f).

@TreyLawrence

Thanks @banister. I've committed changes that allow using the --super option on Modules, and I've added a test case for it, too. I've also added the should back in (must have accidentally overwritten it), and I've lazily initialized @module_object, so it should only be calculated once.

@banister

This is probably a bit too conservative, i think @module_object.ancestors is OK. ;)

@travisbot

This pull request fails (merged b791d23 into f6ddc1f).

@travisbot

This pull request passes (merged 9b5b26f into f6ddc1f).

@banister banister merged commit 49867f3 into pry:master Jul 25, 2012
@banister
Member

merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment