From d401cf8e15dcaedf58f1b43c693aee4eb5641cb5 Mon Sep 17 00:00:00 2001 From: James Dullaghan Date: Fri, 27 Aug 2021 21:16:06 -0600 Subject: [PATCH 1/2] Update URI.escape to use CGI.escape in order to avoid issue with ruby 3.0 --- lib/ghi/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ghi/client.rb b/lib/ghi/client.rb index 5ae8a86..10c0e29 100644 --- a/lib/ghi/client.rb +++ b/lib/ghi/client.rb @@ -97,7 +97,7 @@ def delete path, options = {} def request method, path, options path = "/api/v3#{path}" if HOST != DEFAULT_HOST - path = URI.escape path + path = CGI.escape path if params = options[:params] and !params.empty? q = params.map { |k, v| "#{CGI.escape k.to_s}=#{CGI.escape v.to_s}" } path += "?#{q.join '&'}" From 567d4943420c7d299788a757393b6dc7e6e6c620 Mon Sep 17 00:00:00 2001 From: James Dullaghan Date: Fri, 27 Aug 2021 21:55:27 -0600 Subject: [PATCH 2/2] Add some prys for debugging --- lib/ghi/client.rb | 2 ++ lib/ghi/commands/edit.rb | 1 + lib/ghi/commands/open.rb | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/ghi/client.rb b/lib/ghi/client.rb index 10c0e29..8078ede 100644 --- a/lib/ghi/client.rb +++ b/lib/ghi/client.rb @@ -2,6 +2,8 @@ require 'net/https' require 'json' +require 'pry' + unless defined? Net::HTTP::Patch # PATCH support for 1.8.7. Net::HTTP::Patch = Class.new(Net::HTTP::Post) { METHOD = 'PATCH' } diff --git a/lib/ghi/commands/edit.rb b/lib/ghi/commands/edit.rb index 4f46569..fb10330 100644 --- a/lib/ghi/commands/edit.rb +++ b/lib/ghi/commands/edit.rb @@ -65,6 +65,7 @@ def execute require_repo require_issue options.parse! args + case action when 'edit' begin diff --git a/lib/ghi/commands/open.rb b/lib/ghi/commands/open.rb index 2c0bb69..4114746 100644 --- a/lib/ghi/commands/open.rb +++ b/lib/ghi/commands/open.rb @@ -50,6 +50,7 @@ def options end def execute + binding.pry require_repo self.action = 'create'