Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/raven/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class Configuration

attr_accessor :server_name

attr_accessor :release

# DEPRECATED: This option is now ignored as we use our own adapter.
attr_accessor :json_adapter

Expand Down
4 changes: 3 additions & 1 deletion lib/raven/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Event

attr_reader :id
attr_accessor :project, :message, :timestamp, :time_spent, :level, :logger,
:culprit, :server_name, :modules, :extra, :tags, :context, :configuration
:culprit, :server_name, :release, :modules, :extra, :tags, :context, :configuration

def initialize(init = {})
@configuration = Raven.configuration
Expand All @@ -38,6 +38,7 @@ def initialize(init = {})
@logger = 'root'
@culprit = nil
@server_name = @configuration.server_name || get_hostname
@release = @configuration.release
@modules = get_modules if @configuration.send_modules
@user = {}
@extra = {}
Expand Down Expand Up @@ -103,6 +104,7 @@ def to_hash
}
data[:culprit] = @culprit if @culprit
data[:server_name] = @server_name if @server_name
data[:release] = @release if @release
data[:modules] = @modules if @modules
data[:extra] = @extra if @extra
data[:tags] = @tags if @tags
Expand Down
5 changes: 5 additions & 0 deletions spec/raven/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'my_custom_variable' => 'value'
},
:server_name => 'foo.local',
:release => '721e41770371db95eee98ca2707686226b993eda',
}).to_hash
end

Expand All @@ -37,6 +38,10 @@
expect(hash[:server_name]).to eq('foo.local')
end

it 'has release' do
expect(hash[:release]).to eq('721e41770371db95eee98ca2707686226b993eda')
end

it 'has tag data' do
expect(hash[:tags]).to eq({
'foo' => 'bar'
Expand Down