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
9 10 11 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 9 def say_status("info", "ADDING ZOTERO/ARKIVO API INTEGRATION", :blue) end |
#copy_config_files ⇒ Object
Copy the config files for Zotero and Arkivo
29 30 31 32 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 29 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
24 25 26 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 24 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
14 15 16 17 18 19 20 21 |
# File 'lib/generators/hyrax/arkivo_api_generator.rb', line 14 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 |