Sha256: 918a24d8921431f1fcd2c679145d605386019a8be40fa7ae472fe50f9c9a5e28

Contents?: true

Size: 1.05 KB

Versions: 58

Compression:

Stored size: 1.05 KB

Contents

class Hyrax::ArkivoApiGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)

  desc """
This generator sets up Zotero/Arkivo API integration for your application:
       """

  def banner
    say_status("info", "ADDING ZOTERO/ARKIVO API INTEGRATION", :blue)
  end

  # Turn on the feature set in Hyrax's config
  def inject_arkivo_config
    inject_into_file 'config/initializers/hyrax.rb', after: /^Hyrax\.config do.*$/ do
      "\n  # Hyrax can integrate with Zotero's Arkivo service for automatic deposit\n" \
        "  # of Zotero-managed research items.\n" \
        "  # Defaults to false.  See README for more info\n" \
        "  config.arkivo_api = true\n"
    end
  end

  # Copy the routing constraint over
  def copy_routing_constraint
    copy_file 'config/arkivo_constraint.rb', 'config/initializers/arkivo_constraint.rb'
  end

  # Copy the config files for Zotero and Arkivo
  def copy_config_files
    copy_file 'config/arkivo.yml', 'config/arkivo.yml'
    copy_file 'config/zotero.yml', 'config/zotero.yml'
  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.9.5 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.9.4 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.9.3 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.9.2 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.9.1 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.9.0 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.8.0 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.7.2 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.7.1 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.7.0 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.6.0 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-3.0.0.pre.rc1 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-3.0.0.pre.beta3 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.5.1 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.5.0 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-3.0.0.pre.beta2 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.4.1 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-3.0.0.pre.beta1 lib/generators/hyrax/arkivo_api_generator.rb
hyrax-2.4.0 lib/generators/hyrax/arkivo_api_generator.rb