class AssMaintainer::InfoBase::ServerIb::ServerBaseMaker

@api private server infobase maker

Constants

REQUIRE_FIELDS

Fields of {#connection_string} required for 1C command createinfobase

Public Instance Methods

connection_string() click to toggle source

Return {InfoBase#connection_string} instance

# File lib/ass_maintainer/info_base/server_ib.rb, line 113
def connection_string
  infobase.connection_string
end
entry_point() click to toggle source

{InfoBase::Interfaces::IbMaker#entry_point} overload

# File lib/ass_maintainer/info_base/server_ib.rb, line 79
def entry_point
  prepare_making
  super
end
prepare_making() click to toggle source

Prepare {#connection_string} before execute making command

# File lib/ass_maintainer/info_base/server_ib.rb, line 85
def prepare_making
  fail "Fields #{REQUIRE_FIELDS} must be filled" unless require_filled?
  cs = connection_string
  set_if_empty :db, cs.ref
  set_if_empty :crsqldb, 'Y'
  set_if_empty :susr, infobase.cluster_usr
  set_if_empty :spwd, infobase.cluster_pwd
end
require_filled?() click to toggle source

True if all fields from {REQUIRE_FIELDS} setted in {#connection_string}

# File lib/ass_maintainer/info_base/server_ib.rb, line 96
def require_filled?
  REQUIRE_FIELDS.each do |f|
    return false if infobase.connection_string.send(f).nil?
  end
  true
end
set_if_empty(prop, value) click to toggle source

set {#connection_string} field prop to value if filed prop empty? @param prop [String Symbol] field name @param value

# File lib/ass_maintainer/info_base/server_ib.rb, line 107
def set_if_empty(prop, value)
  connection_string.send("#{prop}=", value) if\
    connection_string.send(prop).to_s.empty?
end