Class: Pgai::CloneManager
- Inherits:
-
Object
- Object
- Pgai::CloneManager
- Defined in:
- lib/pgai/clone_manager.rb
Constant Summary collapse
- HOSTNAME =
"127.0.0.1"
Instance Method Summary collapse
- #cleanup ⇒ Object
- #connect ⇒ Object
-
#initialize(environment, config:) ⇒ CloneManager
constructor
A new instance of CloneManager.
Constructor Details
#initialize(environment, config:) ⇒ CloneManager
Returns a new instance of CloneManager.
7 8 9 10 11 12 |
# File 'lib/pgai/clone_manager.rb', line 7 def initialize(environment, config:) @environment = environment @config = config @port_forward = PortForward.new(config: config, hostname: HOSTNAME) @dblab = Dblab.new(config: config, hostname: HOSTNAME) end |
Instance Method Details
#cleanup ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/pgai/clone_manager.rb', line 20 def cleanup configure_enviroment return unless find_raw_clone dblab.destroy_clone(id: clone_id) config.remove_clone(clone_id) port_forward.stop end |
#connect ⇒ Object
14 15 16 17 18 |
# File 'lib/pgai/clone_manager.rb', line 14 def connect configure_enviroment psql find_or_create_clone end |