Skip to content

Commit

Permalink
Conform to standard option and add YARD doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Collier committed Jun 13, 2017
1 parent 275e92d commit 5a4fd21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/services/hyrax/file_set_derivatives_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/generators/hyrax/templates/config/hyrax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib/hyrax/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a4fd21

Please sign in to comment.