marginalia 1.1.4 → 1.1.5

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.

checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fcc2f32dfc16f2e22667bcab682490c5428aa70f
4
+ data.tar.gz: f76f558831423192621127cc4b5de1a042bed3c9
5
+ SHA512:
6
+ metadata.gz: 05331b951bb74bcfffeeda0873b9d66b7919e97a66a764c07b0f7dcfef088266bf08c0552d16652b20f9ffcdaa3f526af8d828d9bffe97cacd8869a3bf0326f9
7
+ data.tar.gz: 09ed9f59adc63e455abf796fc5ef365c7756e992a1894643982ac85e3fee5257d61b6f26c0f72104f71fdc9658c1e7f11a19aa5ffbc92e62c028b7445b56e862
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 1.9.3-p484
1
+ 2.1.0
data/.travis.yml CHANGED
@@ -1,19 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
3
  - 1.9.3
6
4
  - 2.0.0
7
- - ruby-head
5
+ - 2.1.0
8
6
  script: bundle exec rake db:reset test:all
9
7
  env:
10
- - "RAILS_VERSION=3.2.15"
11
- - "RAILS_VERSION=4.0.1"
12
- matrix:
13
- allow_failures:
14
- - rvm: ruby-head
15
- exclude:
16
- - rvm: 1.8.7
17
- env: "RAILS_VERSION=4.0.1"
18
- - rvm: 1.9.2
19
- env: "RAILS_VERSION=4.0.1"
8
+ - "RAILS_VERSION=3.1.12"
9
+ - "RAILS_VERSION=3.2.16"
10
+ - "RAILS_VERSION=4.0.2"
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- version = ENV["RAILS_VERSION"] || "3.2.15"
5
+ version = ENV["RAILS_VERSION"] || "4.0.2"
6
6
 
7
7
  rails = case version
8
8
  when "master"
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # marginalia [![Build Status](https://secure.travis-ci.org/37signals/marginalia.png?branch=master)](http://travis-ci.org/37signals/marginalia)
1
+ # marginalia [![Build Status](https://secure.travis-ci.org/basecamp/marginalia.png?branch=master)](http://travis-ci.org/basecamp/marginalia)
2
2
 
3
3
  Attach comments to your ActiveRecord queries. By default, it adds the application, controller, and action names as a
4
4
  comment at the end of each query.
@@ -23,11 +23,6 @@ tested on Rails 2.3.5 through 3.2-stable. It has also been tested for sqlite3 an
23
23
 
24
24
  Patches are welcome for other database adapters.
25
25
 
26
- **The preferred way to get support is to send an email to
27
- marginalia@librelist.com. Github issues
28
- and pull requests will be checked occassionally, but email is the
29
- fastest way to get help.**
30
-
31
26
  ## Installation
32
27
 
33
28
  ### For Rails 3.x:
data/lib/marginalia.rb CHANGED
@@ -8,14 +8,19 @@ module Marginalia
8
8
  def self.included(instrumented_class)
9
9
  Marginalia::Comment.components = [:application, :controller, :action]
10
10
  instrumented_class.class_eval do
11
- if instrumented_class.method_defined? :execute
11
+ if instrumented_class.method_defined?(:execute)
12
12
  alias_method :execute_without_marginalia, :execute
13
13
  alias_method :execute, :execute_with_marginalia
14
14
  end
15
15
 
16
- if instrumented_class.method_defined? :exec_query
17
- alias_method :exec_query_without_marginalia, :exec_query
18
- alias_method :exec_query, :exec_query_with_marginalia
16
+ is_mysql2 = defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter) &&
17
+ ActiveRecord::ConnectionAdapters::Mysql2Adapter == instrumented_class
18
+ # Dont instrument exec_query on mysql2 and AR 3.2+, as it calls execute internally
19
+ unless is_mysql2 && ActiveRecord::VERSION::STRING > "3.1"
20
+ if instrumented_class.method_defined?(:exec_query)
21
+ alias_method :exec_query_without_marginalia, :exec_query
22
+ alias_method :exec_query, :exec_query_with_marginalia
23
+ end
19
24
  end
20
25
  end
21
26
  end
data/marginalia.gemspec CHANGED
@@ -8,7 +8,7 @@ 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.1.4"
11
+ gem.version = "1.1.5"
12
12
  gem.license = "MIT"
13
13
 
14
14
  gem.add_runtime_dependency "actionpack", ">= 2.3"
@@ -18,6 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_development_dependency "mysql2"
19
19
  gem.add_development_dependency "pg"
20
20
  gem.add_development_dependency "sqlite3"
21
+ gem.add_development_dependency "mocha"
21
22
 
22
- gem.summary = description = %q{Attach comments to your ActiveRecord queries.}
23
+ gem.summary = gem.description = %q{Attach comments to your ActiveRecord queries.}
23
24
  end
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'test/unit'
3
+ require 'mocha/test_unit'
3
4
  require 'logger'
4
5
  require 'pp'
5
6
  require 'active_record'
@@ -42,6 +43,13 @@ class MarginaliaTest < Test::Unit::TestCase
42
43
  @env = Rack::MockRequest.env_for('/')
43
44
  end
44
45
 
46
+ def test_double_annotate
47
+ ActiveRecord::Base.connection.expects(:annotate_sql).returns("select id from posts").once
48
+ ActiveRecord::Base.connection.send(:select, "select id from posts")
49
+ ensure
50
+ ActiveRecord::Base.connection.unstub(:annotate_sql)
51
+ end
52
+
45
53
  def test_query_commenting_on_mysql_driver_with_no_action
46
54
  ActiveRecord::Base.connection.execute "select id from posts"
47
55
  assert_match %r{select id from posts /\*application:rails\*/$}, @queries.first
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marginalia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
5
- prerelease:
4
+ version: 1.1.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Noah Lorang
@@ -11,130 +10,130 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-12-30 00:00:00.000000000 Z
13
+ date: 2014-02-07 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: actionpack
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ! '>='
19
+ - - ">="
22
20
  - !ruby/object:Gem::Version
23
21
  version: '2.3'
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ! '>='
26
+ - - ">="
30
27
  - !ruby/object:Gem::Version
31
28
  version: '2.3'
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: activerecord
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ! '>='
33
+ - - ">="
38
34
  - !ruby/object:Gem::Version
39
35
  version: '2.3'
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ! '>='
40
+ - - ">="
46
41
  - !ruby/object:Gem::Version
47
42
  version: '2.3'
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: rake
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ! '>='
47
+ - - ">="
54
48
  - !ruby/object:Gem::Version
55
49
  version: '0'
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ! '>='
54
+ - - ">="
62
55
  - !ruby/object:Gem::Version
63
56
  version: '0'
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: mysql
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
- - - ! '>='
61
+ - - ">="
70
62
  - !ruby/object:Gem::Version
71
63
  version: '0'
72
64
  type: :development
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
- - - ! '>='
68
+ - - ">="
78
69
  - !ruby/object:Gem::Version
79
70
  version: '0'
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: mysql2
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
- - - ! '>='
75
+ - - ">="
86
76
  - !ruby/object:Gem::Version
87
77
  version: '0'
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
- - - ! '>='
82
+ - - ">="
94
83
  - !ruby/object:Gem::Version
95
84
  version: '0'
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: pg
98
87
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
- - - ! '>='
89
+ - - ">="
102
90
  - !ruby/object:Gem::Version
103
91
  version: '0'
104
92
  type: :development
105
93
  prerelease: false
106
94
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
95
  requirements:
109
- - - ! '>='
96
+ - - ">="
110
97
  - !ruby/object:Gem::Version
111
98
  version: '0'
112
99
  - !ruby/object:Gem::Dependency
113
100
  name: sqlite3
114
101
  requirement: !ruby/object:Gem::Requirement
115
- none: false
116
102
  requirements:
117
- - - ! '>='
103
+ - - ">="
118
104
  - !ruby/object:Gem::Version
119
105
  version: '0'
120
106
  type: :development
121
107
  prerelease: false
122
108
  version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
109
  requirements:
125
- - - ! '>='
110
+ - - ">="
126
111
  - !ruby/object:Gem::Version
127
112
  version: '0'
128
- description:
113
+ - !ruby/object:Gem::Dependency
114
+ name: mocha
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ description: Attach comments to your ActiveRecord queries.
129
128
  email:
130
129
  - noah@37signals.com
131
130
  executables: []
132
131
  extensions: []
133
132
  extra_rdoc_files: []
134
133
  files:
135
- - .gitignore
136
- - .ruby-version
137
- - .travis.yml
134
+ - ".gitignore"
135
+ - ".ruby-version"
136
+ - ".travis.yml"
138
137
  - Gemfile
139
138
  - LICENSE
140
139
  - README.md
@@ -148,26 +147,25 @@ files:
148
147
  homepage: https://github.com/37signals/marginalia
149
148
  licenses:
150
149
  - MIT
150
+ metadata: {}
151
151
  post_install_message:
152
152
  rdoc_options: []
153
153
  require_paths:
154
154
  - lib
155
155
  required_ruby_version: !ruby/object:Gem::Requirement
156
- none: false
157
156
  requirements:
158
- - - ! '>='
157
+ - - ">="
159
158
  - !ruby/object:Gem::Version
160
159
  version: '0'
161
160
  required_rubygems_version: !ruby/object:Gem::Requirement
162
- none: false
163
161
  requirements:
164
- - - ! '>='
162
+ - - ">="
165
163
  - !ruby/object:Gem::Version
166
164
  version: '0'
167
165
  requirements: []
168
166
  rubyforge_project:
169
- rubygems_version: 1.8.23
167
+ rubygems_version: 2.2.0
170
168
  signing_key:
171
- specification_version: 3
169
+ specification_version: 4
172
170
  summary: Attach comments to your ActiveRecord queries.
173
171
  test_files: []