Skip to content

Commit 434e9e1

Browse files
committed
Updating the README to reflect the new methods
1 parent 595f465 commit 434e9e1

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

README.textile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The *closure-compiler* gem is a svelte wrapper around the "Google Closure Compil
44

55
Latest Version: *"1.1.7":http://rubygems.org/gems/closure-compiler*
66

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.
88

99
h2. Installation
1010

@@ -14,13 +14,23 @@ sudo gem install closure-compiler
1414

1515
h2. Usage
1616

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.
1818

1919
<pre>
2020
require 'rubygems'
2121
require 'closure-compiler'
2222
Closure::Compiler.new.compile(File.open('underscore.js', 'r'))
2323

24+
=> "(function(){var j=this,m=j._;function i(a){......
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+
2434
=> "(function(){var j=this,m=j._;function i(a){......
2535
</pre>
2636

0 commit comments

Comments
 (0)