From 9539dfda3446d740c21d2ba07bf9857914ca8b01 Mon Sep 17 00:00:00 2001 From: Andrzej Bisewski <152981096+andrzejbisewski@users.noreply.github.com> Date: Tue, 12 Mar 2024 17:40:02 +0100 Subject: [PATCH 1/2] Drop dotenv --- CHANGELOG.md | 4 ++++ Gemfile.lock | 8 ++++---- eventboss.gemspec | 2 +- lib/eventboss/cli.rb | 2 +- lib/eventboss/version.rb | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93aa0a9..9ac4a81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.9.0] - 2024-03-12 + +- Eliminate the dependency on `dotenv`. However, the application will still load `dotenv` if it is available. + ## [1.4.0] - 2020-04-18 - Introduce server middlewares (#31) diff --git a/Gemfile.lock b/Gemfile.lock index 15ab230..c5db455 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,17 +1,16 @@ PATH remote: . specs: - eventboss (1.8.1) + eventboss (1.9.0) aws-sdk-sns (>= 1.1.0) aws-sdk-sqs (>= 1.3.0) - dotenv (~> 2.1, >= 2.1.1) rexml (~> 3.0) GEM remote: https://rubygems.org/ specs: aws-eventstream (1.3.0) - aws-partitions (1.894.0) + aws-partitions (1.896.0) aws-sdk-core (3.191.3) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) @@ -26,7 +25,7 @@ GEM aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) diff-lcs (1.5.0) - dotenv (2.8.1) + dotenv (3.1.0) jmespath (1.6.2) rake (13.0.6) rexml (3.2.6) @@ -49,6 +48,7 @@ PLATFORMS DEPENDENCIES bundler (>= 1) + dotenv (~> 3.1) eventboss! rake (>= 10.0) rspec (~> 3.0) diff --git a/eventboss.gemspec b/eventboss.gemspec index 546c0d2..62232ee 100644 --- a/eventboss.gemspec +++ b/eventboss.gemspec @@ -22,9 +22,9 @@ Gem::Specification.new do |spec| spec.add_dependency "aws-sdk-sqs", ">= 1.3.0" spec.add_dependency "aws-sdk-sns", ">= 1.1.0" - spec.add_dependency "dotenv", "~> 2.1", ">= 2.1.1" spec.add_dependency "rexml", "~> 3.0" + spec.add_development_dependency "dotenv", "~> 3.1" spec.add_development_dependency "bundler", ">= 1" spec.add_development_dependency 'rake', '>= 10.0' spec.add_development_dependency "rspec", "~> 3.0" diff --git a/lib/eventboss/cli.rb b/lib/eventboss/cli.rb index 3037ae4..e760db3 100644 --- a/lib/eventboss/cli.rb +++ b/lib/eventboss/cli.rb @@ -36,7 +36,7 @@ def run private def boot_system - Dotenv.load + Dotenv.load if defined?(Dotenv) require 'rails' if ::Rails::VERSION::MAJOR < 4 diff --git a/lib/eventboss/version.rb b/lib/eventboss/version.rb index cff56e4..b7aba54 100644 --- a/lib/eventboss/version.rb +++ b/lib/eventboss/version.rb @@ -1,3 +1,3 @@ module Eventboss - VERSION = "1.8.1" + VERSION = "1.9.0" end From 049bdc6c95b8b1b35c2fa4d8c7bdb4cd13b7ae26 Mon Sep 17 00:00:00 2001 From: Andrzej Bisewski <152981096+andrzejbisewski@users.noreply.github.com> Date: Wed, 13 Mar 2024 12:25:04 +0100 Subject: [PATCH 2/2] use `rescue LoadError` --- lib/eventboss/cli.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/eventboss/cli.rb b/lib/eventboss/cli.rb index e760db3..9e2f265 100644 --- a/lib/eventboss/cli.rb +++ b/lib/eventboss/cli.rb @@ -1,5 +1,9 @@ require 'rubygems' -require 'dotenv' +begin + require 'dotenv' + Dotenv.load +rescue LoadError +end require 'optparse' require 'yaml' require 'erb' @@ -36,8 +40,6 @@ def run private def boot_system - Dotenv.load if defined?(Dotenv) - require 'rails' if ::Rails::VERSION::MAJOR < 4 require File.expand_path('config/environment.rb')