whoops_logger 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,6 +1,15 @@
1
1
  module WhoopsLogger
2
2
  class Message
3
- ATTRIBUTES = [:event_type, :service, :environment, :message, :event_group_identifier, :event_time, :details]
3
+ ATTRIBUTES = [
4
+ :event_type,
5
+ :service,
6
+ :environment,
7
+ :message,
8
+ :event_group_identifier,
9
+ :event_time,
10
+ :details,
11
+ :logger_strategy_name
12
+ ]
4
13
  ATTRIBUTES.each do |attribute|
5
14
  attr_accessor attribute
6
15
  end
@@ -11,6 +11,7 @@ module WhoopsLogger
11
11
  self.strategy = strategy
12
12
  self.raw_data = raw_data
13
13
  self.message = Message.new
14
+ self.message.logger_strategy_name = strategy.respond_to?(:name) ? strategy.name : 'anonymous'
14
15
  end
15
16
 
16
17
  def create!
@@ -13,6 +13,16 @@ describe "WhoopsLogger::MessageCreator" do
13
13
  it "should not raise an exception if strategy argument responds to call" do
14
14
  lambda{WhoopsLogger::MessageCreator.new(Proc.new{}, {})}.should_not raise_exception
15
15
  end
16
+
17
+ it "sets the message's logger_strategy_name" do
18
+ mc = WhoopsLogger::MessageCreator.new(WhoopsLogger.strategies["default::basic"], {})
19
+ mc.message.logger_strategy_name.should == "default::basic"
20
+ end
21
+
22
+ it "sets the message's logger_strategy_name to anonymous if name method not present" do
23
+ mc = WhoopsLogger::MessageCreator.new(Proc.new{}, {})
24
+ mc.message.logger_strategy_name.should == "anonymous"
25
+ end
16
26
  end
17
27
 
18
28
  describe "#create!" do
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whoops_logger}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Higginbotham"]
12
- s.date = %q{2011-07-12}
12
+ s.date = %q{2011-07-21}
13
13
  s.description = %q{Handles basic notification responsibilities and allows creation of message creation strategies}
14
14
  s.email = %q{daniel@flyingmachinestudios.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whoops_logger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Higginbotham
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-12 00:00:00 -04:00
18
+ date: 2011-07-21 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency