marginalia 1.1.3 → 1.1.4
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/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +13 -0
- data/Gemfile +11 -0
- data/lib/marginalia.rb +1 -1
- data/lib/marginalia/comment.rb +2 -2
- data/lib/marginalia/railtie.rb +4 -4
- data/marginalia.gemspec +3 -3
- data/test/query_comments_test.rb +8 -0
- metadata +53 -25
- data/.rbenv-version +0 -1
- data/Gemfile.lock +0 -67
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3-p484
|
data/.travis.yml
CHANGED
@@ -3,4 +3,17 @@ rvm:
|
|
3
3
|
- 1.8.7
|
4
4
|
- 1.9.2
|
5
5
|
- 1.9.3
|
6
|
+
- 2.0.0
|
7
|
+
- ruby-head
|
6
8
|
script: bundle exec rake db:reset test:all
|
9
|
+
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"
|
data/Gemfile
CHANGED
data/lib/marginalia.rb
CHANGED
data/lib/marginalia/comment.rb
CHANGED
@@ -40,11 +40,11 @@ module Marginalia
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.action
|
43
|
-
@controller.action_name if @controller.respond_to? :action_name
|
43
|
+
@controller.action_name if @controller.respond_to? :action_name
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.line
|
47
|
-
Marginalia::Comment.lines_to_ignore ||= /\.rvm|gem|vendor
|
47
|
+
Marginalia::Comment.lines_to_ignore ||= /\.rvm|gem|vendor\/|marginalia|rbenv/
|
48
48
|
last_line = caller.detect do |line|
|
49
49
|
line !~ Marginalia::Comment.lines_to_ignore
|
50
50
|
end
|
data/lib/marginalia/railtie.rb
CHANGED
@@ -29,7 +29,7 @@ module Marginalia
|
|
29
29
|
Marginalia::Comment.update!(self)
|
30
30
|
yield
|
31
31
|
ensure
|
32
|
-
Marginalia::Comment.clear!
|
32
|
+
Marginalia::Comment.clear!
|
33
33
|
end
|
34
34
|
around_filter :record_query_comment
|
35
35
|
end
|
@@ -61,9 +61,9 @@ module Marginalia
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
if defined? ActiveRecord::ConnectionAdapters::
|
65
|
-
if ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::
|
66
|
-
ActiveRecord::ConnectionAdapters::
|
64
|
+
if defined? ActiveRecord::ConnectionAdapters::SQLite3Adapter
|
65
|
+
if ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::SQLite3Adapter)
|
66
|
+
ActiveRecord::ConnectionAdapters::SQLite3Adapter.module_eval do
|
67
67
|
include Marginalia::ActiveRecordInstrumentation
|
68
68
|
end
|
69
69
|
end
|
data/marginalia.gemspec
CHANGED
@@ -8,11 +8,11 @@ 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.
|
11
|
+
gem.version = "1.1.4"
|
12
12
|
gem.license = "MIT"
|
13
13
|
|
14
|
-
gem.add_runtime_dependency "actionpack", ">= 2.3"
|
15
|
-
gem.add_runtime_dependency "activerecord", ">= 2.3"
|
14
|
+
gem.add_runtime_dependency "actionpack", ">= 2.3"
|
15
|
+
gem.add_runtime_dependency "activerecord", ">= 2.3"
|
16
16
|
gem.add_development_dependency "rake"
|
17
17
|
gem.add_development_dependency "mysql"
|
18
18
|
gem.add_development_dependency "mysql2"
|
data/test/query_comments_test.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
require 'test/unit'
|
2
3
|
require 'logger'
|
3
4
|
require 'pp'
|
@@ -46,6 +47,13 @@ class MarginaliaTest < Test::Unit::TestCase
|
|
46
47
|
assert_match %r{select id from posts /\*application:rails\*/$}, @queries.first
|
47
48
|
end
|
48
49
|
|
50
|
+
if ENV["DRIVER"] =~ /^mysql/
|
51
|
+
def test_query_commenting_on_mysql_driver_with_binary_chars
|
52
|
+
ActiveRecord::Base.connection.execute "select id from posts /* \x81\x80\u0010\ */"
|
53
|
+
assert_equal "select id from posts /* \x81\x80\u0010 */ /*application:rails*/", @queries.first
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
49
57
|
def test_query_commenting_on_mysql_driver_with_action
|
50
58
|
PostsController.action(:driver_only).call(@env)
|
51
59
|
assert_match %r{select id from posts /\*application:rails,controller:posts,action:driver_only\*/$}, @queries.first
|
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.1.
|
4
|
+
version: 1.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,39 +11,43 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: actionpack
|
18
|
-
requirement:
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '2.3'
|
24
|
-
- - <
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '3.3'
|
27
24
|
type: :runtime
|
28
25
|
prerelease: false
|
29
|
-
version_requirements:
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '2.3'
|
30
32
|
- !ruby/object:Gem::Dependency
|
31
33
|
name: activerecord
|
32
|
-
requirement:
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
33
35
|
none: false
|
34
36
|
requirements:
|
35
37
|
- - ! '>='
|
36
38
|
- !ruby/object:Gem::Version
|
37
39
|
version: '2.3'
|
38
|
-
- - <
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '3.3'
|
41
40
|
type: :runtime
|
42
41
|
prerelease: false
|
43
|
-
version_requirements:
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.3'
|
44
48
|
- !ruby/object:Gem::Dependency
|
45
49
|
name: rake
|
46
|
-
requirement:
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
47
51
|
none: false
|
48
52
|
requirements:
|
49
53
|
- - ! '>='
|
@@ -51,10 +55,15 @@ dependencies:
|
|
51
55
|
version: '0'
|
52
56
|
type: :development
|
53
57
|
prerelease: false
|
54
|
-
version_requirements:
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
55
64
|
- !ruby/object:Gem::Dependency
|
56
65
|
name: mysql
|
57
|
-
requirement:
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
58
67
|
none: false
|
59
68
|
requirements:
|
60
69
|
- - ! '>='
|
@@ -62,10 +71,15 @@ dependencies:
|
|
62
71
|
version: '0'
|
63
72
|
type: :development
|
64
73
|
prerelease: false
|
65
|
-
version_requirements:
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
66
80
|
- !ruby/object:Gem::Dependency
|
67
81
|
name: mysql2
|
68
|
-
requirement:
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
69
83
|
none: false
|
70
84
|
requirements:
|
71
85
|
- - ! '>='
|
@@ -73,10 +87,15 @@ dependencies:
|
|
73
87
|
version: '0'
|
74
88
|
type: :development
|
75
89
|
prerelease: false
|
76
|
-
version_requirements:
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
77
96
|
- !ruby/object:Gem::Dependency
|
78
97
|
name: pg
|
79
|
-
requirement:
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
80
99
|
none: false
|
81
100
|
requirements:
|
82
101
|
- - ! '>='
|
@@ -84,10 +103,15 @@ dependencies:
|
|
84
103
|
version: '0'
|
85
104
|
type: :development
|
86
105
|
prerelease: false
|
87
|
-
version_requirements:
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
88
112
|
- !ruby/object:Gem::Dependency
|
89
113
|
name: sqlite3
|
90
|
-
requirement:
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
91
115
|
none: false
|
92
116
|
requirements:
|
93
117
|
- - ! '>='
|
@@ -95,7 +119,12 @@ dependencies:
|
|
95
119
|
version: '0'
|
96
120
|
type: :development
|
97
121
|
prerelease: false
|
98
|
-
version_requirements:
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
99
128
|
description:
|
100
129
|
email:
|
101
130
|
- noah@37signals.com
|
@@ -104,10 +133,9 @@ extensions: []
|
|
104
133
|
extra_rdoc_files: []
|
105
134
|
files:
|
106
135
|
- .gitignore
|
107
|
-
- .
|
136
|
+
- .ruby-version
|
108
137
|
- .travis.yml
|
109
138
|
- Gemfile
|
110
|
-
- Gemfile.lock
|
111
139
|
- LICENSE
|
112
140
|
- README.md
|
113
141
|
- Rakefile
|
@@ -138,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
166
|
version: '0'
|
139
167
|
requirements: []
|
140
168
|
rubyforge_project:
|
141
|
-
rubygems_version: 1.8.
|
169
|
+
rubygems_version: 1.8.23
|
142
170
|
signing_key:
|
143
171
|
specification_version: 3
|
144
172
|
summary: Attach comments to your ActiveRecord queries.
|
data/.rbenv-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.9.3-p0
|
data/Gemfile.lock
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
marginalia (1.1.0)
|
5
|
-
actionpack (>= 2.3, < 3.3)
|
6
|
-
activerecord (>= 2.3, < 3.3)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
actionpack (3.1.3)
|
12
|
-
activemodel (= 3.1.3)
|
13
|
-
activesupport (= 3.1.3)
|
14
|
-
builder (~> 3.0.0)
|
15
|
-
erubis (~> 2.7.0)
|
16
|
-
i18n (~> 0.6)
|
17
|
-
rack (~> 1.3.5)
|
18
|
-
rack-cache (~> 1.1)
|
19
|
-
rack-mount (~> 0.8.2)
|
20
|
-
rack-test (~> 0.6.1)
|
21
|
-
sprockets (~> 2.0.3)
|
22
|
-
activemodel (3.1.3)
|
23
|
-
activesupport (= 3.1.3)
|
24
|
-
builder (~> 3.0.0)
|
25
|
-
i18n (~> 0.6)
|
26
|
-
activerecord (3.1.3)
|
27
|
-
activemodel (= 3.1.3)
|
28
|
-
activesupport (= 3.1.3)
|
29
|
-
arel (~> 2.2.1)
|
30
|
-
tzinfo (~> 0.3.29)
|
31
|
-
activesupport (3.1.3)
|
32
|
-
multi_json (~> 1.0)
|
33
|
-
arel (2.2.1)
|
34
|
-
builder (3.0.0)
|
35
|
-
erubis (2.7.0)
|
36
|
-
hike (1.2.1)
|
37
|
-
i18n (0.6.0)
|
38
|
-
multi_json (1.1.0)
|
39
|
-
mysql (2.8.1)
|
40
|
-
mysql2 (0.3.11)
|
41
|
-
pg (0.13.2)
|
42
|
-
rack (1.3.6)
|
43
|
-
rack-cache (1.1)
|
44
|
-
rack (>= 0.4)
|
45
|
-
rack-mount (0.8.3)
|
46
|
-
rack (>= 1.0.0)
|
47
|
-
rack-test (0.6.1)
|
48
|
-
rack (>= 1.0)
|
49
|
-
rake (0.9.2.2)
|
50
|
-
sprockets (2.0.3)
|
51
|
-
hike (~> 1.2)
|
52
|
-
rack (~> 1.0)
|
53
|
-
tilt (~> 1.1, != 1.3.0)
|
54
|
-
sqlite3 (1.3.6)
|
55
|
-
tilt (1.3.3)
|
56
|
-
tzinfo (0.3.32)
|
57
|
-
|
58
|
-
PLATFORMS
|
59
|
-
ruby
|
60
|
-
|
61
|
-
DEPENDENCIES
|
62
|
-
marginalia!
|
63
|
-
mysql
|
64
|
-
mysql2
|
65
|
-
pg
|
66
|
-
rake
|
67
|
-
sqlite3
|