Sha256: a6c940743f185366cab2a2d5e11e7e6f4b09f7cfb8a4f10b490cd806da3f4026

Contents?: true

Size: 711 Bytes

Versions: 11

Compression:

Stored size: 711 Bytes

Contents

class DatabaseConsole

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

  def initialize(arguments)
    @arguments = arguments
  end

  def run!
    libraries = ['irb/completion', 'rubygems','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

11 entries across 11 versions & 1 rubygems

Version Path
request-log-analyzer-1.13.1 lib/cli/database_console.rb
request-log-analyzer-1.13.0 lib/cli/database_console.rb
request-log-analyzer-1.12.11 lib/cli/database_console.rb
request-log-analyzer-1.12.10 lib/cli/database_console.rb
request-log-analyzer-1.12.9 lib/cli/database_console.rb
request-log-analyzer-1.12.8 lib/cli/database_console.rb
request-log-analyzer-1.12.7 lib/cli/database_console.rb
request-log-analyzer-1.12.6 lib/cli/database_console.rb
request-log-analyzer-1.12.5 lib/cli/database_console.rb
request-log-analyzer-1.12.4 lib/cli/database_console.rb
request-log-analyzer-1.12.3 lib/cli/database_console.rb