Class: DeployMongo::DeltaProcessor
- Inherits:
-
Object
- Object
- DeployMongo::DeltaProcessor
- Defined in:
- lib/deploy_mongo/delta_processor.rb
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(config, delta) ⇒ DeltaProcessor
constructor
A new instance of DeltaProcessor.
- #rollback ⇒ Object
Constructor Details
#initialize(config, delta) ⇒ DeltaProcessor
Returns a new instance of DeltaProcessor.
4 5 6 7 |
# File 'lib/deploy_mongo/delta_processor.rb', line 4 def initialize(config,delta) @delta = delta @config = config end |
Instance Method Details
#apply ⇒ Object
9 10 11 12 13 |
# File 'lib/deploy_mongo/delta_processor.rb', line 9 def apply user_command = @delta.command.gsub("'","''") shell = MongoShell.new(@config.database,@config.mongo_shell_path) shell.execute(user_command) end |
#rollback ⇒ Object
15 16 17 18 19 |
# File 'lib/deploy_mongo/delta_processor.rb', line 15 def rollback user_rollback_command = @delta.rollback_command.gsub("'","''") shell = MongoShell.new(@config.database,@config.mongo_shell_path) shell.execute(user_rollback_command) end |