Class: Jake::Bundle
Instance Attribute Summary
Attributes inherited from Buildable
Instance Method Summary collapse
-
#code(name) ⇒ Object
Returns the result of building the source template and minifying the output using the given named set of PackR settings.
-
#files ⇒ Object
Returns a list of paths to all the files used to build this package.
-
#source ⇒ Object
Returns the full uncompressed source code of this package, before ERB processing.
Methods inherited from Buildable
#build_needed?, #build_path, #directory, #header, #initialize, #meta, #packer_settings, #parent, #write!
Constructor Details
This class inherits a constructor from Jake::Buildable
Instance Method Details
#code(name) ⇒ Object
Returns the result of building the source template and minifying the output using the given named set of PackR settings.
20 21 22 23 |
# File 'lib/jake/bundle.rb', line 20 def code(name) joiner = (packer_settings(name) == false) ? "\n\n\n" : "\n" @code[name] ||= @config[:files].map { |pkg| @build.package(pkg).code(name) }.join(joiner) end |
#files ⇒ Object
Returns a list of paths to all the files used to build this package.
5 6 7 8 |
# File 'lib/jake/bundle.rb', line 5 def files base = parent ? parent.files : [] base + @config[:files].map { |pkg| @build.package(pkg).files }.flatten end |
#source ⇒ Object
Returns the full uncompressed source code of this package, before ERB processing. ERB output will be build-dependent; this method simply builds the raw template for further processing by other methods.
14 15 16 |
# File 'lib/jake/bundle.rb', line 14 def source @source ||= @config[:files].map { |pkg| @build.package(pkg).source }.join("\n\n\n") end |