Module: SqlFootprint
- Defined in:
- lib/sql_footprint.rb,
lib/sql_footprint/version.rb,
lib/sql_footprint/sql_filter.rb,
lib/sql_footprint/sql_anonymizer.rb,
lib/sql_footprint/sql_statements.rb
Defined Under Namespace
Classes: SqlAnonymizer, SqlFilter, SqlStatements
Constant Summary
collapse
- FILENAME =
'footprint.sql'.freeze
- NEWLINE =
"\n".freeze
- VERSION =
'0.7.0'.freeze
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.statements ⇒ Object
Returns the value of attribute statements.
16
17
18
|
# File 'lib/sql_footprint.rb', line 16
def statements
@statements
end
|
Class Method Details
.capture(sql) ⇒ Object
37
38
39
40
|
# File 'lib/sql_footprint.rb', line 37
def capture sql
return unless @capture && @filter.capture?(sql)
@statements.add @anonymizer.anonymize(sql)
end
|
.exclude ⇒ Object
30
31
32
33
34
35
|
# File 'lib/sql_footprint.rb', line 30
def exclude
@capture = false
yield
ensure
@capture = true
end
|
.stop ⇒ Object
25
26
27
28
|
# File 'lib/sql_footprint.rb', line 25
def stop
@capture = false
File.write FILENAME, statements.sort.join(NEWLINE) + NEWLINE
end
|