Class: CurationConcerns::Configuration
- Inherits:
-
Object
- Object
- CurationConcerns::Configuration
- Includes:
- Callbacks
- Defined in:
- lib/curation_concerns/configuration.rb
Instance Attribute Summary collapse
-
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
-
#analytics ⇒ Object
Returns the value of attribute analytics.
-
#characterization_runner ⇒ Object
Override characterization runner.
- #default_antivirus_instance ⇒ Object
- #derivatives_path ⇒ Object
- #display_microdata ⇒ Object
- #enable_ffmpeg ⇒ Object
-
#enable_local_ingest ⇒ Object
Returns the value of attribute enable_local_ingest.
- #enable_noids ⇒ Object
- #ffmpeg_path ⇒ Object
- #fits_message_length ⇒ Object
- #fits_path ⇒ Object
- #lock_retry_count ⇒ Object
- #lock_retry_delay ⇒ Object
- #lock_time_to_live ⇒ Object
- #max_days_between_audits ⇒ Object
- #microdata_default_type ⇒ Object
- #minter_statefile ⇒ Object
- #noid_template ⇒ Object
- #redis_namespace ⇒ Object
-
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
- #working_path ⇒ Object
Instance Method Summary collapse
-
#curation_concerns ⇒ Array<Class>
The registered curation concerns.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#register_curation_concern(*curation_concern_types) ⇒ Object
Registers the given curation concern model in the configuration.
-
#registered_curation_concern_types ⇒ Array<String>
The normalization done by this method must occur after the initialization process so it can take advantage of irregular inflections from config/initializers/inflections.rb.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 |
# File 'lib/curation_concerns/configuration.rb', line 17 def initialize @registered_concerns = [] end |
Instance Attribute Details
#analytic_start_date ⇒ Object
Returns the value of attribute analytic_start_date.
59 60 61 |
# File 'lib/curation_concerns/configuration.rb', line 59 def analytic_start_date @analytic_start_date end |
#analytics ⇒ Object
Returns the value of attribute analytics.
59 60 61 |
# File 'lib/curation_concerns/configuration.rb', line 59 def analytics @analytics end |
#characterization_runner ⇒ Object
Override characterization runner
105 106 107 |
# File 'lib/curation_concerns/configuration.rb', line 105 def characterization_runner @characterization_runner end |
#default_antivirus_instance ⇒ Object
25 26 27 28 29 |
# File 'lib/curation_concerns/configuration.rb', line 25 def default_antivirus_instance @default_antivirus_instance ||= lambda do |_file_path| AntiVirusScanner::NO_VIRUS_FOUND_RETURN_VALUE end end |
#derivatives_path ⇒ Object
33 34 35 |
# File 'lib/curation_concerns/configuration.rb', line 33 def derivatives_path @derivatives_path ||= File.join(Rails.root, 'tmp', 'derivatives') end |
#display_microdata ⇒ Object
63 64 65 66 |
# File 'lib/curation_concerns/configuration.rb', line 63 def display_microdata return @display_microdata unless @display_microdata.nil? @display_microdata = true end |
#enable_ffmpeg ⇒ Object
44 45 46 47 |
# File 'lib/curation_concerns/configuration.rb', line 44 def enable_ffmpeg return @enable_ffmpeg unless @enable_ffmpeg.nil? @enable_ffmpeg = false end |
#enable_local_ingest ⇒ Object
Returns the value of attribute enable_local_ingest.
59 60 61 |
# File 'lib/curation_concerns/configuration.rb', line 59 def enable_local_ingest @enable_local_ingest end |
#enable_noids ⇒ Object
79 80 81 82 |
# File 'lib/curation_concerns/configuration.rb', line 79 def enable_noids return @enable_noids unless @enable_noids.nil? @enable_noids = true end |
#ffmpeg_path ⇒ Object
50 51 52 |
# File 'lib/curation_concerns/configuration.rb', line 50 def ffmpeg_path @ffmpeg_path ||= 'ffmpeg' end |
#fits_message_length ⇒ Object
55 56 57 |
# File 'lib/curation_concerns/configuration.rb', line 55 def @fits_message_length ||= 5 end |
#fits_path ⇒ Object
100 101 102 |
# File 'lib/curation_concerns/configuration.rb', line 100 def fits_path @fits_path ||= 'fits.sh' end |
#lock_retry_count ⇒ Object
111 112 113 |
# File 'lib/curation_concerns/configuration.rb', line 111 def lock_retry_count @lock_retry_count ||= 600 # Up to 2 minutes of trying at intervals up to 200ms end |
#lock_retry_delay ⇒ Object
125 126 127 |
# File 'lib/curation_concerns/configuration.rb', line 125 def lock_retry_delay @lock_retry_delay ||= 200 # milliseconds end |
#lock_time_to_live ⇒ Object
118 119 120 |
# File 'lib/curation_concerns/configuration.rb', line 118 def lock_time_to_live @lock_time_to_live ||= 60_000 # milliseconds end |
#max_days_between_audits ⇒ Object
74 75 76 |
# File 'lib/curation_concerns/configuration.rb', line 74 def max_days_between_audits @max_days_between_audits ||= 7 end |
#microdata_default_type ⇒ Object
69 70 71 |
# File 'lib/curation_concerns/configuration.rb', line 69 def microdata_default_type @microdata_default_type ||= 'http://schema.org/CreativeWork' end |
#minter_statefile ⇒ Object
90 91 92 |
# File 'lib/curation_concerns/configuration.rb', line 90 def minter_statefile @minter_statefile ||= '/tmp/minter-state' end |
#noid_template ⇒ Object
85 86 87 |
# File 'lib/curation_concerns/configuration.rb', line 85 def noid_template @noid_template ||= '.reeddeeddk' end |
#redis_namespace ⇒ Object
95 96 97 |
# File 'lib/curation_concerns/configuration.rb', line 95 def redis_namespace @redis_namespace ||= 'curation_concerns' end |
#temp_file_base ⇒ Object
Returns the value of attribute temp_file_base.
59 60 61 |
# File 'lib/curation_concerns/configuration.rb', line 59 def temp_file_base @temp_file_base end |
#working_path ⇒ Object
39 40 41 |
# File 'lib/curation_concerns/configuration.rb', line 39 def working_path @working_path ||= File.join(Rails.root, 'tmp', 'uploads') end |
Instance Method Details
#curation_concerns ⇒ Array<Class>
Returns the registered curation concerns.
153 154 155 |
# File 'lib/curation_concerns/configuration.rb', line 153 def curation_concerns registered_curation_concern_types.map(&:constantize) end |
#register_curation_concern(*curation_concern_types) ⇒ Object
Registers the given curation concern model in the configuration
137 138 139 140 141 142 143 |
# File 'lib/curation_concerns/configuration.rb', line 137 def register_curation_concern(*curation_concern_types) Array(curation_concern_types).flatten.compact.each do |cc_type| unless @registered_concerns.include?(cc_type) @registered_concerns << cc_type end end end |
#registered_curation_concern_types ⇒ Array<String>
The normalization done by this method must occur after the initialization process so it can take advantage of irregular inflections from config/initializers/inflections.rb
148 149 150 |
# File 'lib/curation_concerns/configuration.rb', line 148 def registered_curation_concern_types @registered_concerns.map { |cc_type| normalize_concern_name(cc_type) } end |