Make Pry + Spork play along nicely. #673

Closed
Wizek opened this Issue Jul 29, 2012 · 24 comments

Projects

None yet

6 participants

@Wizek
Wizek commented Jul 29, 2012

[22:58] also, have you tried using pry with spork?
[22:59] cirwin: no
[22:59] I mean, do you know that input-output is messed up between the two consoles when pry is used with spork?
[22:59] cirwin: hmm
[22:59] cirwin: what does spork do?
[23:00] preloads ruby env so that tests can execute 'faster'
[23:00] it is used with rspec and cucumber
[23:01] cirwin: Wizek: ah ok
[23:01] cirwin: and stdin/stdout appear on the spork process not the ruby process?
[23:02] cirwin, not exactly: Output of pry appears on the spork console, but it only takes input from it's (supposedly) own console
[23:02] cirwin: heh
[23:02] It's qute an interesting experience
[23:02] cirwin: I guess that's fixable
[23:03] cirwin: do you want to open a bug report? there might already be one
[23:03] cirwin: where does test output appear?
[23:03] banisterfiend: so spork has re-opened $stdout ?
[23:05] the spork console supposed to be in the background, and while it does some output of its own, it is mostly debug information. The test output is redirected to the console where it is initiated
[23:05] cirwin, does this bug belong to you or to spork?
[23:05] cirwin: Wizek: I'm not certain...
[23:05] cirwin: I think probably us

@kyrylo
Member
kyrylo commented Jul 30, 2012

Are you using REE or 1.8.7? Is this bug somehow correlates with that one? #345

@Wizek
Wizek commented Jul 30, 2012

No, I don't think so: I didn't experience getting in an endless busy-loop.
I neither use REE, I use ruby 1.9.3p125 (2012-02-16) [i386-mingw32] and Rails 3.2.1.

@MikeBlyth

Any progress on this? Spork is very useful but this behavior makes it hard to use with pry. What I'm seeing is that I must type into the Spork window, but what I'm typing appears in the RSpec window (well, I guess I just need to use a split terminal to see what I'm typing). (I'm using Ruby 1.9.3p194 and Rails 3.2.5 with Ubuntu 12.04)

@Wizek
Wizek commented Aug 30, 2012

You can also use --no-drb to occasionally disable spork when you need to
use pry, but then again you are in fact not using pry with spork, and not
having the speed benefits.

M.

On 30 August 2012 12:16, Mike Blyth notifications@github.com wrote:

Any progress on this? Spork is very useful but this behavior makes it hard
to use with pry. What I'm seeing is that I must type into the Spork window,
but what I'm typing appears in the RSpec window (well, I guess I just need
to use a split terminal to see what I'm typing).


Reply to this email directly or view it on GitHubhttps://github.com/pry/pry/issues/673#issuecomment-8154964.

@MikeBlyth

That’s actually a pretty useful workaround ☺.
--Mike Blyth

From: Wizek [mailto:notifications@github.com]
Sent: Thursday, August 30, 2012 12:23 PM
To: pry/pry
Cc: Blyth, Mike
Subject: Re: [pry] Make Pry + Spork play along nicely. (#673)

You can also use --no-drb to occasionally disable spork when you need to
use pry, but then again you are in fact not using pry with spork, and not
having the speed benefits.

M.

On 30 August 2012 12:16, Mike Blyth notifications@github.com wrote:

Any progress on this? Spork is very useful but this behavior makes it hard
to use with pry. What I'm seeing is that I must type into the Spork window,
but what I'm typing appears in the RSpec window (well, I guess I just need
to use a split terminal to see what I'm typing).


Reply to this email directly or view it on GitHubhttps://github.com/pry/pry/issues/673#issuecomment-8154964.


Reply to this email directly or view it on GitHubhttps://github.com/pry/pry/issues/673#issuecomment-8156304.

@banister
Member

IMO this bug should rather be filed on Spork than the Pry REPO; or at least filed there too to get their feedback :) The pry IO system is actually very simple and i find it difficult to see how it could be at fault.

@kyrylo kyrylo was assigned Oct 22, 2012
@kyrylo
Member
kyrylo commented Oct 22, 2012

@Wizek, I can't replicate this (tested with Rails). Everything works well. I'm using Pry 0.9.10, Ruby 1.9.3, Spork 1.0.0rc3, RSpec 2.6.0 and Rails 3.2.8. May it be possible that the issue has magically been resolved by a wizard? :)

@Wizek
Wizek commented Oct 24, 2012

@kyrylo

  • ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
  • rails 3.2.1
  • spork 0.9.2
  • pry 0.9.9.6
  • rspec 2.10.0

I have these. I'll do my updates in a few days and check if the bug is still there.

@kyrylo
Member
kyrylo commented Nov 10, 2012

@Wizek, any news?

@Wizek
Wizek commented Nov 10, 2012

Sorry, I forgot about this. I tried updating my gems, but pry seems reluctant to up for the version you mentioned. Here is how I tried:

$ bundle exec pry -v
Pry version 0.9.10 on Ruby 1.9.3

$ gem update pry
Updating installed gems
Nothing to update

Before this I tried a bundle update (from 0.9.9.6). I also use pry-debug and pry-rails, if that's of importance.

And I can still reproduce the error with this version, but let's not jump to concludios before I'm able to up to that rc ver you used.

@kyrylo
Member
kyrylo commented Dec 2, 2012

@Wizek, ping :)

@Wizek
Wizek commented Dec 4, 2012

I think I'm stuck. It makes little sense to me: I clearly don't have the latest pry, but when I try to update, it says there is nothign to update. Do you have any idea how I should update it?

@rking
Contributor
rking commented Dec 5, 2012

@Wizek do you have a repo I can clone and check this out?

@Wizek
Wizek commented Dec 5, 2012

@rking Unfortunately the repo in question is a private one. Cloudn't it be, that pry-debug or pry-rails is locking pry from upping to another version?

@kyrylo
Member
kyrylo commented Dec 5, 2012

@Wizek, by the by, I recommend you to refuse from using pry_debug it is
old and unsupported anymore. Have a look at
https://github.com/nixme/pry-debugger.

On Wed, Dec 5, 2012 at 1:16 PM, Wizek notifications@github.com wrote:

@rking https://github.com/rking Unfortunately the repo in question is a
private one. Cloudn't it be, that pry-debug or pry-rails is locking pryfrom upping to another version?


Reply to this email directly or view it on GitHubhttps://github.com/pry/pry/issues/673#issuecomment-11037667.

@kyrylo
Member
kyrylo commented Dec 7, 2012

pry-rails and pry_debug shouldn't be locking up Pry.

@rking
Contributor
rking commented Dec 7, 2012

Maybe we should just blacklist pry-nav and pry_debug with a prompt to download pry-debugger.

👍
👍
👍

That's +3 votes right there. Where's the opposition?

@kyrylo
Member
kyrylo commented Dec 7, 2012

Time heals!

I just tried to replicate this again and, I must say, it works flawlessly (with Pry 0.9.10). That is the project I used for testing: rails-project.zip.

To test it, launch spork and then perform bundle exec rspec --drb spec/controllers/hellos_controller_spec.rb. It should open a Pry session:

    45:   describe "GET show" do
    46:     it "assigns the requested hello as @hello" do
 => 47:       binding.pry
    48:       hello = Hello.create! valid_attributes
    49:       get :show, {:id => hello.to_param}, valid_session

Please, ping me if you still have the issue.

@kyrylo kyrylo closed this Dec 7, 2012
@artofhuman

With spork not work commands next, step, continues, etc
And i have trouble with stdout
I run spork in one terminal and run test in second terminal. binding.pry stop otput in first terminal where i start spork. Its normal?

@kyrylo
Member
kyrylo commented Jul 9, 2013

Could you, please, prepare a test application, so we could download and play with it?

@kyrylo
Member
kyrylo commented Jul 9, 2013
@artofhuman

Very thx for video. it help me install tmux =)

@kyrylo
Member
kyrylo commented Jul 9, 2013

No problem. We can't fix something that is not failing. You have to be more specific.

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