From 5f0072a182f71180ea4bf367257c14a9944e1884 Mon Sep 17 00:00:00 2001 From: Erik Eggers Date: Mon, 3 Jan 2022 14:33:56 -0600 Subject: [PATCH] HighLine namespace fix (#177) * Use HighLine in a way that does not pollute the global namespace * version bump --- CHANGELOG | 3 +++ VERSION | 2 +- lib/spark_api/authentication/oauth2_impl/cli_provider.rb | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 95c5f310..ac02369c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +v1.5.6 + - Modify usage of HighLine so that it does not pollute the global namespace + v1.5.5 - Add logging of an errored oauth2 response diff --git a/VERSION b/VERSION index 9075be49..eac1e0ad 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.5 +1.5.6 diff --git a/lib/spark_api/authentication/oauth2_impl/cli_provider.rb b/lib/spark_api/authentication/oauth2_impl/cli_provider.rb index d5e10936..2135379f 100644 --- a/lib/spark_api/authentication/oauth2_impl/cli_provider.rb +++ b/lib/spark_api/authentication/oauth2_impl/cli_provider.rb @@ -1,4 +1,4 @@ -require "highline/import" +require "highline" module SparkApi module Authentication @@ -18,7 +18,7 @@ def initialize(credentials) def redirect(url) puts "Missing OAuth2 session, redirecting..." puts "Please visit #{url}, login as a user, and paste the authorization code here:" - self.code = ask("Authorization code?") do |q| + self.code = HighLine.ask("Authorization code?") do |q| q.whitespace = :strip_and_collapse q.validate = /^\w+$/ end