Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions bin/mongo_console
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
#!/usr/bin/env ruby

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

require 'mongo'
# include the mongo namespace
include Mongo

Pry.config.prompt_name = 'mongo'
Pry.start
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
1 change: 0 additions & 1 deletion mongo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ Gem::Specification.new do |s|
s.bindir = 'bin'

s.add_dependency 'bson', '~> 4.0'
s.add_dependency 'pry'
end