Sha256: fb48723cceaa49a6f6b6e21b35e397c15be712739f598cf70c404472b3208925

Contents?: true

Size: 462 Bytes

Versions: 2

Compression:

Stored size: 462 Bytes

Contents

# encoding: utf-8
class Locomotive::Cmd::MongoChecker < Thor::Group
  def exists?
    mongo_path = `which mongo`
    if mongo_path.include? 'mongo'
      say 'Mongo installation: ✔', :green
    else
      say 'Mongo installation: ✗ (mongo command not found)', :red
    end
  end

  def running?
    mongo = `ps cax | grep mongod`
    unless mongo.include? 'mongod'
      say 'MongoDB is not running, please turn it on!', :red
      exit -1
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
locomotive_cmd-0.0.2 lib/locomotive_cmd/mongo_checker.rb
locomotive_cmd-0.0.1 lib/locomotive_cmd/mongo_checker.rb