Class: MetaRequest::Config
- Inherits:
-
Object
- Object
- MetaRequest::Config
- Defined in:
- lib/meta_request/config.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
logger used for reporting gem’s fatal errors.
- #source_path ⇒ Object
-
#storage_pool_size ⇒ Object
Number of files kept in storage.
Instance Method Summary collapse
-
#ignored_paths ⇒ Object
List of relative paths inside Rails app.
- #ignored_paths=(paths) ⇒ Object
Instance Attribute Details
#logger ⇒ Object
logger used for reporting gem’s fatal errors
8 9 10 |
# File 'lib/meta_request/config.rb', line 8 def logger @logger ||= Logger.new(File.join(Rails.root, 'log', 'meta_request.log')) end |
#source_path ⇒ Object
18 19 20 |
# File 'lib/meta_request/config.rb', line 18 def source_path @source_path ||= ENV['SOURCE_PATH'] || Rails.root.to_s end |
#storage_pool_size ⇒ Object
Number of files kept in storage. Increase when using an application loading many simultaneous requests.
14 15 16 |
# File 'lib/meta_request/config.rb', line 14 def storage_pool_size @storage_pool_size ||= 20 end |
Instance Method Details
#ignored_paths ⇒ Object
List of relative paths inside Rails app. Used in Location calculation.
23 24 25 26 |
# File 'lib/meta_request/config.rb', line 23 def ignored_paths self.ignored_paths = %w[bin vendor] unless @ignored_paths @ignored_paths end |
#ignored_paths=(paths) ⇒ Object
28 29 30 31 32 |
# File 'lib/meta_request/config.rb', line 28 def ignored_paths=(paths) @ignored_paths = paths.map do |path| Rails.root.join(path).to_s.freeze end.freeze end |