Class: Hyrax::ArkivoApiGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Hyrax::ArkivoApiGenerator
- Defined in:
- lib/generators/hyrax/arkivo_api_generator.rb
Instance Method Summary collapse
- #banner ⇒ Object
-
#copy_config_files ⇒ Object
Copy the config files for Zotero and Arkivo.
-
#copy_routing_constraint ⇒ Object
Copy the routing constraint over.
-
#inject_arkivo_config ⇒ Object
Turn on the feature set in Hyrax’s config.
Instance Method Details
#banner ⇒ Object
8 9 10 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 8 def say_status("info", "ADDING ZOTERO/ARKIVO API INTEGRATION", :blue) end |
#copy_config_files ⇒ Object
Copy the config files for Zotero and Arkivo
28 29 30 31 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 28 def copy_config_files copy_file 'config/arkivo.yml', 'config/arkivo.yml' copy_file 'config/zotero.yml', 'config/zotero.yml' end |
#copy_routing_constraint ⇒ Object
Copy the routing constraint over
23 24 25 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 23 def copy_routing_constraint copy_file 'config/arkivo_constraint.rb', 'config/initializers/arkivo_constraint.rb' end |
#inject_arkivo_config ⇒ Object
Turn on the feature set in Hyrax’s config
13 14 15 16 17 18 19 20 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 13 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 |