dblint 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a456608b04d3132f18e4c9de00ab708d799e0373
4
- data.tar.gz: 17a007e706e33f5d7a72406d8c98dfebe3783c8d
3
+ metadata.gz: 5882547f7ba7be4f29dfbd2e4fc685168e656036
4
+ data.tar.gz: 1171ff0b3c9bdd3f8fb3d94d48fdff3ff041fb35
5
5
  SHA512:
6
- metadata.gz: fe6ca2ea60ab241e5e680751ad05c96bf58045f0a0fa947812f4add848264dbc3f55adade3e92b041715d2a252ec6a1d5a34b074603998373124518c5f836caf
7
- data.tar.gz: 838612d7f6f26f839228a115c5168ff00dc23ee9098de039dfa5c098e7f3164f31b38d3f4f15fddd62e166eed72ab92e374f5ae4f52fef4f0f8b1fd73e405a5a
6
+ metadata.gz: 72f796d6ddf84cf2ccb305e6e182b4172b0ced77455ed1377d563a65fe851ee731b6538386b3ad25b97b4e7467a45e993b321cc7bbf25bb36a31439ecabd8845
7
+ data.tar.gz: 4734c644bb32a0f13a61cce0e2235351516ab241c3e403f65fe035f2e2f571c80b7da91a676281d317aca882948aa944dfa43a1fca74dbca29fe0c76a413e12b
data/.travis.yml CHANGED
@@ -1,3 +1,17 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.0
3
+ - 1.9.3-p551
4
+ - 2.0.0-p648
5
+ - 2.1.8
6
+ - 2.2.4
7
+ - 2.3.1
8
+ - rbx-3.20
9
+ addons:
10
+ postgresql: 9.4
11
+ env:
12
+ - DATABASE_URL=postgresql://postgres@localhost:5432/dblint
13
+ before_install:
14
+ - gem install bundler
15
+ before_script:
16
+ - createdb dblint
17
+ script: bundle exec rake
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 2016-04-27
4
+
5
+ * Fix handling of vendored gems [#1](https://github.com/lfittl/dblint/pull/1) [@ksykulev](https://github.com/ksykulev)
6
+
7
+
8
+ ## 0.1.0 2015-05-04
9
+
10
+ * Initial release
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
- # dblint [ ![Codeship Status for lfittl/dblint](https://img.shields.io/codeship/db703270-cfa3-0132-a2bb-623bdb9b8d89.svg)](https://codeship.com/projects/76752)
1
+ # dblint [ ![](https://img.shields.io/gem/v/dblint.svg)](https://rubygems.org/gems/dblint) [ ![](https://img.shields.io/gem/dt/dblint.svg)](https://rubygems.org/gems/dblint) [ ![](https://travis-ci.org/lfittl/dblint.svg?branch=master)](https://travis-ci.org/lfittl/dblint)
2
2
 
3
3
  Automatically checks all SQL queries that are executed during your tests, to find common mistakes, including missing indices and locking issues due to long transactions.
4
4
 
5
+
5
6
  ## Installation
6
7
 
7
8
  Add this line to your application's Gemfile:
@@ -27,7 +28,7 @@ Note that it will check the callstack for the problematic query, and only count
27
28
  ```
28
29
  Failures:
29
30
 
30
- 1) FeedsController#show
31
+ 1) FeedsController#show
31
32
  Failure/Error: get :show, format: :atom
32
33
  Dblint::Checks::MissingIndex::Error:
33
34
  Missing index on oauth_applications for '((twitter_app_name)::text = 'My Feed App'::text)' in 'SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."twitter_app_name" = $1 LIMIT 1', called by app/controllers/feeds_controller.rb:6:in `show'
@@ -89,3 +90,14 @@ application, also included in the error message for the check.
89
90
  3. Commit your changes (`git commit -am 'Add some feature'`)
90
91
  4. Push to the branch (`git push origin my-new-feature`)
91
92
  5. Create a new Pull Request
93
+
94
+
95
+ ## Authors
96
+
97
+ - [Lukas Fittl](mailto:lukas@fittl.com)
98
+
99
+
100
+ ## License
101
+
102
+ Copyright (c) 2015, Lukas Fittl <lukas@fittl.com><br>
103
+ dblint is licensed under the MIT license, see LICENSE.txt file for details.
data/dblint.gemspec CHANGED
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'rspec-rails'
27
27
  spec.add_development_dependency 'sqlite3'
28
28
  spec.add_development_dependency 'dotenv'
29
- spec.add_development_dependency 'rubocop', '~> 0.30'
29
+ spec.add_development_dependency 'rubocop', '~> 0.39'
30
30
  spec.add_development_dependency 'rubocop-rspec'
31
31
  end
@@ -8,10 +8,12 @@ module Dblint
8
8
  end
9
9
 
10
10
  def find_main_app_caller(callstack)
11
- main_app_caller = callstack.find { |f| f.start_with?(Rails.root.to_s) }
11
+ main_app_caller = callstack.find { |f| f.start_with?(Rails.root.to_s) && !f.include?('/vendor/bundle') }
12
12
  main_app_caller.slice!(Rails.root.to_s + '/')
13
- main_app_dir = main_app_caller[/^\w+/]
13
+
14
+ main_app_dir = main_app_caller[/^\w+/]
14
15
  return if %w(spec test).include?(main_app_dir)
16
+
15
17
  main_app_caller
16
18
  end
17
19
 
@@ -83,7 +83,7 @@ module Dblint
83
83
 
84
84
  # We need an explicit begin here since we're interrupting the transaction flow
85
85
  ActiveRecord::Base.connection.execute('BEGIN')
86
- fail Error, error_msg
86
+ raise Error, error_msg
87
87
 
88
88
  # TODO: Add a config setting for enabling this as a warning
89
89
  # puts format('Warning: %s', error_msg)
@@ -34,7 +34,7 @@ module Dblint
34
34
 
35
35
  error_msg = format("Missing index on %s for '%s' in '%s', called by %s",
36
36
  plan['Relation Name'], plan['Filter'], payload[:sql], main_app_caller)
37
- fail Error, error_msg
37
+ raise Error, error_msg
38
38
  end
39
39
 
40
40
  (plan['Plans'] || []).each do |subplan|
@@ -5,7 +5,7 @@ module Dblint
5
5
  CHECKS = [
6
6
  Dblint::Checks::LongHeldLock,
7
7
  Dblint::Checks::MissingIndex
8
- ]
8
+ ].freeze
9
9
 
10
10
  def check_instance_for_connection(connid, klass)
11
11
  @checks ||= {}
@@ -1,3 +1,3 @@
1
1
  module Dblint
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Fittl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-04 00:00:00.000000000 Z
11
+ date: 2016-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.30'
145
+ version: '0.39'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.30'
152
+ version: '0.39'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop-rspec
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -176,6 +176,7 @@ files:
176
176
  - ".rspec"
177
177
  - ".rubocop.yml"
178
178
  - ".travis.yml"
179
+ - CHANGELOG.md
179
180
  - CODE_OF_CONDUCT.md
180
181
  - Gemfile
181
182
  - LICENSE.txt
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
209
  version: '0'
209
210
  requirements: []
210
211
  rubyforge_project:
211
- rubygems_version: 2.4.5
212
+ rubygems_version: 2.5.1
212
213
  signing_key:
213
214
  specification_version: 4
214
215
  summary: Automatically tests your Rails app for common database query mistakes