Class: Jake::Package
Instance Attribute Summary
Attributes inherited from Buildable
#name
Instance Method Summary
collapse
Methods inherited from Buildable
#build_needed?, #build_path, #directory, #header, #initialize, #meta, #packer_settings, #parent, #write!
Instance Method Details
#code(build_name, with_header = true) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/jake/package.rb', line 16
def code(build_name, = true)
if cached = @code[build_name]
return ? cached : cached.code
end
packer = packer_settings(build_name)
head =
head = head && head.strip unless packer[:minify] == false
packer = packer.merge(:header => head)
code = code_for_packer(packer, build_name)
cached = @code[build_name] = code
? code : code.code
end
|
#files ⇒ Object
4
5
6
7
8
9
10
|
# File 'lib/jake/package.rb', line 4
def files
base = parent ? parent.files : []
base + @config[:files].map do |path|
path = Jake.path( directory, path)
File.file?(path) ? path : "#{ path }.js"
end
end
|
#source ⇒ Object
12
13
14
|
# File 'lib/jake/package.rb', line 12
def source
@source ||= files.map { |path| Jake.read(path) }.join("\n")
end
|