sequel_caller_location 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cbd4671520f1847d2c2535e5bf3cd1cd5ae55496
4
- data.tar.gz: 78f1e077ed03f88784188b45c4b96ddd68714537
2
+ SHA256:
3
+ metadata.gz: 34eecdc38097b7169d2d0326a4c17f8fa593062ff0b48a66eae4f7a48c6a20c5
4
+ data.tar.gz: 5aa107b9b9c127d890c2270704fedd7b119ac4899cb5e29e15c81462e3fdafe3
5
5
  SHA512:
6
- metadata.gz: a7195822a0690bcbb30504bdce656dce4ec450f97a198fa0020f2c75e63fc897e368b6c7dc79d193a6805024f3d426898ba9db553564fed0abe4122cf2def0ad
7
- data.tar.gz: 77762417beabfec099aab02703c72fb3f606263c5cbac1478bcb0344a47d126cb753196ee398abb412f3d535b4b4cca788e069e09c7e879f177617a6d5b76e3f
6
+ metadata.gz: acadb149207c12ad0601ae555d7e960e7e5500f4184439c6ebae677bea4af937d07efb41a28dd6ad8ac3bb6661da0e157dcb89bb106495b66481f57d9368261a
7
+ data.tar.gz: 35b8084e5f6792fab8b152d679755d9b204e7bdb0e18e326060476b091a28a7ec97acfc794bfb014504dd191447b27330f32a8b45e840eceae219190657dd4c5
data/.rubocop.yml CHANGED
@@ -1 +1,15 @@
1
- inherit_from: .rubocop_todo.yml
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ # Offense count: 2
5
+ Style/Documentation:
6
+ Exclude:
7
+ - 'spec/**/*'
8
+ - 'test/**/*'
9
+ - 'lib/sequel/extensions/caller_location.rb'
10
+
11
+ # Offense count: 5
12
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
13
+ # URISchemes: http, https
14
+ Metrics/LineLength:
15
+ Max: 106
data/.travis.yml CHANGED
@@ -1,8 +1,10 @@
1
1
  language: ruby
2
- cache: bundler
3
2
  rvm:
4
- - 2.3.1
5
- sudo: false
6
- script: bundle exec rspec
3
+ - 2.3
4
+ - 2.4
5
+ - 2.5
6
+ script:
7
+ - bundle exec rubocop --parallel
8
+ - bundle exec rspec
7
9
  notifications:
8
10
  email: false
@@ -1,9 +1,10 @@
1
1
  # frozen-string-literal: true
2
+
2
3
  require 'sequel'
3
4
 
4
5
  module Sequel
5
6
  module CallerLocation
6
- %w(select insert update delete).each do |type|
7
+ %w[select insert update delete].each do |type|
7
8
  define_method(:"#{type}_sql") do |*a|
8
9
  sql = super(*a)
9
10
  if !sql.frozen? && (backtrace = caller_locations(1).find { |c| c.path !~ /gems/ })
@@ -1,5 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
1
  Gem::Specification.new do |gem|
4
2
  gem.authors = ['Timothée Peignier']
5
3
  gem.email = ['timothee.peignier@tryphon.org']
@@ -13,11 +11,12 @@ Gem::Specification.new do |gem|
13
11
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
12
  gem.name = 'sequel_caller_location'
15
13
  gem.require_paths = ['lib']
16
- gem.version = '0.2.1'
14
+ gem.version = '0.2.2'
17
15
 
18
16
  gem.add_runtime_dependency 'sequel', '>= 4.39.0'
19
17
 
20
18
  gem.add_development_dependency 'rspec', '~> 3.5', '>= 3.5.0'
21
- gem.add_development_dependency 'simplecov', '~> 0.12.0'
22
- gem.add_development_dependency 'rubocop', '~> 0.43', '>= 0.43.0'
19
+ gem.add_development_dependency 'rubocop', '~> 0.52', '>= 0.52.0'
20
+ gem.add_development_dependency 'rubocop-rspec', '~> 1.22.0', '>= 1.22.0'
21
+ gem.add_development_dependency 'simplecov', '~> 0.15.0'
23
22
  end
@@ -1,13 +1,23 @@
1
1
  # frozen-string-literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  describe Sequel::CallerLocation do
5
6
  let(:ds) { Sequel.mock[:t].extension(:caller_location) }
6
7
 
7
- it 'add caller location comment' do
8
+ it 'add caller location to select statement' do
8
9
  expect(ds.select_sql).to eq("SELECT * FROM t -- #{caller_locations(0, 1).first}\n")
10
+ end
11
+
12
+ it 'add caller location to insert statement' do
9
13
  expect(ds.insert_sql(a: 1)).to eq("INSERT INTO t (a) VALUES (1) -- #{caller_locations(0, 1).first}\n")
14
+ end
15
+
16
+ it 'add caller location to delete statement' do
10
17
  expect(ds.delete_sql).to eq("DELETE FROM t -- #{caller_locations(0, 1).first}\n")
18
+ end
19
+
20
+ it 'add caller location to update statement' do
11
21
  expect(ds.update_sql(a: 1)).to eq("UPDATE t SET a = 1 -- #{caller_locations(0, 1).first}\n")
12
22
  end
13
23
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen-string-literal: true
2
+
2
3
  require 'bundler'
3
4
  Bundler.require
4
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_caller_location
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timothée Peignier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2018-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -45,39 +45,59 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: 3.5.0
47
47
  - !ruby/object:Gem::Dependency
48
- name: simplecov
48
+ name: rubocop
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 0.12.0
53
+ version: '0.52'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.52.0
54
57
  type: :development
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
61
  - - "~>"
59
62
  - !ruby/object:Gem::Version
60
- version: 0.12.0
63
+ version: '0.52'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 0.52.0
61
67
  - !ruby/object:Gem::Dependency
62
- name: rubocop
68
+ name: rubocop-rspec
63
69
  requirement: !ruby/object:Gem::Requirement
64
70
  requirements:
65
71
  - - "~>"
66
72
  - !ruby/object:Gem::Version
67
- version: '0.43'
73
+ version: 1.22.0
68
74
  - - ">="
69
75
  - !ruby/object:Gem::Version
70
- version: 0.43.0
76
+ version: 1.22.0
71
77
  type: :development
72
78
  prerelease: false
73
79
  version_requirements: !ruby/object:Gem::Requirement
74
80
  requirements:
75
81
  - - "~>"
76
82
  - !ruby/object:Gem::Version
77
- version: '0.43'
83
+ version: 1.22.0
78
84
  - - ">="
79
85
  - !ruby/object:Gem::Version
80
- version: 0.43.0
86
+ version: 1.22.0
87
+ - !ruby/object:Gem::Dependency
88
+ name: simplecov
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: 0.15.0
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: 0.15.0
81
101
  description: Add caller location as SQL comments
82
102
  email:
83
103
  - timothee.peignier@tryphon.org
@@ -87,14 +107,13 @@ extra_rdoc_files: []
87
107
  files:
88
108
  - ".gitignore"
89
109
  - ".rubocop.yml"
90
- - ".rubocop_todo.yml"
91
110
  - ".travis.yml"
92
111
  - Gemfile
93
112
  - LICENSE
94
113
  - README.md
95
114
  - lib/sequel/extensions/caller_location.rb
96
115
  - sequel_caller_location.gemspec
97
- - spec/caller_location_spec.rb
116
+ - spec/sequel/caller_location_spec.rb
98
117
  - spec/spec_helper.rb
99
118
  homepage: http://rubygems.org/gems/sequel_caller_location
100
119
  licenses:
@@ -116,10 +135,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
135
  version: '0'
117
136
  requirements: []
118
137
  rubyforge_project:
119
- rubygems_version: 2.6.13
138
+ rubygems_version: 2.7.4
120
139
  signing_key:
121
140
  specification_version: 4
122
141
  summary: Add caller location as SQL comments.
123
142
  test_files:
124
- - spec/caller_location_spec.rb
143
+ - spec/sequel/caller_location_spec.rb
125
144
  - spec/spec_helper.rb
data/.rubocop_todo.yml DELETED
@@ -1,20 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2016-10-11 19:36:45 -0700 using RuboCop version 0.43.0.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 7
10
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
11
- # URISchemes: http, https
12
- Metrics/LineLength:
13
- Max: 152
14
-
15
- # Offense count: 2
16
- Style/Documentation:
17
- Exclude:
18
- - 'spec/**/*'
19
- - 'test/**/*'
20
- - 'lib/sequel/extensions/comments.rb'