Class: AssLauncher::Enterprise::BinaryWrapper Abstract Private
- Inherits:
-
Object
- Object
- AssLauncher::Enterprise::BinaryWrapper
- Includes:
- Support::Platforms
- Defined in:
- lib/ass_launcher/enterprise/binary_wrapper.rb
Overview
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.
In Windows version parsed from path and may content incorrect value - not real 1C platform version see #extract_version. For platform > 8.2 if 1C platform instaled in standart directories it works correctly.
In linux version returns from method Support::Linux.get_pkg_version
Class for wrapping 1C:Enterprise platform binary executables such as 1cv8.exe and 1cv8c.exe. Class makes it easy to juggle with the different versions of 1C:Enterprise installations
Direct Known Subclasses
Defined Under Namespace
Classes: ThickClient, ThinClient
Constant Summary collapse
- V64_FILES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
%w{version64.dat version64.txt}
- X86_64 =
'x86_64'
- I386 =
'i386'
Instance Attribute Summary collapse
- #path ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
-
#<=>(other) ⇒ Bollean
Compare wrappers on version for sortable.
-
#arch ⇒ String
Define arch on 1C platform.
- #cli_spec ⇒ Cli::CliSpec
-
#exists? ⇒ Boolean
True if file exsists.
-
#initialize(binpath) ⇒ BinaryWrapper
constructor
private
A new instance of BinaryWrapper.
-
#major_v ⇒ String
Return 2 major digits from version.
- #run_modes ⇒ Array<Symbol>
-
#version ⇒ Gem::Version
Define version of 1C platform.
- #x86_64? ⇒ Boolean
Methods included from Support::Platforms
cygwin?, env, glob, linux?, path, path_class, windows?
Constructor Details
#initialize(binpath) ⇒ BinaryWrapper
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.
Returns a new instance of BinaryWrapper.
26 27 28 29 30 31 32 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 26 def initialize(binpath) @path = platform.path(binpath).realpath fail ArgumentError, "Is not a file `#{binpath}'" unless @path.file? fail ArgumentError, "Invalid binary #{@path.basename} for #{self.class}" unless\ @path.basename.to_s.upcase == expects_basename.upcase end |
Instance Attribute Details
#path ⇒ Object (readonly)
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.
19 20 21 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 19 def path @path end |
Class Method Details
.run_modes ⇒ Array<Symbol>
173 174 175 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 173 def self.run_modes Cli.defined_modes_for(self) end |
Instance Method Details
#<=>(other) ⇒ Bollean
Compare wrappers on version for sortable
112 113 114 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 112 def <=>(other) version <=> other.version end |
#arch ⇒ String
Define arch on 1C platform.
52 53 54 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 52 def arch @arch ||= extract_arch end |
#cli_spec ⇒ Cli::CliSpec
185 186 187 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 185 def cli_spec @cli_spec ||= Cli::CliSpec.for(self) end |
#exists? ⇒ Boolean
True if file exsists
123 124 125 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 123 def exists? path.file? end |
#major_v ⇒ String
Return 2 major digits from version
130 131 132 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 130 def major_v version.to_s.split('.')[0, 2].join('.') end |
#run_modes ⇒ Array<Symbol>
179 180 181 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 179 def run_modes self.class.run_modes end |
#version ⇒ Gem::Version
In Windows version parsed from path and may content incorrect value - not real 1C platform version see #extract_version. For platform > 8.2 if 1C platform instaled in standart directories it works correctly.
In linux version returns from method Support::Linux.get_pkg_version
Define version of 1C platform.
45 46 47 |
# File 'lib/ass_launcher/enterprise/binary_wrapper.rb', line 45 def version @version ||= extract_version(path.to_s) end |