Sha256: 64448ce3ef47770f1db2653b113834dc4c0904c049ad49445cfdacda9e2f26d2
Contents?: true
Size: 337 Bytes
Versions: 3
Compression:
Stored size: 337 Bytes
Contents
class DatabaseStalker::Parser def initialize(log_file) @log_file = log_file end def table_names tables = [] File.open(@log_file, 'r') do |f| f.each_line do |line| matched = line.match(/INSERT\ INTO\ `(.+)` \(/) tables << matched[1] unless matched.nil? end end tables.uniq end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
database_stalker-0.1.2 | lib/database_stalker/parser.rb |
database_stalker-0.1.1 | lib/database_stalker/parser.rb |
database_stalker-0.1.0 | lib/database_stalker/parser.rb |