Class: Cloudshaper::Remote
- Includes:
- Aws::RemoteS3
- Defined in:
- lib/cloudshaper/remote.rb
Overview
Wrap ‘remote’ commands, such as config, pull, and push This allows us to store state remotely using different providers
Defined Under Namespace
Classes: RemoteNotSupported
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(stack, command) ⇒ Remote
constructor
A new instance of Remote.
Methods inherited from Command
Constructor Details
#initialize(stack, command) ⇒ Remote
Returns a new instance of Remote.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cloudshaper/remote.rb', line 9 def initialize(stack, command) super unless @stack.remote.first puts "\tWARNING: #{@stack.name} is not configured with a remote backend" return end backend = @stack.remote.keys.first sym = "options_for_#{backend}" if self.respond_to?(sym, include_private: true) @command = send(sym, command) else fail RemoteNotSupported, "Remote backend #{backend} is not supported yet" end end |
Instance Method Details
#execute ⇒ Object
26 27 28 29 |
# File 'lib/cloudshaper/remote.rb', line 26 def execute return unless @stack.remote.first super end |