Class: AssLauncher::Support::ConnectionString::File
- Inherits:
-
Object
- Object
- AssLauncher::Support::ConnectionString::File
- Includes:
- AssLauncher::Support::ConnectionString
- Defined in:
- lib/ass_launcher/support/connection_string.rb
Overview
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, DB_FORMAT_VALUES, DB_PAGE_SIZE_VALUES, FILE_FIELDS, HTTP_FIELDS, HTTP_WEB_AUTH_FIELDS, IB_MAKER_FIELDS, PROXY_FIELDS, SERVER_FIELDS
Class Method Summary collapse
Instance Method Summary collapse
-
#createinfobase_args ⇒ Object
Build args array suitable for :createinfibase runmode Fucking 1C: - File=“path” not work but work running as script - File=‘path’ work correct.
-
#createinfobase_cmd ⇒ Object
Build string suitable for :createinfibase runmode.
- #file=(str) ⇒ Object
-
#initialize(hash) ⇒ File
constructor
A new instance of File.
- #path ⇒ Object
-
#to_ole_string ⇒ Object
Build string suitable for Ole objects connecting.
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.
348 349 350 351 |
# File 'lib/ass_launcher/support/connection_string.rb', line 348 def initialize(hash) fail ConnectionString::Error unless required_fields_received?(hash) _set_properties(hash) end |
Class Method Details
.fields ⇒ Object
344 345 346 |
# File 'lib/ass_launcher/support/connection_string.rb', line 344 def self.fields required_fields | COMMON_FIELDS end |
.required_fields ⇒ Object
340 341 342 |
# File 'lib/ass_launcher/support/connection_string.rb', line 340 def self.required_fields FILE_FIELDS end |
Instance Method Details
#createinfobase_args ⇒ Object
Build args array suitable for :createinfibase runmode Fucking 1C:
-
File=“path” not work but work running as script
-
File=‘path’ work correct
374 375 376 377 |
# File 'lib/ass_launcher/support/connection_string.rb', line 374 def createinfobase_args return ["File='#{path.win_string}'"] if path.relative? ["File='#{path.realdirpath.win_string}'"] end |
#createinfobase_cmd ⇒ Object
Build string suitable for :createinfibase runmode
360 361 362 |
# File 'lib/ass_launcher/support/connection_string.rb', line 360 def createinfobase_cmd "File=\"#{path.realdirpath.win_string}\"" end |
#file=(str) ⇒ Object
353 354 355 356 |
# File 'lib/ass_launcher/support/connection_string.rb', line 353 def file=(str) fail ArgumentError if str.empty? @file = str end |
#path ⇒ Object
379 380 381 |
# File 'lib/ass_launcher/support/connection_string.rb', line 379 def path AssLauncher::Support::Platforms.path(file) end |
#to_ole_string ⇒ Object
Build string suitable for Ole objects connecting.
365 366 367 |
# File 'lib/ass_launcher/support/connection_string.rb', line 365 def to_ole_string "#{createinfobase_cmd};#{to_s(fields - ['File'])}" end |