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



67
68
69
70
71
72
73
74
75
76
# File 'lib/ooor/services.rb', line 67

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", password, db_name, demo, lang, user_password)
  sleep(2)
  while get_progress(password, process_id)[0] != 1
    @session.logger.info "..."
    sleep(0.5)
  end
  @session.(username: 'admin', password: user_password, database: db_name)
end