Module: MongoDelta::CLI
- Extended by:
- Logging
- Defined in:
- lib/mongo_delta/cli.rb
Class Attribute Summary collapse
-
.config_path ⇒ Object
Returns the value of attribute config_path.
-
.db ⇒ Object
Returns the value of attribute db.
-
.ignore_errors ⇒ Object
Returns the value of attribute ignore_errors.
-
.optime ⇒ Object
Returns the value of attribute optime.
-
.service ⇒ Object
Returns the value of attribute service.
-
.source_uri ⇒ Object
Returns the value of attribute source_uri.
Class Method Summary collapse
Methods included from Logging
Class Attribute Details
.config_path ⇒ Object
Returns the value of attribute config_path.
11 12 13 |
# File 'lib/mongo_delta/cli.rb', line 11 def config_path @config_path end |
.db ⇒ Object
Returns the value of attribute db.
11 12 13 |
# File 'lib/mongo_delta/cli.rb', line 11 def db @db end |
.ignore_errors ⇒ Object
Returns the value of attribute ignore_errors.
11 12 13 |
# File 'lib/mongo_delta/cli.rb', line 11 def ignore_errors @ignore_errors end |
.optime ⇒ Object
Returns the value of attribute optime.
11 12 13 |
# File 'lib/mongo_delta/cli.rb', line 11 def optime @optime end |
.service ⇒ Object
Returns the value of attribute service.
11 12 13 |
# File 'lib/mongo_delta/cli.rb', line 11 def service @service end |
.source_uri ⇒ Object
Returns the value of attribute source_uri.
11 12 13 |
# File 'lib/mongo_delta/cli.rb', line 11 def source_uri @source_uri end |
Class Method Details
.start ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mongo_delta/cli.rb', line 13 def start config = if config_path Configuration.load_from_file(config_path) else Configuration.load_from_db(source_uri, db, service) end config.db = db config.service = service config.ignore_errors = ignore_errors stream = Stream.new(config) stream.run(optime) rescue Mongo::ConnectionFailure, Configuration::Error logger.fatal($!.) exit(1) end |