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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c4a022824baa05659e89fb5590cd48114cfc4d4
4
- data.tar.gz: 68a503bd43029b143a8167242147eb1ea790b303
3
+ metadata.gz: 472446038c0bec9000ba7861f9e4d41b5d1cf3be
4
+ data.tar.gz: 9406bfd4eb1b50205b7d8b76751be74e96ca8e3b
5
5
  SHA512:
6
- metadata.gz: 58393dd270a2c1eee33ed1cee1994e0b54054bb2529389a47bf1bd689e53f03b37a7d14e755c29a052b74b75edaaafb225b201c5b98c7346919d76a48d5cfb89
7
- data.tar.gz: b0e264ff7f08317c298db502964061994ea107616af83e491280b3d10c38160868b7762579f4ebb18cf00c7a777f53d35b34ff5a72834fbc5e9f82e406ca4a05
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 'set'
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
- @lines = Set.new
22
+ @statements = SqlStatements.new
21
23
  end
22
24
 
23
25
  def stop
24
26
  @capture = false
25
- File.write FILENAME, lines.join(NEWLINE) + NEWLINE
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
- @lines << @anonymizer.anonymize(sql)
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
@@ -1,3 +1,3 @@
1
1
  module SqlFootprint
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
@@ -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 = ['bjoyce@covermymeds.com']
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.6.1
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-06 00:00:00.000000000 Z
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
- - bjoyce@covermymeds.com
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