Sha256: 34ad252e7ffc176b84f258b5dd6ea06ac53d51189d1d628efdf1015f69ab5271

Contents?: true

Size: 745 Bytes

Versions: 4

Compression:

Stored size: 745 Bytes

Contents

class MyObfuscate
  module InsertStatementParser

    def parse(obfuscator, config, input_io, output_io)
      input_io.each do |line|
        if table_data = parse_insert_statement(line)
          table_name = table_data[:table_name]
          columns = table_data[:column_names]
          if config[table_name]
            output_io.puts obfuscator.obfuscate_bulk_insert_line(line, table_name, columns)
          else
            $stderr.puts "Deprecated: #{table_name} was not specified in the config.  A future release will cause this to be an error.  Please specify the table definition or set it to :keep."
            output_io.write line
          end
        else
          output_io.write line
        end
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
my_obfuscate-0.5.3 lib/my_obfuscate/insert_statement_parser.rb
my_obfuscate-0.5.2 lib/my_obfuscate/insert_statement_parser.rb
my_obfuscate-0.5.1 lib/my_obfuscate/insert_statement_parser.rb
my_obfuscate-0.5.0 lib/my_obfuscate/insert_statement_parser.rb