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.
323 324 325 326 327 328 |
# File 'lib/ass_launcher/support/shell.rb', line 323 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.
321 322 323 |
# File 'lib/ass_launcher/support/shell.rb', line 321 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.
321 322 323 |
# File 'lib/ass_launcher/support/shell.rb', line 321 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.
321 322 323 |
# File 'lib/ass_launcher/support/shell.rb', line 321 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.
322 323 324 |
# File 'lib/ass_launcher/support/shell.rb', line 322 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.
321 322 323 |
# File 'lib/ass_launcher/support/shell.rb', line 321 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
374 375 376 377 378 |
# File 'lib/ass_launcher/support/shell.rb', line 374 def expected_assout? return true if expected_assout.nil? return true if exitstatus != 0 ! (expected_assout =~ assout).nil? end |
#success? ⇒ Boolean
350 351 352 |
# File 'lib/ass_launcher/support/shell.rb', line 350 def success? exitstatus == 0 && expected_assout? end |
#verify! ⇒ Object
Verivfy of result and raises unless #success?
335 336 337 338 339 |
# File 'lib/ass_launcher/support/shell.rb', line 335 def verify! fail UnexpectedAssOut, cut_assout unless expected_assout? fail RunAssError, "#{err}#{cut_assout}" unless success? self end |