Class: Wtapack::Packer

Inherits:
Object
  • Object
show all
Defined in:
lib/wtapack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bundleIDObject

Returns the value of attribute bundleID.



5
6
7
# File 'lib/wtapack.rb', line 5

def bundleID
  @bundleID
end

#displayNameObject

Returns the value of attribute displayName.



5
6
7
# File 'lib/wtapack.rb', line 5

def displayName
  @displayName
end

#extension_profilesObject

Returns the value of attribute extension_profiles.



5
6
7
# File 'lib/wtapack.rb', line 5

def extension_profiles
  @extension_profiles
end

#extensionsObject

Returns the value of attribute extensions.



5
6
7
# File 'lib/wtapack.rb', line 5

def extensions
  @extensions
end

#inputObject

Returns the value of attribute input.



5
6
7
# File 'lib/wtapack.rb', line 5

def input
  @input
end

#outputObject

Returns the value of attribute output.



5
6
7
# File 'lib/wtapack.rb', line 5

def output
  @output
end

#profileObject

Returns the value of attribute profile.



5
6
7
# File 'lib/wtapack.rb', line 5

def profile
  @profile
end

#signObject

Returns the value of attribute sign.



5
6
7
# File 'lib/wtapack.rb', line 5

def sign
  @sign
end

Instance Method Details

#packObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/wtapack.rb', line 7

def pack
  argv = ["wtapack", "-profile", "#{self.profile}", "-sign", "#{self.sign}", "-input", "\"#{self.input}\"", "-output", "\"#{self.output}\"", "-bundleID", "#{self.bundleID}"]
  unless self.extensions.nil?
    extensions = ["-extensions"]
    extension_list = ""
    self.extensions.each do |ex|
      extension_list = extension_list + "\"#{ex}\"" + ","
    end
    argv = argv + extensions + [extension_list]
  end
  unless self.extension_profiles.nil?
    self.extension_profiles.each do |extension, profile|

        argv = argv + ["\"-#{extension}\"", "#{profile}"]

    end
  end
  
  unless self.displayName.nil?
    argv = argv + ["-displayName", "\"#{self.displayName}\""]
  end
  # if self.extensions.nil?
  #   self.extensions = []
  # end
        
  argc = argv.count
  Wtapack::native_pack(argc, argv)
end