Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Your environment
mzagaja@Matthews-MacBook-Pro-16 ~/D/roadrunner (PLAT-1878-remove-unused-topics-routes) [SIGINT]> ruby -v
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-darwin21]
mzagaja@Matthews-MacBook-Pro-16 ~/D/roadrunner (PLAT-1878-remove-unused-topics-routes)> rdbg -v
rdbg 1.5.0Describe the bug
When I type edit into Ruby debug, it outputs the command information, but does not actually open the editor with the file.
To Reproduce
bundle exec rspec spec/requests/follows_spec.rb
Symfony User is deprecated! Switch to Identity::User.
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 59410
.......[9, 18] in ~/Developer/roadrunner/spec/requests/follows_spec.rb
9| let(:session_user) { new_logged_in_session_user(identity_user: identity_user) }
10|
11| describe 'creating' do
12| context 'logged in' do
13| it 'should succesfully create a follow for a user' do
=> 14| debugger
15| allow_any_instance_of(Identity::Follow).to receive(:save) { true }
16| sign_in session_user
17| post '/follows.json', params: { follow: { subject_type: 'User', subject_id: 1234 } }
18| expect(response.status).to eq(200)
=>#0 block in <top (required)> (4 levels) at ~/Developer/roadrunner/spec/requests/follows_spec.rb:14
#1 [C] BasicObject#instance_exec at ~/.rvm/gems/ruby-2.7.6@roadrunner/gems/rspec-core-3.11.0/lib/rspec/core/example.rb:263
# and 48 frames (use `bt' command for all frames)
(rdbg) edit # command
command: nova -w
path: /Users/mzagaja/Developer/roadrunner/spec/requests/follows_spec.rb
(rdbg) edit # command
command: nova -w
path: /Users/mzagaja/Developer/roadrunner/spec/requests/follows_spec.rb
(rdbg) edit # command
command: nova -w
path: /Users/mzagaja/Developer/roadrunner/spec/requests/follows_spec.rb
(rdbg) edit # command
command: nova -w
path: /Users/mzagaja/Developer/roadrunner/spec/requests/follows_spec.rb
(rdbg) exitExpected behavior
I expected the file the debugger is open in to open in Panic Nova.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
ko1 commentedon Jul 27, 2022
https://github.com/ruby/debug/blob/master/lib/debug/thread_client.rb#L646
It only calls
system(...). Do you have any idea?ko1 commentedon Sep 16, 2022
Please reopen it if you find another ideas.
mzagaja commentedon Sep 26, 2022
@ko1 Thanks for your response, I have figured out the issue. I have set
$EDITORtonova -wbecause Panic Nova does not wait by default. This means callingsystem('nova', FILE_PATH)will continue execution before any changes are made.The problem is calling
system('nova -w', FILE_PATH)appears to not be valid because with the second argumentsystemtreatsnova -was the command instead ofnovawith the argument-w. Therefore working commands would be:I am happy to make a pull request to suggest this change to the debug source you mention if it makes sense to you. Othewrise if this behavior seems wrong by Panic Nova, I can file a support ticket with them, they are usually responsive.
ko1 commentedon Oct 4, 2022
Ah I see. It is a bug of debug.gem.
I'll try it later (not sure when I can fix it) or patch is welcome.
adam12 commentedon Oct 4, 2022
Maybe we should
Shellwords.splitbefore callingsystem?mzagaja commentedon Oct 18, 2022
@adam12 That seems reasonable to me. Would be happy to see this included in next release. I'm happy to PR your diff if you are too busy but figured you might want the credit since you've pretty much done the work here 😄.
adam12 commentedon Oct 18, 2022
@mzagaja If it the patch works for you, definitely go ahead and submit a PR using it :)
Resolve ruby#726 Panic Nova Edit Feature
mzagaja commentedon Oct 21, 2022
I tested this locally and it worked great. PR submitted.
Resolve ruby#726 Panic Nova Edit Feature