From 5a4fd216b1ac7997684c876befc12d8ebb84bc87 Mon Sep 17 00:00:00 2001 From: Collier Date: Tue, 13 Jun 2017 10:46:16 -0700 Subject: [PATCH] Conform to standard option and add YARD doc --- app/services/hyrax/file_set_derivatives_service.rb | 4 ++++ lib/generators/hyrax/templates/config/hyrax.rb | 4 ++-- lib/hyrax/configuration.rb | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/services/hyrax/file_set_derivatives_service.rb b/app/services/hyrax/file_set_derivatives_service.rb index 330fbf16a1..af0df36844 100644 --- a/app/services/hyrax/file_set_derivatives_service.rb +++ b/app/services/hyrax/file_set_derivatives_service.rb @@ -82,6 +82,10 @@ def derivative_path_factory Hyrax::DerivativePath end + # Calls the Hydra::Derivates::FulltextExtraction unless the extract_full_text + # configuration option is set to false + # @param [String] filename of the object to be used for full text extraction + # @param [String] uri to the files set (deligated to file_set) def extract_full_text(filename, uri) return unless Hyrax.config.extract_full_text? Hydra::Derivatives::FullTextExtract.create(filename, diff --git a/lib/generators/hyrax/templates/config/hyrax.rb b/lib/generators/hyrax/templates/config/hyrax.rb index 4834efccf9..067ad2efae 100644 --- a/lib/generators/hyrax/templates/config/hyrax.rb +++ b/lib/generators/hyrax/templates/config/hyrax.rb @@ -75,8 +75,8 @@ # config.libreoffice_path = "soffice" # Option to enable/disable full text extraction from PDFs - # Default is false, set to true to skip extraction - config.extract_full_text = true + # Default is true, set to false to disable full text extraction + # config.extract_full_text = true # How many seconds back from the current time that we should show by default of the user's activity on the user's dashboard # config.activity_to_show_default_seconds_since_now = 24*60*60 diff --git a/lib/hyrax/configuration.rb b/lib/hyrax/configuration.rb index 88292a912d..d2652ca776 100644 --- a/lib/hyrax/configuration.rb +++ b/lib/hyrax/configuration.rb @@ -375,7 +375,8 @@ def subject_prefix attr_writer :extract_full_text def extract_full_text? - @extract_full_text ||= false + return @extract_full_text unless @extract_full_text.nil? + @extract_full_text = true end private