nerdEd-visage 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/Visage.gemspec +1 -1
- data/bin/visage +7 -1
- data/lib/visage/converter.rb +4 -3
- data/lib/visage/iso.rb +7 -2
- metadata +1 -1
data/VERSION.yml
CHANGED
data/Visage.gemspec
CHANGED
data/bin/visage
CHANGED
@@ -27,6 +27,12 @@ module VisageOptions extend OptiFlagSet
|
|
27
27
|
description "Returns version information."
|
28
28
|
end
|
29
29
|
|
30
|
+
optional_switch_flag "test" do
|
31
|
+
alternate_forms "t", "T"
|
32
|
+
default false
|
33
|
+
description "Puts visage into test mode and will only print commands, not run them."
|
34
|
+
end
|
35
|
+
|
30
36
|
and_process!
|
31
37
|
end
|
32
38
|
|
@@ -36,6 +42,6 @@ end
|
|
36
42
|
if( ARGV.flags.version? )
|
37
43
|
puts Visage.version
|
38
44
|
else
|
39
|
-
converter = Visage::Converter.new( ARGV.flags.source, ARGV.flags.destination )
|
45
|
+
converter = Visage::Converter.new( ARGV.flags.source, ARGV.flags.destination, ARGV.flags.test? )
|
40
46
|
converter.process
|
41
47
|
end
|
data/lib/visage/converter.rb
CHANGED
@@ -6,20 +6,21 @@ module Visage
|
|
6
6
|
|
7
7
|
class Converter
|
8
8
|
|
9
|
-
def initialize( source, destination )
|
9
|
+
def initialize( source, destination, test )
|
10
10
|
@source = source
|
11
11
|
@destination = destination
|
12
|
+
@test = test
|
12
13
|
end
|
13
14
|
|
14
15
|
def process
|
15
16
|
if( Visage.valid_source_file?( @source ) )
|
16
17
|
iso = Visage::ISO.new( @source, @destination )
|
17
|
-
iso.process
|
18
|
+
iso.process( @test )
|
18
19
|
else
|
19
20
|
Dir.open( @source ).entries.each do | file |
|
20
21
|
if( Visage.valid_source_file?( file ) )
|
21
22
|
iso = Visage::ISO.new( File.join( @source, file ), @destination )
|
22
|
-
iso.process
|
23
|
+
iso.process( @test )
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
data/lib/visage/iso.rb
CHANGED
@@ -15,8 +15,13 @@ module Visage
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# Generate the iso file
|
18
|
-
def process
|
19
|
-
|
18
|
+
def process( test = false )
|
19
|
+
command = "hdiutil makehybrid -udf -udf-volume-name #{@name} -o #{@destination_file_name} #{@source}"
|
20
|
+
if( test )
|
21
|
+
puts command
|
22
|
+
else
|
23
|
+
system( command )
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
27
|
end
|