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.6.2 lib/cli/database_console.rb
request-log-analyzer-1.6.1 lib/cli/database_console.rb
request-log-analyzer-1.6.0 lib/cli/database_console.rb
request-log-analyzer-1.5.4 lib/cli/database_console.rb
request-log-analyzer-1.5.3 lib/cli/database_console.rb
request-log-analyzer-1.5.2 lib/cli/database_console.rb
request-log-analyzer-1.5.1 lib/cli/database_console.rb
request-log-analyzer-1.5.0 lib/cli/database_console.rb
request-log-analyzer-1.4.2 lib/cli/database_console.rb
ngmoco-request-log-analyzer-1.4.2 lib/cli/database_console.rb
request-log-analyzer-1.4.1 lib/cli/database_console.rb
request-log-analyzer-1.4.0.1 lib/cli/database_console.rb
request-log-analyzer-1.4.0 lib/cli/database_console.rb