pg_decorator 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ ## 0.0.4
2
+
3
+ Features:
4
+
5
+ - PgConnection initialize sets application_name
6
+ - Changelog added
7
+
8
+ ## 0.0.3
9
+
10
+ Bugfixes:
11
+
12
+ - Rails dependency removed
13
+
14
+ ## 0.0.2
15
+
16
+ Features:
17
+
18
+ - First public version
19
+
20
+ ## 0.0.1
21
+
22
+ Features:
23
+
24
+ - First semi-private version :)
data/lib/pg_decorator.rb CHANGED
@@ -1,10 +1,2 @@
1
1
  require "pg_decorator/version"
2
2
  require "pg_decorator/injector"
3
-
4
-
5
- module PgDecorator
6
- module PgInstrumentation
7
- end
8
-
9
-
10
- end
@@ -2,6 +2,9 @@ module PgDecorator
2
2
  module Decorator
3
3
  def self.included(instrumented_class)
4
4
  instrumented_class.class_eval do
5
+ alias_method :initialize_without_sql_decorator, :initialize
6
+ alias_method :initialize, :initialize_with_sql_decorator
7
+
5
8
  alias_method :async_exec_without_sql_decorator, :async_exec
6
9
  alias_method :async_exec, :async_exec_with_sql_decorator
7
10
 
@@ -41,6 +44,11 @@ module PgDecorator
41
44
  escape_string( str.gsub('*/','* /'))
42
45
  end
43
46
 
47
+ def initialize_with_sql_decorator(*args, &block)
48
+ initialize_without_sql_decorator(*args, &block)
49
+ exec_without_sql_decorator("set application_name = '#{escape_string(self.app_name)}';") {true}
50
+ self
51
+ end
44
52
 
45
53
  def async_exec_with_sql_decorator(sql,*args, &block)
46
54
  async_exec_without_sql_decorator(decorate_sql(sql), *args, &block)
@@ -1,3 +1,3 @@
1
1
  module PgDecorator
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_decorator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -35,6 +35,7 @@ extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
37
  - .gitignore
38
+ - CHANGELOG.md
38
39
  - Gemfile
39
40
  - LICENSE.txt
40
41
  - README.md
@@ -58,7 +59,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
58
59
  version: '0'
59
60
  segments:
60
61
  - 0
61
- hash: -2000640059584004228
62
+ hash: 841629124710034432
62
63
  required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  none: false
64
65
  requirements:
@@ -67,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
68
  version: '0'
68
69
  segments:
69
70
  - 0
70
- hash: -2000640059584004228
71
+ hash: 841629124710034432
71
72
  requirements: []
72
73
  rubyforge_project:
73
74
  rubygems_version: 1.8.24