Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


expose #options attribute #26

merged 1 commit into from

2 participants


Motivation: when using Jammit with multiple packages, it is useful to vary options given to the jar based on an individual package.

For example, to generate source maps the closure compiler takes an option --create_source_map, with the path for the output source map. If I have 3 packages in my Jammit assets.yml, the last one to be packaged will overwrite the source map file (as the 2nd one will have already done to the 1st).

(actually getting Jammit to do this correctly will require some changes in that project; a pull request there is forthcoming)

This patch allows the options hash to be changed for each run, without creating a new Closure::Compiler object. Creating a new object is feasible too, although a bit less clean imo.

@jashkenas jashkenas merged commit 0484508 into documentcloud:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 23, 2013
  1. @alunny

    expose #options attribute

    alunny authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/closure/compiler.rb
2  lib/closure/compiler.rb
@@ -9,6 +9,8 @@ class Error < StandardError; end
# The Closure::Compiler is a basic wrapper around the actual JAR. There's not
# much to see here.
class Compiler
+ attr_accessor :options
:warning_level => 'QUIET',
Something went wrong with that request. Please try again.