marginalia 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of marginalia might be problematic. Click here for more details.

data/README.md CHANGED
@@ -12,14 +12,16 @@ For example, once enabled, your logs will look like:
12
12
  LIMIT 1
13
13
  /*application:BCX,controller:project_imports,action:show*/
14
14
 
15
- You can also these query comments with a tool like [pt-query-digest](http://www.percona.com/doc/percona-toolkit/2.1/pt-query-digest.html#query-reviews)
15
+ You can also use these query comments along with a tool like [pt-query-digest](http://www.percona.com/doc/percona-toolkit/2.1/pt-query-digest.html#query-reviews)
16
16
  to automate identification of controllers and actions that are hotspots forslow queries.
17
17
 
18
18
  This gem was created at 37signals. You can read more about how we use it [on
19
19
  our blog](http://37signals.com/svn/posts/3130-tech-note-mysql-query-comments-in-rails).
20
20
 
21
21
  This has been tested and used in production with both the mysql and mysql2 gems,
22
- tested on Rails 2.3.5 through 3.2-stable. Patches are welcome for other database adapters.
22
+ tested on Rails 2.3.5 through 3.2-stable. It has also been tesetd using the sqlite3 gem.
23
+
24
+ Patches are welcome for other database adapters.
23
25
 
24
26
  ## Installation
25
27
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ task :default => ['test:all']
5
5
 
6
6
  namespace :test do
7
7
  desc "test all drivers"
8
- task :all => [:mysql, :mysql2]
8
+ task :all => [:mysql, :mysql2, :sqlite]
9
9
 
10
10
  desc "test mysql driver"
11
11
  task :mysql do
@@ -16,6 +16,11 @@ namespace :test do
16
16
  task :mysql2 do
17
17
  sh "DRIVER=mysql2 ruby -Ilib -Itest test/*_test.rb"
18
18
  end
19
+
20
+ desc "test sqlite3 driver"
21
+ task :sqlite do
22
+ sh "DRIVER=sqlite3 ruby -Ilib -Itest test/*_test.rb"
23
+ end
19
24
  end
20
25
 
21
26
  namespace :db do
@@ -48,6 +48,12 @@ module Marginalia
48
48
  end
49
49
  end
50
50
 
51
+ if defined? ActiveRecord::ConnectionAdapters::SQLiteAdapter
52
+ ActiveRecord::ConnectionAdapters::SQLiteAdapter.module_eval do
53
+ include Marginalia::ActiveRecordInstrumentation
54
+ end
55
+ end
56
+
51
57
  end
52
58
  end
53
59
  end
data/marginalia.gemspec CHANGED
@@ -8,13 +8,14 @@ Gem::Specification.new do |gem|
8
8
  gem.test_files = `git ls-files -- {test}/*`.split("\n")
9
9
  gem.name = "marginalia"
10
10
  gem.require_paths = ["lib"]
11
- gem.version = "1.0.0"
11
+ gem.version = "1.0.1"
12
12
 
13
13
  gem.add_runtime_dependency "actionpack", ">= 2.3", "< 3.3"
14
14
  gem.add_runtime_dependency "activerecord", ">= 2.3", "< 3.3"
15
15
  gem.add_development_dependency "rake"
16
16
  gem.add_development_dependency "mysql"
17
17
  gem.add_development_dependency "mysql2"
18
+ gem.add_development_dependency "sqlite3 "
18
19
 
19
20
  gem.summary = description = %q{Attach comments to your ActiveRecord queries.}
20
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marginalia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-04-24 00:00:00.000000000 Z
14
+ date: 2012-04-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: actionpack
18
- requirement: &13238580 !ruby/object:Gem::Requirement
18
+ requirement: &21947740 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -26,10 +26,10 @@ dependencies:
26
26
  version: '3.3'
27
27
  type: :runtime
28
28
  prerelease: false
29
- version_requirements: *13238580
29
+ version_requirements: *21947740
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: activerecord
32
- requirement: &13237460 !ruby/object:Gem::Requirement
32
+ requirement: &21940000 !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
35
  - - ! '>='
@@ -40,10 +40,10 @@ dependencies:
40
40
  version: '3.3'
41
41
  type: :runtime
42
42
  prerelease: false
43
- version_requirements: *13237460
43
+ version_requirements: *21940000
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: rake
46
- requirement: &13236300 !ruby/object:Gem::Requirement
46
+ requirement: &21935060 !ruby/object:Gem::Requirement
47
47
  none: false
48
48
  requirements:
49
49
  - - ! '>='
@@ -51,10 +51,10 @@ dependencies:
51
51
  version: '0'
52
52
  type: :development
53
53
  prerelease: false
54
- version_requirements: *13236300
54
+ version_requirements: *21935060
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mysql
57
- requirement: &13235060 !ruby/object:Gem::Requirement
57
+ requirement: &21929500 !ruby/object:Gem::Requirement
58
58
  none: false
59
59
  requirements:
60
60
  - - ! '>='
@@ -62,10 +62,10 @@ dependencies:
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
- version_requirements: *13235060
65
+ version_requirements: *21929500
66
66
  - !ruby/object:Gem::Dependency
67
67
  name: mysql2
68
- requirement: &13234220 !ruby/object:Gem::Requirement
68
+ requirement: &21928680 !ruby/object:Gem::Requirement
69
69
  none: false
70
70
  requirements:
71
71
  - - ! '>='
@@ -73,7 +73,18 @@ dependencies:
73
73
  version: '0'
74
74
  type: :development
75
75
  prerelease: false
76
- version_requirements: *13234220
76
+ version_requirements: *21928680
77
+ - !ruby/object:Gem::Dependency
78
+ name: ! 'sqlite3 '
79
+ requirement: &21927380 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ type: :development
86
+ prerelease: false
87
+ version_requirements: *21927380
77
88
  description:
78
89
  email:
79
90
  - noah@37signals.com