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

Byebug 11 support #210

Merged
merged 3 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- run:
name: Install dependencies
command: |
gem install bundler -v 2.0.1
bundle install --jobs 3 --retry 3 --path .bundle

- run:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AllCops:
DisplayCopNames: true
DisplayStyleGuide: true

TargetRubyVersion: 2.2
TargetRubyVersion: 2.3

Lint/Debugger:
Exclude:
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ PATH
remote: .
specs:
pry-byebug (3.6.0)
byebug (~> 10.0)
byebug (~> 11.0)
pry (~> 0.10)

GEM
remote: https://rubygems.org/
specs:
addressable (2.4.0)
ast (2.4.0)
byebug (10.0.2)
byebug (11.0.0)
chandler (0.7.0)
netrc
octokit (>= 2.2.0)
Expand Down Expand Up @@ -76,4 +76,4 @@ DEPENDENCIES
simplecov (= 0.16.1)

BUNDLED WITH
1.17.3
2.0.1
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ puts 'Goodbye World' # Run 'next' in the console to move here.

## Requirements

* Required: MRI 2.2.0 or higher.

* Recommended: MRI 2.3.0 or higher.
MRI 2.3.0 or higher.

## Installation

Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "chandler/tasks"
require "rake/testtask"
Expand Down
2 changes: 2 additions & 0 deletions lib/byebug/processors/pry_processor.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "byebug/core"

module Byebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

require "pry"
require "pry-byebug/cli"
2 changes: 2 additions & 0 deletions lib/pry-byebug/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Main container module for Pry-Byebug functionality
#
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/cli.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/base"
require "pry-byebug/pry_ext"
require "pry-byebug/commands"
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/commands/backtrace"
require "pry-byebug/commands/next"
require "pry-byebug/commands/step"
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/backtrace.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"

module PryByebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/breakpoint.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry/byebug/breakpoints"
require "pry-byebug/helpers/breakpoints"
require "pry-byebug/helpers/multiline"
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/continue.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"
require "pry-byebug/helpers/breakpoints"

Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/down.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"

module PryByebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/exit_all.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module PryByebug
#
# Exit pry REPL with Byebug.stop
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/finish.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"

module PryByebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/frame.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"

module PryByebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/next.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"
require "pry-byebug/helpers/multiline"

Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/step.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"

module PryByebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/commands/up.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-byebug/helpers/navigation"

module PryByebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/control_d_handler.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

original_handler = Pry.config.control_d_handler

Pry.config.control_d_handler = proc do |eval_string, pry_instance|
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/helpers/breakpoints.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "byebug"

module PryByebug
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/helpers/multiline.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module PryByebug
module Helpers
#
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/helpers/navigation.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module PryByebug
module Helpers
#
Expand Down
2 changes: 2 additions & 0 deletions lib/pry-byebug/pry_ext.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "byebug/processors/pry_processor"

class << Pry
Expand Down
4 changes: 3 additions & 1 deletion lib/pry-byebug/pry_remote_ext.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "pry-remote"

module PryRemote
Expand Down Expand Up @@ -38,5 +40,5 @@ def teardown_with_pry_byebug
# 'next' on the last line of a program won't hit Byebug::PryProcessor#run,
# which normally handles cleanup.
at_exit do
PryByebug.current_remote_server.teardown if PryByebug.current_remote_server
PryByebug.current_remote_server&.teardown
end
4 changes: 3 additions & 1 deletion lib/pry-byebug/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

#
# Main container module for Pry-Byebug functionality
#
module PryByebug
VERSION = "3.6.0".freeze
VERSION = "3.6.0"
end
2 changes: 2 additions & 0 deletions lib/pry/byebug/breakpoints.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Pry
module Byebug
#
Expand Down
6 changes: 4 additions & 2 deletions pry-byebug.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require File.dirname(__FILE__) + "/lib/pry-byebug/version"

Gem::Specification.new do |gem|
Expand All @@ -17,8 +19,8 @@ Gem::Specification.new do |gem|
gem.executables = []

# Dependencies
gem.required_ruby_version = ">= 2.2.0"
gem.required_ruby_version = ">= 2.3.0"

gem.add_runtime_dependency "byebug", "~> 10.0"
gem.add_runtime_dependency "byebug", "~> 11.0"
gem.add_runtime_dependency "pry", "~> 0.10"
end
2 changes: 2 additions & 0 deletions test/base_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

#
Expand Down
2 changes: 2 additions & 0 deletions test/breakpoints_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

#
Expand Down
18 changes: 10 additions & 8 deletions test/commands/breakpoints_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"

#
Expand Down Expand Up @@ -50,10 +52,10 @@ class SettingBreakpointsTestByLineNumber < BreakpointsTest
def setup
super

@input.add("break 6")
@input.add("break 8")
redirect_pry_io(@input, @output) { load test_file("break1") }
@line = 6
@regexp = / Breakpoint (?<id>\d+): #{test_file('break1')} @ 6 \(Enabled\)/
@line = 8
@regexp = / Breakpoint (?<id>\d+): #{test_file('break1')} @ 8 \(Enabled\)/
end

include BreakpointSpecs
Expand All @@ -68,7 +70,7 @@ def setup

@input.add("break Break1Example#a")
redirect_pry_io(@input, @output) { load test_file("break1") }
@line = RUBY_VERSION >= "2.5.0" ? 6 : 5
@line = RUBY_VERSION >= "2.5.0" ? 8 : 7
@regexp = / Breakpoint (?<id>\d+): Break1Example#a \(Enabled\)/
end

Expand All @@ -84,7 +86,7 @@ def setup

@input.add("break Break1Example#c!")
redirect_pry_io(@input, @output) { load test_file("break1") }
@line = RUBY_VERSION >= "2.5.0" ? 16 : 15
@line = RUBY_VERSION >= "2.5.0" ? 18 : 17
@regexp = / Breakpoint (?<id>\d+): Break1Example#c! \(Enabled\)/
end

Expand All @@ -100,7 +102,7 @@ def setup

@input.add("break #b")
redirect_pry_io(@input, @output) { load test_file("break2") }
@line = 7
@line = 9
@regexp = / Breakpoint (?<id>\d+): Break2Example#b \(Enabled\)/
end

Expand Down Expand Up @@ -152,7 +154,7 @@ class BreakInsideMultilineInput < BreakpointsTest
def setup
super

@input.add("2.times do |i|", "break 16 if i > 0", "end")
@input.add("2.times do |i|", "break 18 if i > 0", "end")

redirect_pry_io(@input, @output) { load test_file("break1") }
end
Expand All @@ -162,6 +164,6 @@ def test_it_is_ignored
end

def test_lets_input_be_properly_evaluated
assert_match(/=> 16/, @output.string)
assert_match(/=> 18/, @output.string)
end
end
10 changes: 6 additions & 4 deletions test/commands/frames_test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "test_helper"
require "stringio"

Expand All @@ -17,7 +19,7 @@ class FramesTest < MiniTest::Spec
end

it "shows current line" do
output.string.must_match(/=> \s*6: \s*method_b/)
output.string.must_match(/=> \s*8: \s*method_b/)
end
end

Expand All @@ -29,7 +31,7 @@ class FramesTest < MiniTest::Spec
end

it "shows current line" do
output.string.must_match(/=> \s*11: \s*end/)
output.string.must_match(/=> \s*13: \s*end/)
end
end

Expand All @@ -42,15 +44,15 @@ class FramesTest < MiniTest::Spec
let(:input) { InputTester.new("frame 1", "frame 0") }

it "shows current line" do
output.string.must_match(/=> \s*6: \s*method_b/)
output.string.must_match(/=> \s*8: \s*method_b/)
end
end

describe "jump to current frame" do
let(:input) { InputTester.new("frame 0") }

it "shows current line" do
output.string.must_match(/=> \s*11: \s*end/)
output.string.must_match(/=> \s*13: \s*end/)
end
end
end
Expand Down
Loading