Class: Ooor::DbService

Inherits:
Service show all
Defined in:
lib/ooor/services.rb

Instance Method Summary collapse

Methods inherited from Service

define_service, #initialize

Constructor Details

This class inherits a constructor from Ooor::Service

Instance Method Details

#create(password = , db_name = 'ooor_test', demo = true, lang = 'en_US', user_password = @session.config[:password] || 'admin') ⇒ Object



83
84
85
86
87
88
89
90
91
92
# File 'lib/ooor/services.rb', line 83

def create(password=@session.config[:db_password], db_name='ooor_test', demo=true, lang='en_US', user_password=@session.config[:password] || 'admin')
  @session.logger.info "creating database #{db_name} this may take a while..."
  process_id = @session.get_client(:xml, @session.base_url + "/db").call("create_database", password, db_name, demo, lang, user_password)
  sleep(2)
  while process_id.is_a?(Integer) && get_progress(password, process_id)[0] != 1
    @session.logger.info "..."
    sleep(0.5)
  end
  @session.(username: 'admin', password: user_password, database: db_name)
end