Sha256: 3bdb0a2faa6eb735d521c08691001fe4281891f7026adf5cfb7a8a6ff5571074
Contents?: true
Size: 817 Bytes
Versions: 13
Compression:
Stored size: 817 Bytes
Contents
# -*- encoding : utf-8 -*- require 'rails/generators' module Curate::Work class WithDoiGenerator < Rails::Generators::Base argument :targets, type: :array, required: true, banner: "target, target" def append_doi_initializer options = targets options << [%(--target='{|obj| Curate.permanent_url_for(obj) }')] options << [%(--creator=:creator)] options << [%(--title=:title)] options << [%(--publisher='{|o| Array(o.publisher).join("; ")}')] options << [%(--publication_year='{|o| o.date_uploaded.year }')] options << [%(--set_identifier='{|o,value| o.identifier = value; o.save }')] args = ['hydra:remote_identifier:doi', options.join(" ")] if behavior == :revoke destroy(*args) else generate(*args) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems