silent-postgres 0.0.8 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  if Rails.env.development? || Rails.env.test?
2
2
 
3
3
  require "silent-postgres/railtie"
4
+ require "silent-postgres/schema_plus"
4
5
 
5
6
  module SilentPostgres
6
7
  SILENCED_METHODS = %w(tables table_exists? indexes column_definitions pk_and_sequence_for last_insert_id)
File without changes
@@ -0,0 +1,28 @@
1
+ module SilentPostgresSchemaPlus
2
+ SILENCED_METHODS = %w(indexes foreign_keys reverse_foreign_keys views view_definition)
3
+
4
+ def self.included(base)
5
+ SILENCED_METHODS.each do |m|
6
+ base.send :alias_method_chain, m, :silencer
7
+ end
8
+ end
9
+
10
+ SILENCED_METHODS.each do |m|
11
+ eval <<-METHOD
12
+ def #{m}_with_silencer(*args)
13
+ @logger.silence do
14
+ #{m}_without_silencer(*args)
15
+ end
16
+ end
17
+ METHOD
18
+ end
19
+ end
20
+
21
+ begin
22
+ require "schema_plus/active_record/connection_adapters/postgresql_adapter"
23
+ if defined?(SchemaPlus::ActiveRecord::ConnectionAdapters::PostgresqlAdapter)
24
+ SchemaPlus::ActiveRecord::ConnectionAdapters::PostgresqlAdapter.send(:include, SilentPostgresSchemaPlus)
25
+ end
26
+ rescue LoadError
27
+ # do nothing
28
+ end
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{silent-postgres}
5
- s.version = "0.0.8"
5
+ s.version = "0.1.1"
6
6
  s.summary = %q{Rails plugin that silences Postgresql connection adapter verbose output}
7
7
  s.email = ['bragi@ragnarson.com', 'dolzenko@gmail.com']
8
8
  s.homepage = %q{http://github.com/dolzenko/silent-postgres}
9
9
  s.authors = ["Łukasz Piestrzeniewicz", "Evgeniy Dolzhenko"]
10
- s.files = ["MIT-LICENSE", "README", "lib", "silent-postgres.gemspec", "lib/silent-postgres", "lib/silent-postgres/railtie.rb", "lib/silent-postgres.rb", "init.rb"]
10
+ s.files = ["MIT-LICENSE", "README", "silent-postgres.gemspec", "lib/silent-postgres/railtie.rb", "lib/silent-postgres/schema_plus.rb", "lib/silent-postgres.rb", "init.rb"]
11
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silent-postgres
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 0
9
- - 8
10
- version: 0.0.8
8
+ - 1
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "\xC5\x81ukasz Piestrzeniewicz"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-04-18 00:00:00 +01:00
19
+ date: 2011-08-25 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
@@ -35,6 +35,7 @@ files:
35
35
  - README
36
36
  - silent-postgres.gemspec
37
37
  - lib/silent-postgres/railtie.rb
38
+ - lib/silent-postgres/schema_plus.rb
38
39
  - lib/silent-postgres.rb
39
40
  - init.rb
40
41
  has_rdoc: true