lib/folder_metadata.rb
def bind_yaml_metadata(item)
	folder = Pathname(item[:filename]).dirname.to_s

	folder_yamls = $yaml_files[folder]
	if (folder_yamls == nil)
		return
	end

	folder_yamls.each do |yaml|
		attrName = File.basename(yaml[0], '.yaml')
		item[attrName] = yaml[1]
	end

end
# For each item that exist in the same folder as any of the yaml files
# adds item attribute with yaml file name and value of yaml file content
For each item that exist in the same folder as any of the yaml files
adds item attribute with yaml file name and value of yaml file content
For each item that exist in the same folder as any of the yaml files adds item attribute with yaml file name and value of yaml file content
def bind_yaml_metadata(item)
	folder = Pathname(item[:filename]).dirname.to_s
	folder_yamls = $yaml_files[folder]
	if (folder_yamls == nil)
		return
	end
	folder_yamls.each do |yaml|
		attrName = File.basename(yaml[0], '.yaml')
		item[attrName] = yaml[1]
	end
end
def bind_yaml_metadata ( item ) folder = Pathname ( item [ :filename ] ) . dirname . to_s folder_yamls = $yaml_files [ folder ] if ( folder_yamls == nil ) return end folder_yamls . each do | yaml | attrName = File . basename ( yaml [ 0 ] , '.yaml' ) item [ attrName ] = yaml [ 1 ] end end
For each item that exist in the same folder as any of the yaml files
adds item attribute with yaml file name and value of yaml file content
For each item that exist in the same folder as any of the yaml files adds item attribute with yaml file name and value of yaml file content
item