Skip to content

Commit

Permalink
provide a hook for skipping Wings
Browse files Browse the repository at this point in the history
this is a small foray into supporting a no-ActiveFedora application. allow a
hook to avoid requiring `ActiveFedora` based classes eagerly during startup.
  • Loading branch information
tamsin johnson committed Mar 30, 2021
1 parent 8d15ed7 commit 26f597e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/hyrax/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,18 @@ def banner_image
@banner_image ||= 'https://user-images.githubusercontent.com/101482/29949206-ffa60d2c-8e67-11e7-988d-4910b8787d56.jpg'
end

##
# @return [Boolean]
def disable_wings
return @disable_wings unless @disable_wings.nil?
ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_SKIP_WINGS', false))
end

def disable_wings=(val)
@disable_wings = val
end


attr_writer :display_media_download_link
# @return [Boolean]
def display_media_download_link?
Expand Down
2 changes: 1 addition & 1 deletion lib/hyrax/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Engine < ::Rails::Engine

initializer 'requires' do
require 'power_converters'
require 'wings'
require 'wings' unless Hyrax.config.disable_wings
end

initializer 'routing' do
Expand Down

0 comments on commit 26f597e

Please sign in to comment.