Sha256: 0d12198b66a6928de6b9aaa570cc6a8a1f3df9c5f25d869f74dc65dda711a561

Contents?: true

Size: 718 Bytes

Versions: 3

Compression:

Stored size: 718 Bytes

Contents

class DatabaseConsole

  IRB = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'

  def initialize(arguments)
    @arguments = arguments
  end

  def run!
    libraries = ['irb/completion', 'rubygems','./lib/cli/database_console_init']
    libaries_string = libraries.map { |l| "-r #{l}" }.join(' ')

    ENV['RLA_DBCONSOLE_DATABASE'] = @arguments[:database]
    if @arguments[:apache_format]
      ENV['RLA_DBCONSOLE_FORMAT'] = 'apache'
      ENV['RLA_DBCONSOLE_FORMAT_ARGUMENT'] = @arguments[:apache_format]
    else
      ENV['RLA_DBCONSOLE_FORMAT'] = @arguments[:format]
    end
    # ENV['RLA_DBCONSOLE_FORMAT_ARGS'] = arguments['database']

    exec("#{IRB} #{libaries_string} --simple-prompt")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
request-log-analyzer-1.12.2 lib/cli/database_console.rb
request-log-analyzer-1.12.1 lib/cli/database_console.rb
request-log-analyzer-1.12.0 lib/cli/database_console.rb