Class: MetaRequest::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/meta_request/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

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_pathObject



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_sizeObject

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_pathsObject

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