Sha256: ff2f60fe56960779e155d6aab0f678ab0d31dfdb3cac98cd0912c9de81c61e0d
Contents?: true
Size: 871 Bytes
Versions: 4
Compression:
Stored size: 871 Bytes
Contents
require 'rails/generators' module BlacklightOaiProvider class InstallGenerator < Rails::Generators::Base argument :model_name, type: :string, default: "SolrDocument" argument :controller_name, type: :string, default: "CatalogController" def inject_solr_document_concern file_path = "app/models/#{model_name.underscore}.rb" if File.exist? file_path inject_into_file file_path, after: "include Blacklight::Solr::Document" do "\n include BlacklightOaiProvider::SolrDocument\n" end end end def inject_catalog_controller_concern file_path = "app/controllers/#{controller_name.underscore}.rb" if File.exist? file_path inject_into_file file_path, after: "include Blacklight::Catalog" do "\n include BlacklightOaiProvider::Controller\n" end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems