Class: Cloudscale::Plugins::PluginPostgresPreop
- Inherits:
-
Cloudscale::Preops::Preop
- Object
- Cloudscale::Preops::Preop
- Cloudscale::Plugins::PluginPostgresPreop
- Includes:
- Singleton
- Defined in:
- lib/cloudscale/plugins/preops/plugin_postgres_preop.rb
Constant Summary collapse
- @@options =
{ :host => { :argument => "--host", :description => "Host for your Postgres Instance (e.g. host.instance.com)", :required => true, :value => nil }, :port => { :argument => "--port", :description => "Port for your Postgres Instance (Standard 5432)", :required => false, :value => 5432 }, :db => { :argument => "--db", :description => "Database of your Postgres instance", :required => true, :value => nil }, :username => { :argument => "--username", :description => "Username for your Postgres instance", :required => false, :value => nil }, :password => { :argument => "--password", :description => "Password for your Postgres instance", :required => false, :value => nil } }
Instance Attribute Summary
Attributes inherited from Cloudscale::Preops::Preop
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize ⇒ PluginPostgresPreop
constructor
A new instance of PluginPostgresPreop.
- #options ⇒ Object
Methods inherited from Cloudscale::Preops::Preop
#clear_options, #get_option, #get_option_value, #init, #init_charts, #init_menus, #init_options, #save_options, #set_option_value
Constructor Details
#initialize ⇒ PluginPostgresPreop
Returns a new instance of PluginPostgresPreop.
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/cloudscale/plugins/preops/plugin_postgres_preop.rb', line 53 def initialize self.init begin @connection = PG.connect(:host => [:host][:value], :user => [:username][:value], :password => [:password][:value], :port => [:port][:value].to_i, :dbname => [:db][:value]) rescue PGError => e puts e. end end |
Instance Method Details
#connection ⇒ Object
64 65 66 |
# File 'lib/cloudscale/plugins/preops/plugin_postgres_preop.rb', line 64 def connection @connection end |
#options ⇒ Object
49 50 51 |
# File 'lib/cloudscale/plugins/preops/plugin_postgres_preop.rb', line 49 def end |