Class: Jar

Inherits:
JavaTask show all
Defined in:
lib/jake/jar.rb

Instance Attribute Summary collapse

Attributes inherited from JavaTask

#base_dir

Instance Method Summary collapse

Methods inherited from JavaTask

#execute, in

Constructor Details

#initialize(path) ⇒ Jar

Returns a new instance of Jar.



4
5
6
7
8
# File 'lib/jake/jar.rb', line 4

def initialize(path)
  @bin = []
  @with_manifest = false
  super(path)
end

Instance Attribute Details

#binObject

Returns the value of attribute bin.



2
3
4
# File 'lib/jake/jar.rb', line 2

def bin
  @bin
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/jake/jar.rb', line 2

def name
  @name
end

#with_manifestObject

Returns the value of attribute with_manifest.



2
3
4
# File 'lib/jake/jar.rb', line 2

def with_manifest
  @with_manifest
end

Instance Method Details

#commandObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/jake/jar.rb', line 10

def command
  inputs = []
  @bin.each do |c|
    inputs << "-C #{c} ."
  end

  if @with_manifest then
    "jar cvmf META-INF/MANIFEST.MF #{@name} #{inputs.join(' ')}"
  else
    "jar cvf #{@name} #{inputs.join(' ')}"
  end
end