Class: ImageGenie::Test
- Inherits:
-
Command
- Object
- Command
- ImageGenie::Test
- Defined in:
- lib/image_genie/test.rb
Instance Attribute Summary collapse
-
#temp_image_file ⇒ Object
Returns the value of attribute temp_image_file.
-
#temp_image_list_file ⇒ Object
Returns the value of attribute temp_image_list_file.
Instance Method Summary collapse
- #error ⇒ Object
-
#initialize(options = {}) ⇒ Test
constructor
A new instance of Test.
- #input ⇒ Object
- #output ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Test
Returns a new instance of Test.
26 27 28 29 30 31 32 |
# File 'lib/image_genie/test.rb', line 26 def initialize(={}) self.exception_class = TestError # Dir.chdir(Dir::tmpdir) # # Create a temp file that will be all component files of this montage # self.temp_image_file = Tempfile.new(['montage','.jpg']) # self.temp_image_list_file = Tempfile.new(['montage_image_filenames','.txt']) end |
Instance Attribute Details
#temp_image_file ⇒ Object
Returns the value of attribute temp_image_file.
4 5 6 |
# File 'lib/image_genie/test.rb', line 4 def temp_image_file @temp_image_file end |
#temp_image_list_file ⇒ Object
Returns the value of attribute temp_image_list_file.
4 5 6 |
# File 'lib/image_genie/test.rb', line 4 def temp_image_list_file @temp_image_list_file end |
Instance Method Details
#error ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/image_genie/test.rb', line 18 def error if has_error? errors = stderr.read.strip # logger.error("#{self.name} #{errors}") raise(exception_class, errors) end end |
#input ⇒ Object
6 7 |
# File 'lib/image_genie/test.rb', line 6 def input end |
#output ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/image_genie/test.rb', line 9 def output while !stdout.eof? puts stdout.readline # self.temp_image_file.puts stdout.readline end # temp_image_file.rewind end |
#run ⇒ Object
34 35 36 |
# File 'lib/image_genie/test.rb', line 34 def run execute("ls WERIOWEK",self) end |