From 6f3bbc781af23ae109e54544823ff863cefbf986 Mon Sep 17 00:00:00 2001 From: Kevin Soltysiak Date: Sun, 11 Feb 2024 17:59:20 +0100 Subject: [PATCH] feat: console with client --- bin/console | 12 +++++++++++- scalingo.gemspec | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/console b/bin/console index 5613a7a..a924bda 100755 --- a/bin/console +++ b/bin/console @@ -3,10 +3,20 @@ require "bundler/setup" require "scalingo" +begin + require "dotenv" + Dotenv.load(".env.local") +rescue LoadError + puts("dotenv not available - no .env.local loading") +end + # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. # (If you use this, don't forget to add pry to your Gemfile!) require "pry" -Pry.start +client = Scalingo::Client.new +client.authenticate_with(access_token: ENV["SCALINGO_API_TOKEN"]) if ENV["SCALINGO_API_TOKEN"].present? + +Pry.start(binding, quiet: true) diff --git a/scalingo.gemspec b/scalingo.gemspec index e2fbfbd..c79c88c 100644 --- a/scalingo.gemspec +++ b/scalingo.gemspec @@ -37,6 +37,7 @@ Gem::Specification.new do |s| s.add_dependency "multi_json", ">= 1.0.3", "~> 1.0" s.add_development_dependency "bundler", "~> 2.0" + s.add_development_dependency "dotenv" s.add_development_dependency "rake", "~> 13.0" s.add_development_dependency "rspec", "~> 3.0" s.add_development_dependency "standard", "~> 1.32"