diff --git a/MIT-LICENSE b/MIT-LICENSE new file mode 100644 index 0000000..8eaf6db --- /dev/null +++ b/MIT-LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2008 [name of plugin creator] + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..96c5809 --- /dev/null +++ b/README @@ -0,0 +1,9 @@ +SilentPostgres +============== + +Silences internal diagnostic messages from postgresql connection adapter. + +Enabled only in development and test environments, skips production for +performance reasons - logging is probably disabled there anyway. + +Copyright (c) 2008 Ɓukasz Piestrzeniewicz, released under the MIT license diff --git a/init.rb b/init.rb new file mode 100644 index 0000000..b873ac2 --- /dev/null +++ b/init.rb @@ -0,0 +1,5 @@ +if %w(test development).include?(ENV["RAILS_ENV"]) + puts "Silencing Postgres" + require 'silent_postgres' + ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, SilentPostgres) +end \ No newline at end of file diff --git a/lib/.svn/all-wcprops b/lib/.svn/all-wcprops new file mode 100644 index 0000000..dec5440 --- /dev/null +++ b/lib/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 41 +/svn/!svn/ver/3/trunk/silent_postgres/lib +END +silent_postgres.rb +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/!svn/ver/3/trunk/silent_postgres/lib/silent_postgres.rb +END diff --git a/lib/.svn/entries b/lib/.svn/entries new file mode 100644 index 0000000..7a55f97 --- /dev/null +++ b/lib/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +3 +http://silent-postgres.googlecode.com/svn/trunk/silent_postgres/lib +http://silent-postgres.googlecode.com/svn + + + +2008-03-14T14:52:31.102621Z +3 +bragi.ragnarson + + + + + + + + + + + + + + +af053fb6-6648-0410-933e-cf740565ad39 + +silent_postgres.rb +file + + + + +2010-09-03T11:25:36.000000Z +6f4fa5a46a0b65a32a942bfbc089b505 +2008-03-14T14:46:41.921379Z +2 +bragi.ragnarson + + + + + + + + + + + + + + + + + + + + + +433 + diff --git a/lib/.svn/text-base/silent_postgres.rb.svn-base b/lib/.svn/text-base/silent_postgres.rb.svn-base new file mode 100644 index 0000000..f7113af --- /dev/null +++ b/lib/.svn/text-base/silent_postgres.rb.svn-base @@ -0,0 +1,19 @@ +module SilentPostgres + SILENCED_METHODS = %w(tables indexes column_definitions pk_and_sequence_for last_insert_id) + + def self.included(base) + SILENCED_METHODS.each do |m| + base.send :alias_method_chain, m, :silencer + end + end + + SILENCED_METHODS.each do |m| + eval <