td-logger 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ == 2011-09-08 version 0.2.2
3
+
4
+ * Use ERB before loading conf/treasure_data.yml
5
+
6
+
2
7
  == 2011-09-03 version 0.2.1
3
8
 
4
9
  * Logs HTTP method, URI and UA by default in access log.
@@ -83,9 +83,13 @@ EOF
83
83
  end
84
84
 
85
85
  def self.read_config(rails)
86
+ require 'yaml'
87
+ require 'erb'
86
88
  logger = ::Rails.logger || ::Logger.new(STDOUT)
87
89
  begin
88
- yaml = YAML.load_file("#{rails_root}/#{CONFIG_PATH}")
90
+ src = File.read("#{rails_root}/#{CONFIG_PATH}")
91
+ yaml = ERB.new(src).result
92
+ env_conf = YAML.load(yaml)
89
93
  rescue
90
94
  logger.warn "Can't load #{CONFIG_PATH} file."
91
95
  logger.warn " #{$!}"
@@ -94,7 +98,7 @@ EOF
94
98
  return
95
99
  end
96
100
 
97
- conf = yaml[rails_env]
101
+ conf = env_conf[rails_env]
98
102
  unless conf
99
103
  logger.warn "#{CONFIG_PATH} doesn't include setting for current environment (#{rails_env})."
100
104
  logger.warn "Disabling Treasure Data logger."
@@ -1,7 +1,7 @@
1
1
  module TreasureData
2
2
  module Logger
3
3
 
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
 
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td-logger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sadayuki Furuhashi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-03 00:00:00 +09:00
18
+ date: 2011-09-08 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -120,6 +120,6 @@ rubyforge_project:
120
120
  rubygems_version: 1.3.7
121
121
  signing_key:
122
122
  specification_version: 3
123
- summary: Treasure Data logging library fro Rails
123
+ summary: Treasure Data logging library for Rails
124
124
  test_files: []
125
125