Class: AssLauncher::Support::Shell::RunAssResult Private
- Inherits:
-
Object
- Object
- AssLauncher::Support::Shell::RunAssResult
- Defined in:
- lib/ass_launcher/support/shell.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.
Contain result for execute 1C binary see ProcessHolder#result
Defined Under Namespace
Classes: RunAssError, UnexpectedAssOut
Constant Summary collapse
- CUT_ASSOUT_LENGTH =
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.
640
Instance Attribute Summary collapse
- #assout ⇒ Object readonly private
- #err ⇒ Object readonly private
- #exitstatus ⇒ Object readonly private
- #expected_assout ⇒ Object private
- #out ⇒ Object readonly private
Instance Method Summary collapse
-
#expected_assout? ⇒ Boolean
Checkin #assout string If existstatus != 0 checking assout value skiped and return true It work when exitstatus == 0 but taken unexpected assout.
-
#initialize(exitstatus, out, err, assout) ⇒ RunAssResult
constructor
private
A new instance of RunAssResult.
- #success? ⇒ Boolean
-
#verify! ⇒ Object
Verivfy of result and raises unless #success?.
Constructor Details
#initialize(exitstatus, out, err, assout) ⇒ RunAssResult
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 RunAssResult.
309 310 311 312 313 314 |
# File 'lib/ass_launcher/support/shell.rb', line 309 def initialize(exitstatus, out, err, assout) @err = err @out = out @exitstatus = exitstatus @assout = assout end |
Instance Attribute Details
#assout ⇒ 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.
307 308 309 |
# File 'lib/ass_launcher/support/shell.rb', line 307 def assout @assout end |
#err ⇒ 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.
307 308 309 |
# File 'lib/ass_launcher/support/shell.rb', line 307 def err @err end |
#exitstatus ⇒ 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.
307 308 309 |
# File 'lib/ass_launcher/support/shell.rb', line 307 def exitstatus @exitstatus end |
#expected_assout ⇒ 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.
308 309 310 |
# File 'lib/ass_launcher/support/shell.rb', line 308 def expected_assout @expected_assout end |
#out ⇒ 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.
307 308 309 |
# File 'lib/ass_launcher/support/shell.rb', line 307 def out @out end |
Instance Method Details
#expected_assout? ⇒ Boolean
Sometimes 1C does what we not expects. For example, we ask to create InfoBase File=“tmptmp.ib” however 1C make files of infobase in root of ‘tmp' directory and exits with status 0. In this case we have to check assout for answer executed success? or not.
Checkin #assout string If existstatus != 0 checking assout value skiped and return true It work when exitstatus == 0 but taken unexpected assout
360 361 362 363 364 |
# File 'lib/ass_launcher/support/shell.rb', line 360 def expected_assout? return true if expected_assout.nil? return true if exitstatus != 0 ! (expected_assout =~ assout).nil? end |
#success? ⇒ Boolean
336 337 338 |
# File 'lib/ass_launcher/support/shell.rb', line 336 def success? exitstatus == 0 && expected_assout? end |
#verify! ⇒ Object
Verivfy of result and raises unless #success?
321 322 323 324 325 |
# File 'lib/ass_launcher/support/shell.rb', line 321 def verify! fail UnexpectedAssOut, cut_assout unless expected_assout? fail RunAssError, "#{err}#{cut_assout}" unless success? self end |