lib/chamber/keys/base.rb in chamber-2.11.0 vs lib/chamber/keys/base.rb in chamber-2.12.0

- old
+ new

@@ -5,13 +5,13 @@ class Base def self.resolve(*args) new(*args).resolve end - attr_accessor :namespaces, - :rootpath - attr_reader :filenames + attr_accessor :rootpath + attr_reader :filenames, + :namespaces def initialize(options = {}) self.rootpath = Pathname.new(options.fetch(:rootpath)) self.namespaces = options.fetch(:namespaces) self.filenames = options[:filenames] @@ -42,9 +42,21 @@ uniq end end private + + def namespaces=(other) + @namespaces ||= begin + keys = if other.respond_to?(:keys) + other.keys.map(&:to_s) + else + other + end + + keys + %w{signature} + end + end def key_from_file_contents(filename) filename.readable? && filename.read end