Class: Database::Remote

Inherits:
Base
  • Object
show all
Defined in:
lib/capistrano/db/database.rb

Instance Attribute Summary

Attributes inherited from Base

#capistrano, #config

Instance Method Summary collapse

Methods inherited from Base

#adapter, #postgresql?, #sqlite3?

Constructor Details

#initialize(instance, stage) ⇒ Remote

Returns a new instance of Remote.



23
24
25
26
27
28
# File 'lib/capistrano/db/database.rb', line 23

def initialize(instance, stage)
  super(instance)
  config = @capistrano.capture(
      "cat #{@capstrano.current_path}/config/database.yml")
  @config = YAML.load(ERB.new(config).result)[stage.to_s]
end