Module: AssLauncher::Api

Overview

Helpers for easy to use ass_launcher

Instance Method Summary collapse

Instance Method Details

#cs(connstr) ⇒ Server | File | Http

Analyzes connect string and build suitable class

Examples:

include AssLauncher::Api
file_cs = cs 'file="path";'
srv_cs = cs 'srvr="host";ref="ib_name";'
http_cs = cs 'ws="http://host/ib";'

Returns:

  • (Server | File | Http)

    instanse


71
72
73
# File 'lib/ass_launcher/api.rb', line 71

def cs(connstr)
  AssLauncher::Support::ConnectionString.new(connstr)
end

#cs_file(hash) ⇒ AssLauncher::Support::ConnectionString::File

Examples:

include AssLauncher::Api
fcs = cs_file({:file => 'path'})

Returns:


79
80
81
# File 'lib/ass_launcher/api.rb', line 79

def cs_file(hash)
  AssLauncher::Support::ConnectionString::File.new hash
end

#cs_http(hash) ⇒ AssLauncher::Support::ConnectionString::Http

Examples:

include AssLauncher::Api
httpcs = cs_http({:ws => 'http://host/ib'})

Returns:


87
88
89
# File 'lib/ass_launcher/api.rb', line 87

def cs_http(hash)
  AssLauncher::Support::ConnectionString::Http.new hash
end

#cs_srv(hash) ⇒ AssLauncher::Support::ConnectionString::Server

Examples:

include AssLauncher::Api
srvcs = cs_srv({:srvr => 'host', :ref=> 'ib'})

Returns:


95
96
97
# File 'lib/ass_launcher/api.rb', line 95

def cs_srv(hash)
  AssLauncher::Support::ConnectionString::Server.new hash
end

#load_v8i(filename) ⇒ Object

Read v8i file

Examples:

include AssLauncher::Api

v8i = load_v8i('infobase.v8i')[0]
conn_str = cs(v8i[:connect])
conn_str.usr = 'admin'
conn_str.pwd = 'password'
designer = thicks.last.command(:designer, conn_str.to_args)
designer.run.wait

Parameters:

Raises:

  • (ReadError)

    if file not exists


109
110
111
# File 'lib/ass_launcher/api.rb', line 109

def load_v8i(filename)
  AssLauncher::Support::V8iFile.load(filename)
end

#ole(type, requiremet = '>= 0') ⇒ Object

Return 1C ole client suitable class instance

Parameters:

Raises:

  • (ArgumentError)

    if invalid type given


118
119
120
# File 'lib/ass_launcher/api.rb', line 118

def ole(type, requiremet = '>= 0')
  AssLauncher::Enterprise::Ole.ole_client(type).new(requiremet)
end

#thicks(requiremet = '>= 0') ⇒ Array<AssLauncher::Enterprise::BinaryWrapper::ThickClient>

Return sorted array of instaled 1C binary wrappers

Examples:

inclide AssLauncher::Api
# I can get 1C thick client specific version
cl = thicks('~> 8.3.8.0').last
fail "Client '~> 8.3.8.0' not found" if cl.nil?

Parameters:

  • requiremet (String, Gem::Version::Requirement) (defaults to: '>= 0')

    spec require version

Returns:


13
14
15
# File 'lib/ass_launcher/api.rb', line 13

def thicks(requiremet = '>= 0')
  AssLauncher::Enterprise.thick_clients(requiremet).sort
end

#thicks_i386(requiremet = '>=0') ⇒ Array<AssLauncher::Enterprise::BinaryWrapper::ThickClient>

Return sorted array of instaled i386 1C binary wrappers

Parameters:

  • requiremet (String, Gem::Version::Requirement) (defaults to: '>=0')

    spec require version

Returns:


29
30
31
32
33
# File 'lib/ass_launcher/api.rb', line 29

def thicks_i386(requiremet = '>=0')
  thicks(requiremet).select do |bw|
    !bw.x86_64?
  end
end

#thicks_x86_64(requiremet = '>=0') ⇒ Array<AssLauncher::Enterprise::BinaryWrapper::ThickClient>

Return sorted array of instaled x86_64 1C binary wrappers

Parameters:

  • requiremet (String, Gem::Version::Requirement) (defaults to: '>=0')

    spec require version

Returns:


20
21
22
23
24
# File 'lib/ass_launcher/api.rb', line 20

def thicks_x86_64(requiremet = '>=0')
  thicks(requiremet).select do |bw|
    bw.x86_64?
  end
end

#thins(requiremet = '>= 0') ⇒ Array<AssLauncher::Enterprise::BinaryWrapper::ThinClient>

Return sorted array of instaled 1C binary wrappers

Examples:

inclide AssLauncher::Api
# I can get 1C thin client specific version
cl = thins('~> 8.3.8.0').last
fail "Client '~> 8.3.8.0' not found" if cl.nil?

Parameters:

  • requiremet (String, Gem::Version::Requirement) (defaults to: '>= 0')

    spec require version

Returns:


43
44
45
# File 'lib/ass_launcher/api.rb', line 43

def thins(requiremet = '>= 0')
  AssLauncher::Enterprise.thin_clients(requiremet).sort
end

#thins_i386(requiremet = '>=0') ⇒ Array<AssLauncher::Enterprise::BinaryWrapper::ThinClient>

Return sorted array of instaled i386 1C binary wrappers

Parameters:

  • requiremet (String, Gem::Version::Requirement) (defaults to: '>=0')

    spec require version

Returns:


59
60
61
62
63
# File 'lib/ass_launcher/api.rb', line 59

def thins_i386(requiremet = '>=0')
  thins(requiremet).select do |bw|
    !bw.x86_64?
  end
end

#thins_x86_64(requiremet = '>=0') ⇒ Array<AssLauncher::Enterprise::BinaryWrapper::ThinClient>

Return sorted array of instaled x86_64 1C binary wrappers

Parameters:

  • requiremet (String, Gem::Version::Requirement) (defaults to: '>=0')

    spec require version

Returns:


50
51
52
53
54
# File 'lib/ass_launcher/api.rb', line 50

def thins_x86_64(requiremet = '>=0')
  thins(requiremet).select do |bw|
    bw.x86_64?
  end
end

#web_client(uri = nil, version = nil) ⇒ AssLauncher::Enterprise::WebClient

Examples:

include AssLauncher::Api

# Get web client instanse for connect to
# infobase 'http://host/port/path/infobase'
wc = web_client('http://host/path/infobase')

loc = wc.location do
  _N 'user_name'
  _P 'password'
  _L 'en'
end # => URI

# Or do it with uses connecton string
connstr =  cs 'ws="http://host/path/infobase";usr="user";pwd="password"'
wc = web_client(connstr.uri)
loc = wc.location do
  _L 'en'
end # => URI

# And use given location URI with selenium driver:
# driver.navigate.to loc.to_s

Returns:


145
146
147
# File 'lib/ass_launcher/api.rb', line 145

def web_client(uri = nil, version = nil)
  AssLauncher::Enterprise.web_client(uri, version)
end