From 1516f17770ba7c6a9c1237290be3dc6e843ce812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 21 Mar 2020 20:38:50 +0100 Subject: [PATCH] Tighten pry dependency So that future minor breaking relases of pry don't affect pry-byebug users. As a side effect, drop support for pry's older than 0.13.0. --- .dependabot/config.yml | 10 --- .github/workflows/ubuntu.yml | 14 ++-- CHANGELOG.md | 10 ++- Gemfile.lock | 10 +-- gemfiles/pry_master/Gemfile | 17 ----- gemfiles/pry_master/Gemfile.lock | 98 ---------------------------- lib/pry-byebug/control_d_handler.rb | 17 ++--- lib/pry-byebug/helpers/navigation.rb | 10 +-- pry-byebug.gemspec | 2 +- 9 files changed, 25 insertions(+), 163 deletions(-) delete mode 100644 gemfiles/pry_master/Gemfile delete mode 100644 gemfiles/pry_master/Gemfile.lock diff --git a/.dependabot/config.yml b/.dependabot/config.yml index 6582a23..45a61c0 100644 --- a/.dependabot/config.yml +++ b/.dependabot/config.yml @@ -12,13 +12,3 @@ update_configs: - match: dependency_type: development update_type: all - - - package_manager: ruby:bundler - directory: /gemfiles/pry_master - update_schedule: live - version_requirement_updates: increase_versions_if_necessary - - automerged_updates: - - match: - dependency_type: development - update_type: all diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index df4592e..8a3b7b3 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -17,11 +17,8 @@ jobs: strategy: matrix: ruby: [2.4.9, 2.5.7, 2.6.5, 2.7.0] - gemfile: [Gemfile, gemfiles/pry_master/Gemfile] env: - BUNDLE_GEMFILE: ${{ matrix.gemfile }} - BUNDLE_LOCKFILE: ${{ matrix.gemfile }}.lock BUNDLE_PATH: .bundle steps: @@ -35,7 +32,7 @@ jobs: - uses: actions/cache@v1 with: path: ${{ env.BUNDLE_PATH }} - key: dependencies-${{ hashFiles(env.BUNDLE_LOCKFILE) }} + key: dependencies-${{ hashFiles('Gemfile.lock') }} restore-keys: dependencies- - name: Install dependencies @@ -65,16 +62,13 @@ jobs: - name: Give test coverage reporter executable permissions run: chmod +x cc-test-reporter - - name: Set test report output file - run: echo "::set-env name=BUNDLE_GEMFILE_BASENAME::$(echo $BUNDLE_GEMFILE | cut -d/ -f2)" - - name: Save coverage - run: ./cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.ruby }}-${{ env.BUNDLE_GEMFILE_BASENAME }}.json + run: ./cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.ruby }}.json - uses: actions/upload-artifact@v1 with: - name: coverage-${{ matrix.ruby }}-${{ env.BUNDLE_GEMFILE_BASENAME }} - path: coverage/codeclimate.${{ matrix.ruby }}-${{ env.BUNDLE_GEMFILE_BASENAME }}.json + name: coverage-${{ matrix.ruby }} + path: coverage/codeclimate.${{ matrix.ruby }}.json upload_coverage: runs-on: ubuntu-18.04 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d465d7..3369376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,17 @@ ## Master (Unreleased) +### Fixed + +* Dependency on pry being too loose. Now breaking minor releases of pry won't affect pry-byebug users (#288). + ### Added -* Support for pry master as of [pry/pry@62c8951374aeed5a7423609a108848b0bcf81685](https://github.com/pry/pry/commit/62c8951374aeed5a7423609a108848b0bcf81685) (#266). +* Support for pry 0.13.0 (#266). + +### Removed + +* Support for pry older than 0.13.0 (#288). ## 3.8.0 (2020-01-22) diff --git a/Gemfile.lock b/Gemfile.lock index 67c9cea..70acb85 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ PATH specs: pry-byebug (3.8.0) byebug (~> 11.0) - pry (~> 0.10) + pry (~> 0.13.0) GEM remote: https://rubygems.org/ @@ -29,7 +29,7 @@ GEM kramdown-parser-gfm (~> 1.0) mixlib-cli (~> 2.1, >= 2.1.1) mixlib-config (>= 2.2.1, < 4) - method_source (0.9.2) + method_source (1.0.0) minitest (5.14.0) minitest-bisect (1.5.1) minitest-server (~> 1.0) @@ -48,9 +48,9 @@ GEM parser (2.7.0.3) ast (~> 2.4.0) path_expander (1.1.0) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) + pry (0.13.0) + coderay (~> 1.1) + method_source (~> 1.0) public_suffix (4.0.3) rainbow (3.0.0) rake (13.0.1) diff --git a/gemfiles/pry_master/Gemfile b/gemfiles/pry_master/Gemfile deleted file mode 100644 index 1146454..0000000 --- a/gemfiles/pry_master/Gemfile +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gemspec path: "../.." - -group :development do - gem "rake", "~> 13.0" - - gem "chandler", "0.9.0" - gem "mdl", "0.9.0" - gem "minitest", "~> 5.14" - gem "minitest-bisect", "~> 1.5" - gem "pry", git: "https://github.com/pry/pry.git" - gem "rubocop", "0.80.1" - gem "simplecov", "0.17.1" -end diff --git a/gemfiles/pry_master/Gemfile.lock b/gemfiles/pry_master/Gemfile.lock deleted file mode 100644 index b72ac42..0000000 --- a/gemfiles/pry_master/Gemfile.lock +++ /dev/null @@ -1,98 +0,0 @@ -GIT - remote: https://github.com/pry/pry.git - revision: 62dbbdb23eb4e2d84d95ebd1261cdf23facacaed - specs: - pry (0.12.2) - coderay (~> 1.1) - method_source (~> 1.0) - -PATH - remote: ../.. - specs: - pry-byebug (3.8.0) - byebug (~> 11.0) - pry (~> 0.10) - -GEM - remote: https://rubygems.org/ - specs: - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - ast (2.4.0) - byebug (11.1.1) - chandler (0.9.0) - netrc - octokit (>= 2.2.0) - coderay (1.1.2) - docile (1.3.2) - faraday (1.0.0) - multipart-post (>= 1.2, < 3) - jaro_winkler (1.5.4) - json (2.3.0) - kramdown (2.1.0) - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - mdl (0.9.0) - kramdown (~> 2.0) - kramdown-parser-gfm (~> 1.0) - mixlib-cli (~> 2.1, >= 2.1.1) - mixlib-config (>= 2.2.1, < 4) - method_source (1.0.0) - minitest (5.14.0) - minitest-bisect (1.5.1) - minitest-server (~> 1.0) - path_expander (~> 1.1) - minitest-server (1.0.6) - minitest (~> 5.0) - mixlib-cli (2.1.5) - mixlib-config (3.0.6) - tomlrb - multipart-post (2.1.1) - netrc (0.11.0) - octokit (4.16.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - parallel (1.19.1) - parser (2.7.0.3) - ast (~> 2.4.0) - path_expander (1.1.0) - public_suffix (4.0.3) - rainbow (3.0.0) - rake (13.0.1) - rexml (3.2.4) - rubocop (0.80.1) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.7.0.1) - rainbow (>= 2.2.2, < 4.0) - rexml - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - ruby-progressbar (1.10.1) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - simplecov (0.17.1) - docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) - tomlrb (1.2.9) - unicode-display_width (1.6.1) - -PLATFORMS - ruby - -DEPENDENCIES - chandler (= 0.9.0) - mdl (= 0.9.0) - minitest (~> 5.14) - minitest-bisect (~> 1.5) - pry! - pry-byebug! - rake (~> 13.0) - rubocop (= 0.80.1) - simplecov (= 0.17.1) - -BUNDLED WITH - 2.1.4 diff --git a/lib/pry-byebug/control_d_handler.rb b/lib/pry-byebug/control_d_handler.rb index f4e1c17..7a2c9e9 100644 --- a/lib/pry-byebug/control_d_handler.rb +++ b/lib/pry-byebug/control_d_handler.rb @@ -2,17 +2,8 @@ original_handler = Pry.config.control_d_handler -Pry.config.control_d_handler = - if original_handler.arity == 2 - proc do |eval_string, pry_instance| - Byebug.stop if Byebug.stoppable? +Pry.config.control_d_handler = proc do |pry_instance| + Byebug.stop if Byebug.stoppable? - original_handler.call(eval_string, pry_instance) - end - else - proc do |pry_instance| - Byebug.stop if Byebug.stoppable? - - original_handler.call(pry_instance) - end - end + original_handler.call(pry_instance) +end diff --git a/lib/pry-byebug/helpers/navigation.rb b/lib/pry-byebug/helpers/navigation.rb index afde308..d14bc4c 100644 --- a/lib/pry-byebug/helpers/navigation.rb +++ b/lib/pry-byebug/helpers/navigation.rb @@ -10,15 +10,9 @@ module Navigation # Breaks out of the REPL loop and signals tracer # def breakout_navigation(action, options = {}) - preferred_pry_instance = if respond_to?(:pry_instance) - pry_instance - else - _pry_ - end + pry_instance.binding_stack.clear - preferred_pry_instance.binding_stack.clear - - throw :breakout_nav, action: action, options: options, pry: preferred_pry_instance + throw :breakout_nav, action: action, options: options, pry: pry_instance end end end diff --git a/pry-byebug.gemspec b/pry-byebug.gemspec index 0bcc320..cfa62df 100644 --- a/pry-byebug.gemspec +++ b/pry-byebug.gemspec @@ -22,5 +22,5 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.4.0" gem.add_runtime_dependency "byebug", "~> 11.0" - gem.add_runtime_dependency "pry", "~> 0.10" + gem.add_runtime_dependency "pry", "~> 0.13.0" end