Class: Raven::Context
- Inherits:
-
Object
- Object
- Raven::Context
- Defined in:
- lib/raven/context.rb
Instance Attribute Summary collapse
-
#extra ⇒ Object
Returns the value of attribute extra.
-
#rack_env ⇒ Object
Returns the value of attribute rack_env.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#server_os ⇒ Object
Returns the value of attribute server_os.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#transaction ⇒ Object
Returns the value of attribute transaction.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize ⇒ Context
Returns a new instance of Context.
15 16 17 18 19 20 21 22 23 |
# File 'lib/raven/context.rb', line 15 def initialize self.server_os = self.class.os_context self.runtime = self.class.runtime_context self.extra = { :server => { :os => server_os, :runtime => runtime } } self.rack_env = nil self. = {} self.user = {} self.transaction = [] end |
Instance Attribute Details
#extra ⇒ Object
Returns the value of attribute extra.
13 14 15 |
# File 'lib/raven/context.rb', line 13 def extra @extra end |
#rack_env ⇒ Object
Returns the value of attribute rack_env.
13 14 15 |
# File 'lib/raven/context.rb', line 13 def rack_env @rack_env end |
#runtime ⇒ Object
Returns the value of attribute runtime.
13 14 15 |
# File 'lib/raven/context.rb', line 13 def runtime @runtime end |
#server_os ⇒ Object
Returns the value of attribute server_os.
13 14 15 |
# File 'lib/raven/context.rb', line 13 def server_os @server_os end |
#tags ⇒ Object
Returns the value of attribute tags.
13 14 15 |
# File 'lib/raven/context.rb', line 13 def @tags end |
#transaction ⇒ Object
Returns the value of attribute transaction.
13 14 15 |
# File 'lib/raven/context.rb', line 13 def transaction @transaction end |
#user ⇒ Object
Returns the value of attribute user.
13 14 15 |
# File 'lib/raven/context.rb', line 13 def user @user end |
Class Method Details
.clear! ⇒ Object
9 10 11 |
# File 'lib/raven/context.rb', line 9 def self.clear! Thread.current[:sentry_context] = nil end |
.current ⇒ Object
5 6 7 |
# File 'lib/raven/context.rb', line 5 def self.current Thread.current[:sentry_context] ||= new end |
.os_context ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/raven/context.rb', line 26 def os_context @os_context ||= { :name => Raven.sys_command("uname -s") || RbConfig::CONFIG["host_os"], :version => Raven.sys_command("uname -v"), :build => Raven.sys_command("uname -r"), :kernel_version => Raven.sys_command("uname -a") || Raven.sys_command("ver") # windows } end |
.runtime_context ⇒ Object
35 36 37 38 39 40 |
# File 'lib/raven/context.rb', line 35 def runtime_context @runtime_context ||= { :name => RbConfig::CONFIG["ruby_install_name"], :version => Raven.sys_command("ruby -v") } end |