diff --git a/lib/ghi/client.rb b/lib/ghi/client.rb index 5ae8a86..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' } @@ -97,7 +99,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 '&'}" 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'