lib/bmc-daemon-lib/conf.rb in bmc-daemon-lib-0.5.3 vs lib/bmc-daemon-lib/conf.rb in bmc-daemon-lib-0.6.0

- old
+ new

@@ -49,12 +49,12 @@ # Load Gemspec (just the only match) @spec = Gem::Specification::load(matches.first) fail ConfigGemspecInvalid, "gemspec not readable: #{gemspec_path}" unless @spec # Extract useful information from gemspec - @app_name = @spec.name - @app_ver = @spec.version + @app_name = @spec.name.to_s + @app_ver = @spec.version.to_s fail ConfigMissingParameter, "gemspec: missing name" unless @app_name fail ConfigMissingParameter, "gemspec: missing version" unless @app_ver # Now we know app_name, initalize app_libs @app_libs = File.expand_path("lib/#{@app_name}/", @app_root) @@ -274,10 +274,19 @@ def self.load_files load files: @files, namespaces: { environment: @app_env } end def self.add_config path - @files << File.expand_path(path) if path && File.readable?(path) + # Skip if path is not readable + return unless path && File.readable?(path) + + # Check if Chamber's behaviour may cause problems with hyphens + if File.basename(path).include?'-' + log :conf, "WARNING: files containting dashes may cause problems with Chamber" + end + + # Store the files + @files << File.expand_path(path) end def self.logfile_path pipe # Access configuration path = self.at :logs, :path