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 CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 3
2
+ :patch: 4
3
3
  :major: 0
4
4
  :minor: 2
data/Visage.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{visage}
5
- s.version = "0.2.3"
5
+ s.version = "0.2.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ed Schmalzle", "Aaron Kuehler"]
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
@@ -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
- `hdiutil makehybrid -udf -udf-volume-name #{@name} -o #{@destination_file_name} #{@source}`
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nerdEd-visage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Schmalzle