Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updating the README to reflect the new methods

  • Loading branch information...
commit 434e9e13320ac1ebadd285d19adfd09335f28a1f 1 parent 595f465
Jayme Deffenbaugh jdeff authored

Showing 1 changed file with 12 additions and 2 deletions. Show diff stats Hide diff stats

  1. +12 2 README.textile
14 README.textile
Source Rendered
@@ -4,7 +4,7 @@ The *closure-compiler* gem is a svelte wrapper around the "Google Closure Compil
4 4
5 5 Latest Version: *"1.1.7":http://rubygems.org/gems/closure-compiler*
6 6
7   -The Closure Compiler's *2012-07-25* JAR-file is included with the gem.
  7 +The Closure Compiler's *2012-09-17* JAR-file is included with the gem.
8 8
9 9 h2. Installation
10 10
@@ -14,7 +14,7 @@ sudo gem install closure-compiler
14 14
15 15 h2. Usage
16 16
17   -The @Closure::Compiler@ has a single method, @compile@, which can be passed a string or an open @IO@ object, and returns the compiled JavaScript. The result is returned as a string, or, if a block is passed, yields as an @IO@ object for streaming writes.
  17 +The @Closure::Compiler@ has a @compile@ method, which can be passed a string or an open @IO@ object, and returns the compiled JavaScript. The result is returned as a string, or, if a block is passed, yields as an @IO@ object for streaming writes.
18 18
19 19 <pre>
20 20 require 'rubygems'
@@ -23,6 +23,16 @@ Closure::Compiler.new.compile(File.open('underscore.js', 'r'))
23 23
24 24 => "(function(){var j=this,m=j._;function i(a){......
25 25 </pre>
  26 +
  27 +The @Closure::Compiler@ also has @compile_file@ and @compile_files@ methods, which can be passed a file path or an array of file paths respectively. The files are concatenated and compiled and, like the @compile@ method, the result is returned as a string or, if block is passed, yields an @IO@ object.
  28 +
  29 +<pre>
  30 +require 'rubygems'
  31 +require 'closure-compiler'
  32 +Closure::Compiler.new.compile_files(['underscore.js', 'jasmine.js']))
  33 +
  34 +=> "(function(){var j=this,m=j._;function i(a){......
  35 +</pre>
26 36
27 37 When creating a @Closure::Compiler@, you can pass "any options that the command-line compiler accepts":http://code.google.com/closure/compiler/docs/gettingstarted_app.html to the initializer and they'll be forwarded. For example, to raise the compilation level up a notch:
28 38

0 comments on commit 434e9e1

Please sign in to comment.
Something went wrong with that request. Please try again.