class MongoBrowser::CLI

Public Instance Methods

start() click to toggle source
# File lib/mongo_browser/cli.rb, line 20
def start
  setup_mongodb_connection!(options)
  run_thin(options)
end

Private Instance Methods

run_thin(options) click to toggle source
# File lib/mongo_browser/cli.rb, line 37
def run_thin(options)
  argv = ["start"]
  argv << ["-R", RACK_CONFIG]
  argv << ["-p", options[:port]]
  argv << ["-e", options[:environment]]

  puts "Application environment: #{options[:environment]}"
  puts "Application url: http://localhost:#{options[:port]}"
  Thin::Runner.new(argv.flatten).run!
end
setup_mongodb_connection!(options) click to toggle source
# File lib/mongo_browser/cli.rb, line 27
def setup_mongodb_connection!(options)
  port = options[:"mongodb-port"].to_i
  MongoBrowser.mongodb_port = port
  puts "MongoDB port: #{port}"

  host = options[:"mongodb-host"]
  MongoBrowser.mongodb_host = host
  puts "MongoDB host: #{host}"
end