Class: Locomotive::Cmd::MongoChecker
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Locomotive::Cmd::MongoChecker
- Defined in:
- lib/locomotive_cmd/mongo_checker.rb
Instance Method Summary collapse
Instance Method Details
#exists? ⇒ Boolean
3 4 5 6 7 8 9 10 |
# File 'lib/locomotive_cmd/mongo_checker.rb', line 3 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 |
#running? ⇒ Boolean
12 13 14 15 16 17 18 |
# File 'lib/locomotive_cmd/mongo_checker.rb', line 12 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 |