From 4ed12b5739f7344168b00834189250fe188bd6a0 Mon Sep 17 00:00:00 2001 From: Vic van Gool Date: Tue, 7 Apr 2026 20:04:26 +0100 Subject: [PATCH] fix double-load warning by changing load to require lib/roleback.rb used load() to glob all .rb files, which re-executed version.rb that was already required. Switch to require() to prevent the "already initialized constant" warning. Bump to 0.2.1. --- Gemfile.lock | 2 +- lib/roleback.rb | 3 ++- lib/roleback/version.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 252ee41..b8116ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - roleback (0.2.0) + roleback (0.2.1) GEM remote: https://rubygems.org/ diff --git a/lib/roleback.rb b/lib/roleback.rb index c906fcb..ae00f73 100644 --- a/lib/roleback.rb +++ b/lib/roleback.rb @@ -1,6 +1,7 @@ require "roleback/version" require 'roleback/definitions/load' -Dir["#{File.dirname(__FILE__)}/roleback/**/*.rb"].each { |f| load(f) } +# use require instead of load to avoid re-executing already-loaded files +Dir["#{File.dirname(__FILE__)}/roleback/**/*.rb"].each { |f| require(f) } module Roleback class Error < StandardError; end diff --git a/lib/roleback/version.rb b/lib/roleback/version.rb index 4b47c16..730cd79 100644 --- a/lib/roleback/version.rb +++ b/lib/roleback/version.rb @@ -1,3 +1,3 @@ module Roleback - VERSION = "0.2.0".freeze + VERSION = "0.2.1".freeze end