Class: MachineTags
- Inherits:
-
Object
- Object
- MachineTags
- Defined in:
- lib/flickrup/ext/machine_tags.rb
Instance Method Summary collapse
-
#initialize(config, context) ⇒ MachineTags
constructor
A new instance of MachineTags.
- #preupload(ctx) ⇒ Object
Constructor Details
#initialize(config, context) ⇒ MachineTags
Returns a new instance of MachineTags.
2 3 4 |
# File 'lib/flickrup/ext/machine_tags.rb', line 2 def initialize(config, context) @config = config end |
Instance Method Details
#preupload(ctx) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flickrup/ext/machine_tags.rb', line 6 def preupload(ctx) = ctx.file. remapped = .map do |x| x.sub(/^([^:]+):([^:]+)::/,"\\1:\\2=") end.uniq unless == remapped #write back to file ctx.file['Keywords'] = remapped ctx.file['Subject'] = remapped #also write Subject XMP tag end ctx end |