Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchr doesn't handle ruby-debug well? #34

Open
imajes opened this issue Oct 4, 2011 · 4 comments
Open

watchr doesn't handle ruby-debug well? #34

imajes opened this issue Oct 4, 2011 · 4 comments

Comments

@imajes
Copy link

imajes commented Oct 4, 2011

what's the right way to handle going into debugger with watchr? is there anything that could be written up to make this clearer?

@ajsharp
Copy link

ajsharp commented Oct 4, 2011

Seems to work fine for me. Here's a simplified watchr file we use:

def run(file)
  if File.exist?(file)
    puts("Running #{file}")
    system("rspec #{file}")
  else
    $stderr.puts "Could not find #{file}"
  end
end

watch("^lib/(.*)\.rb")                        { |m| run("spec/lib/#{m[1]}_spec.rb") }

As long as we have ruby-debug loaded up correctly, everything works as expected. We're using watchr 0.7.

@imajes
Copy link
Author

imajes commented Oct 4, 2011

So, rspec breaks out into debug as you would expect in the watchr terminal?

What does 'set it up right' entail?

Sent from my iPhone

On Oct 4, 2011, at 19:01, Alex Sharpreply@reply.github.com wrote:

Seems to work fine for me. Here's a simplified watchr file we use:

def run(file)
 if File.exist?(file)
   puts("Running #{file}")
   system("rspec #{file}")
 else
   $stderr.puts "Could not find #{file}"
 end
end

watch("^lib/(.*)\.rb")                        { |m| run("spec/lib/#{m[1]}_spec.rb") }

As long as we have ruby-debug loaded up correctly, everything works as expected. We're using watchr 0.7.

Reply to this email directly or view it on GitHub:
#34 (comment)

@ajsharp
Copy link

ajsharp commented Oct 4, 2011

So, rspec breaks out into debug as you would expect in the watchr terminal?

Yep.

What does 'set it up right' entail?

I just mean to make sure to require 'ruby-debug' somewhere either in the spec file or in spec_helper.

What problems are you having with it?

@tomrossi7
Copy link

I had a problem with using ruby debugger and it was related to this script: https://gist.github.com/276317. There are variations of this one floating around, but the way it executes the commands won't allow you to drop into a debugger. I changed the run() method to system() and it works great.

Do you all have a recommended watchr script that emulates the functionality of autotest? That may be worth having an official copy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants