Class: RorVsWild::Installer

Inherits:
Object
  • Object
show all
Defined in:
lib/rorvswild/installer.rb

Constant Summary collapse

PATH =
"config/rorvswild.yml"

Class Method Summary collapse

Class Method Details

.create_rails_config(api_key) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/rorvswild/installer.rb', line 5

def self.create_rails_config(api_key)
  if File.directory?("config")
    if !File.exists?(PATH)
      File.write(PATH, template(api_key))
      puts "File #{PATH} has been created. Restart / deploy your app to start collecting data."
    else
      puts "File #{PATH} already exists."
    end
  else
    puts "There is no config directory to create #{PATH}."
  end
end

.template(api_key) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/rorvswild/installer.rb', line 18

def self.template(api_key)
  <<YAML
production:
  api_key: #{api_key}
# ignore_requests: # Do not monitor the following actions
#   - SecretController#index
# ignore_jobs: # Do not monitor the following jobs
#   - SecretJob
# ignore_exceptions: # Do not record the following exceptions
#   - ActionController::RoutingError  # By default to ignore 404
# ignore_plugins:
#   - ActionController
#   - ActionMailer
#   - ActionView
#   - ActiveJob
#   - ActiveRecord
#   - DelayedJob
#   - Elasticsearch
#   - Mongo
#   - NetHttp
#   - Redis
#   - Resque
#   - Sidekiq
# logger: log/rorvswild.log # By default it uses Rails.logger or Logger.new(STDOUT)
YAML
end