Skip to content

Commit

Permalink
Merge pull request #15 from jehiah/minify_15
Browse files Browse the repository at this point in the history
use minify instead of yui_compressor
jehiah authored Jan 25, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 055f2f3 + 91ea7e6 commit dfbe74d
Showing 7 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions assetman/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from assetman.manifest import Manifest

# also update in setup.py
__version__ = "0.1.21"
version_info = (0, 1, 21)
__version__ = "0.2.0"
version_info = (0, 2, 0)
8 changes: 5 additions & 3 deletions assetman/compilers.py
Original file line number Diff line number Diff line change
@@ -150,10 +150,12 @@ class CSSCompiler(AssetCompiler, assetman.managers.CSSManager):
include_expr = 'include_css'

def do_compile(self, **kwargs):
"""Compiles CSS files using the YUI compressor. Since the compressor
"""Compiles CSS files using the minify compressor. Since the compressor
will only accept a single input file argument, we have to manually
concat the CSS files in the batch and pipe them into the compressor.
https://github.com/tdewolff/minify/tree/master/cmd/minify
This also allows us to accept a css_input argument, so this function
can be used by the compile_less function as well.
"""
@@ -164,8 +166,8 @@ def do_compile(self, **kwargs):
if not kwargs.get("skip_inline_images"):
css_input = self.inline_images(css_input)
cmd = [
self.required_setting_file("java_bin"), '-Xss64m', '-jar', self.required_setting_file("yui_compressor_path"),
'--type', 'css', '--line-break', '160',
self.required_setting_file("minify_compressor_path"),
'--type=css'
]
return run_proc(cmd, stdin=css_input)

2 changes: 1 addition & 1 deletion assetman/settings.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
}
default_settings = {
"closure_compiler":"/bin/closure-compiler.jar",
"yui_compressor_path": "/bin/yuicompressor.jar",
"minify_compressor_path": "/bin/minify",
"sass_compiler": "/bin/sass",
"lessc_path": "/bin/lessc",
"java_bin": "java"
2 changes: 1 addition & 1 deletion assetman/tests/test_compiler.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ def get_settings(**opts):
force_recompile=False,
skip_inline_images=True,
closure_compiler=opts.get('closure_compiler', '/bitly/local/bin/closure-compiler.jar'),
yui_compressor_path=opts.get('yui_compressor_path', '/bitly/local/bin/yuicompressor.jar'),
minify_compressor_path=opts.get('minify_compressor_path', '/bitly/local/bin/minify'),
sass_compiler=opts.get('sass_compiler', '/bitly/local/bin/sass'),
lessc_path=opts.get('lessc_path', '/bitly/local/bin/lessc'),
aws_username=None,
2 changes: 1 addition & 1 deletion assetman/tests/test_settings
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"testkey2": "testvalue2", "testkey1": "testvalue1", "yui_compressor_path": "/bin/yuicompressor.jar", "lessc_path": "/bin/lessc", "sass_compiler": "/bin/sass", "closure_compiler": "/bin/closure-compiler.jar"}
{"testkey2": "testvalue2", "testkey1": "testvalue1", "minify_compressor_path": "/bin/minify", "lessc_path": "/bin/lessc", "sass_compiler": "/bin/sass", "closure_compiler": "/bin/closure-compiler.jar"}
2 changes: 1 addition & 1 deletion assetman/tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ def test_settings_can_load_from_file(self):
'testkey2': "testvalue2",
"lessc_path" : "asdf",
"sass_compiler": "asdf",
"yui_compressor_path": "asdf",
"minify_compressor_path": "asdf",
"closure_compiler": "asdf"
}

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
from distutils.core import setup

setup(name='assetman',
version='0.1.21', # also update in __init__.py
version='0.2.0', # also update in __init__.py
description='AssetMan asset manager',
url="http://github.com/bitly/assetman",
license="Apache Software License",

0 comments on commit dfbe74d

Please sign in to comment.