Module: AssLauncher::Enterprise

Extended by:
Support::Platforms
Defined in:
lib/ass_launcher/enterprise.rb,
lib/ass_launcher/enterprise/cli.rb,
lib/ass_launcher/enterprise/ole.rb,
lib/ass_launcher/enterprise/cli_def.rb,
lib/ass_launcher/enterprise/web_client.rb,
lib/ass_launcher/enterprise/cli/spec_dsl.rb,
lib/ass_launcher/enterprise/binary_wrapper.rb,
lib/ass_launcher/enterprise/cli/parameters.rb,
lib/ass_launcher/enterprise/cli_defs_loader.rb,
lib/ass_launcher/enterprise/ole/ole_binaries.rb,
lib/ass_launcher/enterprise/cli/binary_matcher.rb,
lib/ass_launcher/enterprise/cli/arguments_builder.rb,
lib/ass_launcher/enterprise/cli/spec_dsl/dsl_helpers.rb

Overview

1C:Entrprise platform abstraction layer

Defined Under Namespace

Modules: Cli, CliDef, CliDefsLoader, Ole Classes: BinaryWrapper, WebClient

Constant Summary collapse

WIN_BINARIES =
{ BinaryWrapper::ThinClient => '1cv8c.exe',
                 BinaryWrapper::ThickClient => '1cv8.exe'
}.freeze
LINUX_BINARIES =
{ BinaryWrapper::ThinClient => '1cv8c',
                   BinaryWrapper::ThickClient => '1cv8'
}.freeze

Class Method Summary collapse

Methods included from Support::Platforms

cygwin?, env, glob, path, path_class, windows?

Class Method Details

.binaries(klass) ⇒ 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.



52
53
54
55
56
57
58
# File 'lib/ass_launcher/enterprise.rb', line 52

def self.binaries(klass)
  if windows_or_cygwin?
    WIN_BINARIES[klass]
  elsif linux?
    LINUX_BINARIES[klass]
  end
end

.binary_wrappers_cacheHash

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.

Caching BinaryWrapper instances

Returns:

  • (Hash)


63
64
65
# File 'lib/ass_launcher/enterprise.rb', line 63

def self.binary_wrappers_cache
  @binary_wrappers_cache ||= {}
end

.clear_glob_cacheObject

Cliar glob_cache



121
122
123
# File 'lib/ass_launcher/enterprise.rb', line 121

def self.clear_glob_cache
  @glob_cache = nil
end

.glob_cacheHash

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.

Find binaries in Cygwin work slow. For rapid get binaries uses catch

Returns:

  • (Hash)


116
117
118
# File 'lib/ass_launcher/enterprise.rb', line 116

def self.glob_cache
  @glob_cache ||= {}
end

.search_pathsArray<String>

Note:
  • For Windows return value of ‘Program Files’ env.

  • For Linux return ‘/opt/1C’

  • In both cases you can set Configuration#search_path and it will be added into array

Return paths for searching instaled 1C platform

Returns:

  • (Array<String>)

    Array<String>



40
41
42
43
44
45
46
47
48
49
# File 'lib/ass_launcher/enterprise.rb', line 40

def self.search_paths
  sp = []
  sp << AssLauncher.config.search_path
  if windows_or_cygwin?
    sp += platform.env[/\Aprogram\s*(files.*|W6432)/i].uniq.map { |pf| "#{pf}/1c*" }
  elsif linux?
    sp += %w(/opt/1C /opt/1c)
  end
  sp.compact.uniq
end

.thick_clients(requiremet = '') ⇒ Array<BinaryWrapper::ThickClient>

Return array of wrappers for 1C platform(thick client) executables found in search_paths

Parameters:

  • requiremet (String) (defaults to: '')
    • suitable for [Gem::Requirement] string.

    Define requiremet version of 1C:Platform.

Returns:



99
100
101
102
103
# File 'lib/ass_launcher/enterprise.rb', line 99

def self.thick_clients(requiremet = '')
  find_clients(BinaryWrapper::ThickClient).map do |c|
    c if requiremet?(c, requiremet)
  end.compact
end

.thin_clients(requiremet = '') ⇒ Array<BinaryWrapper::ThinClient>

Return array of wrappers for 1C thin client executables found in search_paths

Parameters:

  • requiremet (String) (defaults to: '')
    • suitable for [Gem::Requirement] string.

    Define requiremet version of 1C:Platform.

Returns:



89
90
91
92
93
# File 'lib/ass_launcher/enterprise.rb', line 89

def self.thin_clients(requiremet = '')
  find_clients(BinaryWrapper::ThinClient).map do |c|
    c if requiremet?(c, requiremet)
  end.compact
end

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

Parameters:

Returns:



108
109
110
# File 'lib/ass_launcher/enterprise.rb', line 108

def self.web_client(uri = nil, version = nil)
  WebClient.new(uri, version)
end