Skip to content

Commit

Permalink
Merge branch 'release/0.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rspivak committed May 9, 2011
2 parents 55b44ff + 7ca9d58 commit 7ba8001
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGES
@@ -1,6 +1,11 @@
Change History
--------------

0.3.2 (2011-05-09)
******************
- More hacks to use pre-generated lex and yacc tables when called from
the command line

0.3.1 (2011-05-09)
******************
- Use pre-generated lex and yacc tables when called from the command line
Expand Down
35 changes: 19 additions & 16 deletions README.rst
Expand Up @@ -13,22 +13,25 @@ Let's minify some code

From the command line:

$ slimit -h
Usage: slimit [input file]

If no input file is provided STDIN is used by default.
Minified JavaScript code is printed to STDOUT.

$ cat test.js
var a = function( obj ) {
for ( var name in obj ) {
return false;
}
return true;
};
$
$ slimit < test.js
var a=function(obj){for(var name in obj){return false;}return true;};
::

$ slimit -h
Usage: slimit [input file]

If no input file is provided STDIN is used by default.
Minified JavaScript code is printed to STDOUT.

$ cat test.js
var a = function( obj ) {
for ( var name in obj ) {
return false;
}
return true;
};
$
$ slimit < test.js
var a=function(obj){for(var name in obj){return false;}return true;};


Or using library API:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -17,7 +17,7 @@ def read(*rel_names):

setup(
name='slimit',
version='0.3.1',
version='0.3.2',
url='http://slimit.org',
license='MIT',
description='SlimIt - JavaScript minifier',
Expand Down
9 changes: 5 additions & 4 deletions src/slimit/minifier.py
Expand Up @@ -51,11 +51,12 @@ def main():
# Hack to load lextab and yacctab when installed via pip/easy_install
# and used from the command line via call to 'slimit'
try:
lextab = __import__('lextab')
yacctab = __import__('yacctab')
__import__('slimit.lextab')
__import__('slimit.yacctab')
except ImportError:
lextab = 'lextab'
yacctab = 'yacctab'
pass
lextab = sys.modules.get('slimit.lextab', 'lextab')
yacctab = sys.modules.get('slimit.yacctab', 'yacctab')

if len(args) == 1:
text = open(args[1]).read()
Expand Down

0 comments on commit 7ba8001

Please sign in to comment.