Class: Visage::ISOGenerator
- Inherits:
-
Object
- Object
- Visage::ISOGenerator
- Defined in:
- lib/visage/iso_generator.rb
Instance Method Summary collapse
-
#initialize(source_file, destination) ⇒ ISOGenerator
constructor
Initialize the ISOGenerator source_file - source file to be turned into an ISO file destination - file system location where generated ISO will be placed.
-
#process(test = false) ⇒ Object
Runs or prints the command that generates an ISO for the source file test - if true only print the command otherwise run the command.
Constructor Details
#initialize(source_file, destination) ⇒ ISOGenerator
Initialize the ISOGenerator
source_file - source file to be turned into an ISO file
destination - file system location where generated ISO will be placed
8 9 10 11 12 13 14 15 |
# File 'lib/visage/iso_generator.rb', line 8 def initialize( source_file, destination ) @source = source_file.gsub( /\s/, '\ ' ) @name = File.basename( source_file ) @name = @name.sub( /\.cdr|\.dvdmedia/, '' ) @name = @name.gsub( /\s/, '\ ' ) @destination_file_name = File.join( destination, @name ) @command = "hdiutil makehybrid -udf -udf-volume-name #{@name} -o #{@destination_file_name} #{@source}" end |
Instance Method Details
#process(test = false) ⇒ Object
Runs or prints the command that generates an ISO for the source file
test - if true only print the command otherwise run the command
19 20 21 22 23 24 25 |
# File 'lib/visage/iso_generator.rb', line 19 def process( test = false ) if( test ) puts @command else system( @command ) end end |