Sha256: 931d28729a13632079cae5f4a4572ff9be8ea0bbdd5e12b3f5ec136bb84f8a64

Contents?: true

Size: 749 Bytes

Versions: 33

Compression:

Stored size: 749 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/request_log_analyzer', './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

33 entries across 33 versions & 2 rubygems

Version Path
request-log-analyzer-1.11.1 lib/cli/database_console.rb
request-log-analyzer-1.11.0 lib/cli/database_console.rb
request-log-analyzer-1.10.1 lib/cli/database_console.rb
request-log-analyzer-1.10.0 lib/cli/database_console.rb
request-log-analyzer-1.9.10 lib/cli/database_console.rb
request-log-analyzer-1.9.9 lib/cli/database_console.rb
request-log-analyzer-1.9.8 lib/cli/database_console.rb
request-log-analyzer-1.9.7 lib/cli/database_console.rb
request-log-analyzer-1.9.6 lib/cli/database_console.rb
request-log-analyzer-1.9.5 lib/cli/database_console.rb
request-log-analyzer-1.9.4 lib/cli/database_console.rb
request-log-analyzer-1.9.3 lib/cli/database_console.rb
request-log-analyzer-1.9.2 lib/cli/database_console.rb
request-log-analyzer-1.9.1 lib/cli/database_console.rb
request-log-analyzer-1.9.0 lib/cli/database_console.rb
request-log-analyzer-1.8.1 lib/cli/database_console.rb
request-log-analyzer-1.8.0 lib/cli/database_console.rb
request-log-analyzer-1.7.0 lib/cli/database_console.rb
request-log-analyzer-1.6.4 lib/cli/database_console.rb
request-log-analyzer-1.6.3 lib/cli/database_console.rb