Class: AssLauncher::Support::ConnectionString::File

Inherits:
Object
  • Object
show all
Includes:
AssLauncher::Support::ConnectionString
Defined in:
lib/ass_launcher/support/connection_string.rb

Overview

Note:

All connection string class have methods for get and set values of defined fields. Methods have name as fields but in downcase All fields defined for connection string class retutn #fields

Connection string for file-infobases

Constant Summary

Constants included from AssLauncher::Support::ConnectionString

COMMON_FIELDS, DBMS_VALUES, FILE_FIELDS, HTTP_FIELDS, HTTP_WEB_AUTH_FIELDS, IB_MAKER_FIELDS, PROXY_FIELDS, SERVER_FIELDS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AssLauncher::Support::ConnectionString

#fields, included, #is, #is?, new, parse, #required_fields, #to_args, #to_cmd, #to_hash, #to_s

Constructor Details

#initialize(hash) ⇒ File

Returns a new instance of File.



330
331
332
333
# File 'lib/ass_launcher/support/connection_string.rb', line 330

def initialize(hash)
  fail ConnectionString::Error unless required_fields_received?(hash)
  _set_properties(hash)
end

Class Method Details

.fieldsObject



326
327
328
# File 'lib/ass_launcher/support/connection_string.rb', line 326

def self.fields
  required_fields | COMMON_FIELDS
end

.required_fieldsObject



322
323
324
# File 'lib/ass_launcher/support/connection_string.rb', line 322

def self.required_fields
  FILE_FIELDS
end

Instance Method Details

#createinfobase_argsObject

Build args array suitable for :createinfibase runmode Fucking 1C:

  • File=“path” not work but work running as script

  • File=‘path’ work correct



356
357
358
359
# File 'lib/ass_launcher/support/connection_string.rb', line 356

def createinfobase_args
  return ["File='#{path.win_string}'"] if path.relative?
  ["File='#{path.realdirpath.win_string}'"]
end

#createinfobase_cmdObject

Build string suitable for :createinfibase runmode



342
343
344
# File 'lib/ass_launcher/support/connection_string.rb', line 342

def createinfobase_cmd
  "File=\"#{path.realdirpath.win_string}\""
end

#file=(str) ⇒ Object



335
336
337
338
# File 'lib/ass_launcher/support/connection_string.rb', line 335

def file=(str)
  fail ArgumentError if str.empty?
  @file = str
end

#pathObject



361
362
363
# File 'lib/ass_launcher/support/connection_string.rb', line 361

def path
  AssLauncher::Support::Platforms.path(file)
end

#to_ole_stringObject

Build string suitable for Ole objects connecting.



347
348
349
# File 'lib/ass_launcher/support/connection_string.rb', line 347

def to_ole_string
  "#{createinfobase_cmd};#{to_s(fields - ['File'])}"
end