Class: PackageAsExe::NSISTask

Inherits:
Rake::FileTask
  • Object
show all
Defined in:
lib/package_as_exe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ NSISTask

:nodoc:



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/package_as_exe.rb', line 22

def initialize(*args) #:nodoc:
  super(*args)
  
  enhance do
    info "About to call makensis"
    # We make available one variable to the nsi script:
    # Use it like this: OutFile "${OUTPUT}"
    values.merge!({"OUTPUT" => to_s})
    command = "makensis #{values.inject([]) {|array, (key, value)| array << "-D#{key}=#{value}"; array }.join(" ")} #{nsi}"
    trace command
    system(command) or fail "Error while calling makeNSIS"  
  end
end

Instance Attribute Details

#nsiObject

Returns the value of attribute nsi.



21
22
23
# File 'lib/package_as_exe.rb', line 21

def nsi
  @nsi
end

#valuesObject

Returns the value of attribute values.



21
22
23
# File 'lib/package_as_exe.rb', line 21

def values
  @values
end

Instance Method Details

#with(options) ⇒ Object

:call-seq:

with(options) => self

Passes options to the task and returns self. Some tasks support additional options, for example, the WarTask supports options like :manifest, :libs and :classes.

For example:

package(:jar).with(:manifest=>'MANIFEST_MF')


44
45
46
47
48
49
50
51
52
53
# File 'lib/package_as_exe.rb', line 44

def with(options)
  options.each do |key, value|
    begin
      send "#{key}=", value
    rescue NoMethodError
      raise ArgumentError, "#{self.class.name} does not support the option #{key}"
    end
  end
  self
end