sql_footprint 0.6.1 → 0.7.0
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 +4 -4
- data/lib/sql_footprint.rb +6 -8
- data/lib/sql_footprint/sql_statements.rb +16 -0
- data/lib/sql_footprint/version.rb +1 -1
- data/sql_footprint.gemspec +6 -2
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 472446038c0bec9000ba7861f9e4d41b5d1cf3be
|
4
|
+
data.tar.gz: 9406bfd4eb1b50205b7d8b76751be74e96ca8e3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75ab01cb607988f3f291660d4fc4efea32d4abcc018fb0344c70ebdf9f1e3403b22bcb45b69389f318de113ab63b13a9d8f19ed574c356056077b0ed7e78ed33
|
7
|
+
data.tar.gz: 5b6d1fa63a334b86808f0e2de34df9ec9b5f4d321f1dc162827a856019dbb740f0f9dcc8488d3aa65892521fa1cf358381c98b46cd0bccf8c2699ba2aeb57075
|
data/lib/sql_footprint.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'sql_footprint/version'
|
2
2
|
require 'sql_footprint/sql_anonymizer'
|
3
3
|
require 'sql_footprint/sql_filter'
|
4
|
-
require '
|
4
|
+
require 'sql_footprint/sql_statements'
|
5
5
|
require 'active_support/notifications'
|
6
6
|
|
7
7
|
module SqlFootprint
|
@@ -13,16 +13,18 @@ module SqlFootprint
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class << self
|
16
|
+
attr_reader :statements
|
17
|
+
|
16
18
|
def start
|
17
19
|
@anonymizer = SqlAnonymizer.new
|
18
20
|
@filter = SqlFilter.new
|
19
21
|
@capture = true
|
20
|
-
@
|
22
|
+
@statements = SqlStatements.new
|
21
23
|
end
|
22
24
|
|
23
25
|
def stop
|
24
26
|
@capture = false
|
25
|
-
File.write FILENAME,
|
27
|
+
File.write FILENAME, statements.sort.join(NEWLINE) + NEWLINE
|
26
28
|
end
|
27
29
|
|
28
30
|
def exclude
|
@@ -32,13 +34,9 @@ module SqlFootprint
|
|
32
34
|
@capture = true
|
33
35
|
end
|
34
36
|
|
35
|
-
def lines
|
36
|
-
@lines.sort
|
37
|
-
end
|
38
|
-
|
39
37
|
def capture sql
|
40
38
|
return unless @capture && @filter.capture?(sql)
|
41
|
-
@
|
39
|
+
@statements.add @anonymizer.anonymize(sql)
|
42
40
|
end
|
43
41
|
end
|
44
42
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'set'
|
2
|
+
require 'active_support/core_ext/module/delegation'
|
3
|
+
|
4
|
+
module SqlFootprint
|
5
|
+
class SqlStatements
|
6
|
+
def initialize
|
7
|
+
@statements = Set.new
|
8
|
+
end
|
9
|
+
|
10
|
+
delegate :to_a, :add, :sort, :count, to: :statements
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
attr_reader :statements
|
15
|
+
end
|
16
|
+
end
|
data/sql_footprint.gemspec
CHANGED
@@ -6,8 +6,12 @@ require 'sql_footprint/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'sql_footprint'
|
8
8
|
spec.version = SqlFootprint::VERSION
|
9
|
-
spec.authors = ['Brandon Joyce']
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Brandon Joyce', 'Michael Gee', 'Derek Schneider']
|
10
|
+
spec.email = [
|
11
|
+
'brandon@sonerdy.com',
|
12
|
+
'michaelpgee@gmail.com',
|
13
|
+
'dschneider@covermymeds.com'
|
14
|
+
]
|
11
15
|
|
12
16
|
spec.summary = 'Keeps your DBA happy.'
|
13
17
|
spec.description = 'Check your footprint file into source control'
|
metadata
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sql_footprint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Joyce
|
8
|
+
- Michael Gee
|
9
|
+
- Derek Schneider
|
8
10
|
autorequire:
|
9
11
|
bindir: exe
|
10
12
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
13
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
14
|
dependencies:
|
13
15
|
- !ruby/object:Gem::Dependency
|
14
16
|
name: activerecord
|
@@ -138,7 +140,9 @@ dependencies:
|
|
138
140
|
version: '0'
|
139
141
|
description: Check your footprint file into source control
|
140
142
|
email:
|
141
|
-
-
|
143
|
+
- brandon@sonerdy.com
|
144
|
+
- michaelpgee@gmail.com
|
145
|
+
- dschneider@covermymeds.com
|
142
146
|
executables: []
|
143
147
|
extensions: []
|
144
148
|
extra_rdoc_files: []
|
@@ -155,6 +159,7 @@ files:
|
|
155
159
|
- lib/sql_footprint.rb
|
156
160
|
- lib/sql_footprint/sql_anonymizer.rb
|
157
161
|
- lib/sql_footprint/sql_filter.rb
|
162
|
+
- lib/sql_footprint/sql_statements.rb
|
158
163
|
- lib/sql_footprint/version.rb
|
159
164
|
- sql_footprint.gemspec
|
160
165
|
homepage: https://github.com/covermymeds/sql_footprint
|