File: mongo_console

package info (click to toggle)
ruby-mongo 2.21.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,764 kB
  • sloc: ruby: 108,806; makefile: 5; sh: 2
file content (28 lines) | stat: -rwxr-xr-x 446 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby
# frozen_string_literal: true
# rubocop:todo all

$LOAD_PATH[0, 0] = File.join(File.dirname(__FILE__), '..', 'lib')

require 'mongo'
# include the mongo namespace
include Mongo

begin
  require 'pry'
rescue LoadError
end

begin
  require 'irb'
rescue LoadError
end

if defined?(Pry)
  Pry.config.prompt_name = 'mongo'
  Pry.start
elsif defined?(IRB)
  IRB.start
else
  abort 'LoadError: mongo_console requires Pry or IRB'
end