Class: AssLauncher::Cmd::Main::SubCommands::MakeIb Private

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes included from Abstract::Option::Esrv

#esrv_host, #esrv_pass, #esrv_user

Attributes included from Abstract::Option::Dbsrv

#dbsrv_host, #dbsrv_pass, #dbsrv_user

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Abstract::BinaryWrapper

#binary_wrapper, #dry_run, included, #run_enterprise, #vrequrement

Methods included from Abstract::ClientMode

#client, #mode, #parrent_command

Methods included from Api

#cs, #cs_file, #cs_http, #cs_srv, #load_v8i, #ole, #thicks, #thicks_i386, #thicks_x86_64, #thins, #thins_i386, #thins_x86_64, #web_client

Methods included from Abstract::Option::Arch

#arch_any?, #expected_archs, included, #x86_64?

Methods included from Abstract::Option::SearchPath

included

Methods included from Abstract::Option::DryRun

included

Methods included from Abstract::Option::Version

included

Methods included from Abstract::Option::Pattern

included

Methods included from Abstract::Option::Esrv

included, #parse_esrv

Methods included from Support::SrvStrParser

#parse_srv_str

Methods included from Abstract::Option::Dbsrv

included, #parse_dbsrv

Methods included from Abstract::Option::Dbms

included

Methods included from Abstract::Parameter::IB_PATH_NAME

included

Methods included from Abstract::SubCommand::Declaration

#declare_subcommands, #subcommand_

Class Method Details

._bannerObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
# File 'lib/ass_launcher/cmd/makeib.rb', line 22

def self._banner
  'Make new information base'
end

.command_nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
# File 'lib/ass_launcher/cmd/makeib.rb', line 18

def self.command_name
  'makeib'
end

Instance Method Details

#_verify_required_option_Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



58
59
60
61
62
63
64
65
66
67
# File 'lib/ass_launcher/cmd/makeib.rb', line 58

def _verify_required_option_
  %w{esrv dbsrv}.each do |oname|
    next unless send(oname).to_s.empty?
    opt = self.class.recognised_options.find do |o|
      o.attribute_name == oname
    end
     signal_usage_error Clamp
       .message(:option_required, :option => opt.switches.first)
  end
end

#connection_stringObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

rubocop:disable Metrics/MethodLength, Metrics/AbcSize



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ass_launcher/cmd/makeib.rb', line 27

def connection_string
  return cs_file(file: ib_path) if dbms == 'File'
  cs = cs_srv(srvr: esrv_host, ref: ib_path)
  cs.dbms = dbms
  cs.dbsrvr = dbsrv_host
  cs.db = ib_path
  cs.dbuid = dbsrv_user
  cs.dbpwd = dbsrv_pass
  cs.crsqldb = 'Y'
  cs.susr = esrv_user
  cs.spwd = esrv_pass
  cs
end

#executeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



51
52
53
54
55
56
# File 'lib/ass_launcher/cmd/makeib.rb', line 51

def execute
  _verify_required_option_ unless dbms =~ %r{^File$}i
  cmd = run_enterprise(make_command)
  puts Colorize.green(cmd.process_holder.result.assout) unless\
    dry_run?
end

#make_commandObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

rubocop:enable Metrics/MethodLength, Metrics/AbcSize



42
43
44
45
46
47
48
49
# File 'lib/ass_launcher/cmd/makeib.rb', line 42

def make_command
  cs = connection_string
  template = pattern
  binary_wrapper.command(:createinfobase) do
    connection_string cs
    useTemplate template if template
  end
end