Creating a Metadata File using the MyMedia-card Gem

require 'mymedia-card' 

mmc = '/home/james/', 
                                            public_type: 'images', ext: '.jpg')

File (meta040515T1548.txt) observed after exectution:

<?kvx type='images'?>
title: Arduino Pro Mini
tags: arduino promini

file: arduino-pro-mini.jpg

How did it create the file?

Using the file path provided from the config file along with parameters public_type: and ext: it found the latest image file (Arduino-Pro-Mini--arduino--promini.jpg) to be published. It then extracted the information from the filename and then renamed the original file.

Why do this?

The idea is that it's easier and more convenient for me to create information about a file by simply saving the filename with relevant information.

Config file used

Below is a copy of the config file I used. Some of the entries aren't used by the script however I have preserved it for completeness.

# file: mymedia.conf

home: /home/james/
username: user
password: *****

www: www
index_page: true
log: /home/james/mm.log

  address: sps
  default_subscriber: mymedia/jr/s1
views: /home/james/da2