lib/indexer/metadata.rb in indexer-0.2.0 vs lib/indexer/metadata.rb in indexer-0.3.0

- old
+ new

@@ -523,34 +523,35 @@ Valid.string!(message) message.to_str end end - ## - ## Set extraneous developer-defined metdata. - ## - #def extra=(extra) - # unless extra.kind_of?(Hash) - # raise(ValidationError, "extra must be a Hash") - # end - # @data[:extra] = extra - #end + # + # Set custom user-field names. + # + def customs=(customs) + #unless customs.kind_of?(Hash) + #raise(ValidationError, "customs must be an Array") + Valid.array!(customs) + #end + @data[:customs] = customs + end # -- Utility Methods ---------------------------------------------------- # # Legacy method to common Ruby path via `paths['load']`. # def load_path - paths['load'] + paths['lib'] end # # Legacy method to set `paths['load']`. # def load_path=(path) - paths['load'] = Array(path).map{ |path| Valid.path!(path) } + paths['lib'] = Array(path).map{ |path| Valid.path!(path) } end # # Adds a new requirement. # @@ -828,9 +829,14 @@ h['copyrights'] = copyrights.map { |x| x.to_h } h['requirements'] = requirements.map { |x| x.to_h } h['conflicts'] = conflicts.map { |x| x.to_h } h['repositories'] = repositories.map { |x| x.to_h } h['resources'] = resources.map { |x| x.to_h } + + customs.each do |name| +$stderr.puts self[name] + h[name] = self[name] + end h end # Create nicely formated project "about" text.