Class: AssLauncher::Support::Shell::AssOutFile Private
- Inherits:
-
Object
- Object
- AssLauncher::Support::Shell::AssOutFile
- Includes:
- Platforms
- 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.
Fucking 1C not work with stdout and stderr For out 1C use /OUT“file” parameter and write message into. Message encoding ‘cp1251’ for windows and ‘utf-8’ for Linux
Hold, read and encode 1C output
Instance Attribute Summary collapse
- #encoding ⇒ Object readonly private
- #file ⇒ Object readonly private
- #path ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(encoding = nil) ⇒ AssOutFile
constructor
private
A new instance of AssOutFile.
- #read ⇒ Object private
- #to_s ⇒ Object private
Methods included from Platforms
cygwin?, env, glob, linux?, path, path_class, windows?
Constructor Details
#initialize(encoding = nil) ⇒ AssOutFile
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 AssOutFile.
376 377 378 379 380 381 |
# File 'lib/ass_launcher/support/shell.rb', line 376 def initialize(encoding = nil) @file = Tempfile.new('ass_out') @file.close @path = platform.path(@file.path) @encoding = encoding || Encoding::CP1251 end |
Instance Attribute Details
#encoding ⇒ 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.
375 376 377 |
# File 'lib/ass_launcher/support/shell.rb', line 375 def encoding @encoding end |
#file ⇒ 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.
375 376 377 |
# File 'lib/ass_launcher/support/shell.rb', line 375 def file @file end |
#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.
375 376 377 |
# File 'lib/ass_launcher/support/shell.rb', line 375 def path @path end |
Instance Method Details
#read ⇒ 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.
387 388 389 390 391 392 393 394 395 396 397 |
# File 'lib/ass_launcher/support/shell.rb', line 387 def read begin @file.open s = @file.read s.encode! Encoding::UTF_8, encoding unless linux? ensure @file.close @file.unlink end s.to_s end |
#to_s ⇒ 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.
383 384 385 |
# File 'lib/ass_launcher/support/shell.rb', line 383 def to_s @path.to_s end |