sqlite_log_filter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in sqlite_log_filter.gemspec
4
+ gemspec
data/README.markdown ADDED
@@ -0,0 +1,31 @@
1
+ Filter out the meta query from sqlite logs
2
+ ==========================================
3
+
4
+ Requirements
5
+ ------------
6
+ - activerecord (>= 3.0.9)
7
+
8
+ Who'is good for
9
+ ------------------
10
+ If your rails log is full with (this presumes that you are using sqlite):
11
+
12
+ SQL (0.8ms) SELECT name
13
+ FROM sqlite_master
14
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
15
+ SQL (0.6ms) SELECT name
16
+ FROM sqlite_master
17
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
18
+
19
+ Then this gem is for you.
20
+
21
+ Usage
22
+ -----
23
+ In our gemfile place this line
24
+
25
+ gem 'sqlite_log_filter'
26
+
27
+ then
28
+
29
+ bundle
30
+
31
+ and no more log messages.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,23 @@
1
+ require "sqlite_log_filter/version"
2
+
3
+ module ActiveRecord
4
+ module ConnectionAdapters # :nodoc:
5
+ class AbstractAdapter
6
+ def log( sql, name)
7
+ name ||= "SQL"
8
+ if sql.match(/sqlite_master/)
9
+ yield
10
+ else
11
+ @instrumenter.instrument("sql.active_record",
12
+ :sql => sql, :name => name, :connection_id => object_id) do
13
+ yield
14
+ end
15
+ end
16
+ rescue Exception => e
17
+ message = "#{e.class.name}: #{e.message}: #{sql}"
18
+ @logger.debug message if @logger
19
+ raise translate_exception(e, message)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module SqliteLogFilter
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "sqlite_log_filter/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "sqlite_log_filter"
7
+ s.version = SqliteLogFilter::VERSION
8
+ s.authors = ["Orban Botond"]
9
+ s.email = ["orbanbotond@logicoptimum.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Filter out the meta query from sqlite}
12
+ s.description = %q{No more '...sqlite_master...' queries in your log when using sqlite}
13
+
14
+ s.rubyforge_project = "sqlite_log_filter"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+ s.add_dependency('activerecord', '>= 3.0.9')
21
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sqlite_log_filter
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Orban Botond
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-07-18 00:00:00 +03:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: activerecord
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 3.0.9
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ description: No more '...sqlite_master...' queries in your log when using sqlite
28
+ email:
29
+ - orbanbotond@logicoptimum.com
30
+ executables: []
31
+
32
+ extensions: []
33
+
34
+ extra_rdoc_files: []
35
+
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - README.markdown
40
+ - Rakefile
41
+ - lib/sqlite_log_filter.rb
42
+ - lib/sqlite_log_filter/version.rb
43
+ - sqlite_log_filter.gemspec
44
+ has_rdoc: true
45
+ homepage: ""
46
+ licenses: []
47
+
48
+ post_install_message:
49
+ rdoc_options: []
50
+
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: "0"
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: "0"
65
+ requirements: []
66
+
67
+ rubyforge_project: sqlite_log_filter
68
+ rubygems_version: 1.6.2
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: Filter out the meta query from sqlite
72
+ test_files: []
73
+