Class: Yeller::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/yeller/configuration.rb

Constant Summary collapse

DEFAULT_SERVERS =
[
  Yeller::SecureServer.new("collector1.yellerapp.com", 443),
  Yeller::SecureServer.new("collector2.yellerapp.com", 443),
  Yeller::SecureServer.new("collector3.yellerapp.com", 443),
  Yeller::SecureServer.new("collector4.yellerapp.com", 443),
  Yeller::SecureServer.new("collector5.yellerapp.com", 443),
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
17
18
# File 'lib/yeller/configuration.rb', line 14

def initialize
  @servers = DEFAULT_SERVERS
  @startup_params = {}
  @error_handler = Yeller::LogErrorHandler.new
end

Instance Attribute Details

#error_handlerObject

Returns the value of attribute error_handler.



5
6
7
# File 'lib/yeller/configuration.rb', line 5

def error_handler
  @error_handler
end

#project_rootObject

Returns the value of attribute project_root.



5
6
7
# File 'lib/yeller/configuration.rb', line 5

def project_root
  @project_root
end

#serversObject (readonly)

Returns the value of attribute servers.



5
6
7
# File 'lib/yeller/configuration.rb', line 5

def servers
  @servers
end

#startup_paramsObject (readonly)

Returns the value of attribute startup_params.



5
6
7
# File 'lib/yeller/configuration.rb', line 5

def startup_params
  @startup_params
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/yeller/configuration.rb', line 5

def token
  @token
end

Instance Method Details

#add_insecure_server(host, port = 80) ⇒ Object



30
31
32
# File 'lib/yeller/configuration.rb', line 30

def add_insecure_server(host, port=80)
  @servers << Yeller::Server.new(host, port)
end

#add_server(host, port = 443) ⇒ Object



25
26
27
28
# File 'lib/yeller/configuration.rb', line 25

def add_server(host, port=443)
  @servers << Yeller::SecureServer.new(host, port)
  self
end

#backtrace_filtersObject



34
35
36
37
38
39
40
41
42
43
# File 'lib/yeller/configuration.rb', line 34

def backtrace_filters
  filters = []
  if defined?(Gem)
    Gem.path.each do |gem_path|
      filters << [gem_path, 'GEM_ROOT']
    end
  end
  filters << [project_root, 'PROJECT_ROOT']
  filters
end

#environment=(new_environment) ⇒ Object



45
46
47
# File 'lib/yeller/configuration.rb', line 45

def environment=(new_environment)
  @startup_params[:"application-environment"] = new_environment
end

#host=(new_host) ⇒ Object



49
50
51
# File 'lib/yeller/configuration.rb', line 49

def host=(new_host)
  @startup_params[:host] = new_host
end

#remove_default_serversObject



20
21
22
23
# File 'lib/yeller/configuration.rb', line 20

def remove_default_servers
  @servers = []
  self
end