From cea5f9474fc66d8e25fc2bfb74f219ac96b6c0ff Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Mon, 16 Nov 2026 07:16:45 +0000 Subject: [PATCH] Build the gemspec's file list without changing directory The openvox-agent package installs openvox.gemspec as the agent's installed gemspec, so RubyGems evaluates it when it loads the installed gems. Its Dir.chdir(__dir__) block changed back to the caller's directory when it ended, which fails for a user who can't enter that directory, and RubyGems then printed "Invalid gemspec" on stderr. Dir.glob with 'base: __dir__' lists the same files without changing directory. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> Assisted-by: Claude Opus 5.5 --- openvox.gemspec | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/openvox.gemspec b/openvox.gemspec index d8701e4e12..546c7c126e 100644 --- a/openvox.gemspec +++ b/openvox.gemspec @@ -22,20 +22,18 @@ Gem::Specification.new do |spec| EOF spec.email = "openvox@voxpupuli.org" spec.executables = ["puppet"] - spec.files = Dir.chdir(__dir__) do - Dir.glob(%w[ - [A-Z]* - install.rb - bin/* - lib/**/* - conf/* - man/**/* - tasks/* - locales/**/* - ext/**/* - examples/**/* - ]).reject { |path| File.directory?(path) || File.extname(path) == '.gem' } - end + spec.files = Dir.glob(%w[ + [A-Z]* + install.rb + bin/* + lib/**/* + conf/* + man/**/* + tasks/* + locales/**/* + ext/**/* + examples/**/* + ], base: __dir__).reject { |path| File.directory?(File.join(__dir__, path)) || File.extname(path) == '.gem' } spec.license = "Apache-2.0" spec.homepage = "https://github.com/OpenVoxProject/openvox" spec.rdoc_options = ["--title", "OpenVox - Configuration Management", "--main", "README", "--line-numbers"]