td-logger 0.3.14 → 0.3.15

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/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ == 2012-11-14 version 0.3.15
2
+
3
+ * Removing InstanceMethods as it is deprecated in Rails 3.2 and
4
+ yields warning. issue #3
5
+ * Add ActiveSupport::TimeWithZone#to_msgpack. issue #4
6
+
1
7
 
2
8
  == 2012-07-26 version 0.3.14
3
9
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.14
1
+ 0.3.15
@@ -7,24 +7,15 @@ module Agent::Rails
7
7
  ::ActionController::Base.send(:include, self)
8
8
  end
9
9
 
10
- if defined?(ActiveSupport::Concern)
11
- extend ActiveSupport::Concern
12
- else
13
- # Rails 2
14
- def self.included(mod)
15
- im = InstanceMethods
16
- cm = ClassMethods
17
- mod.class_eval do
18
- include im
19
- extend cm
20
- end
10
+ def self.included(mod)
11
+ cm = ClassMethods
12
+ mod.class_eval do
13
+ extend cm
21
14
  end
22
15
  end
23
16
 
24
- module InstanceMethods
25
- def event
26
- TreasureData::Logger.event
27
- end
17
+ def event
18
+ TreasureData::Logger.event
28
19
  end
29
20
 
30
21
  module ClassMethods
@@ -14,23 +14,13 @@ module Agent::Rails
14
14
  ::ActiveRecord::Base.send(:include, self)
15
15
  end
16
16
 
17
- if defined?(ActiveSupport::Concern)
18
- extend ActiveSupport::Concern
19
- else
20
- # Rails 2
21
- def self.included(mod)
22
- im = InstanceMethods
23
- cm = ClassMethods
24
- mod.class_eval do
25
- include im
26
- extend cm
27
- end
17
+ def self.included(mod)
18
+ cm = ClassMethods
19
+ mod.class_eval do
20
+ extend cm
28
21
  end
29
22
  end
30
23
 
31
- module InstanceMethods
32
- end
33
-
34
24
  module ClassMethods
35
25
  def td_enable_model_tracer(tag, options={})
36
26
  only = nil
@@ -47,6 +47,14 @@ module Agent::Rails
47
47
  TreasureData::Logger::Agent::Rails.init(::Rails.configuration)
48
48
  end
49
49
 
50
+ # implement ActiveSupport::TimeWithZone#to_msgpack
51
+ unless ActiveSupport::TimeWithZone.method_defined?(:to_msgpack)
52
+ class ActiveSupport::TimeWithZone
53
+ def to_msgpack(out='')
54
+ strftime("%Y-%m-%d %H:%M:%S %z").to_msgpack(out)
55
+ end
56
+ end
57
+ end
50
58
  end
51
59
  end
52
60
  end
@@ -1,7 +1,7 @@
1
1
  module TreasureData
2
2
  module Logger
3
3
 
4
- VERSION = '0.3.14'
4
+ VERSION = '0.3.15'
5
5
 
6
6
  end
7
7
  end
@@ -36,6 +36,11 @@ class ActionController
36
36
  end
37
37
  end
38
38
 
39
+ class ActiveSupport
40
+ class TimeWithZone
41
+ end
42
+ end
43
+
39
44
  require 'td/logger/agent/rails'
40
45
 
41
46
  describe TreasureData::Logger::Agent::Rails::Config do
@@ -114,3 +119,8 @@ EOF
114
119
  end
115
120
  end
116
121
 
122
+ describe ActiveSupport::TimeWithZone do
123
+ it 'has to_msgpack' do
124
+ ActiveSupport::TimeWithZone.method_defined?(:to_msgpack).should be_true
125
+ end
126
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-26 00:00:00.000000000 Z
12
+ date: 2012-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -147,4 +147,3 @@ test_files:
147
147
  - spec/rails_config_spec.rb
148
148
  - spec/spec_helper.rb
149
149
  - spec/td_logger_spec.rb
150
- has_rdoc: