Skip to content

Instantly share code, notes, and snippets.

@bergantine
Forked from carljm/postactivate
Created September 10, 2012 20:52
Show Gist options
  • Save bergantine/3693765 to your computer and use it in GitHub Desktop.
Save bergantine/3693765 to your computer and use it in GitHub Desktop.
Git hooks to activate a ruby gem environment. #git #hook #ruby #gem #bash
#!/bin/bash
# This hook is run after every virtualenv is activated.
export OLD_GEM_HOME=$GEM_HOME
export GEM_HOME=$VIRTUAL_ENV/gems/
export GEM_PATH=
export PATH=$VIRTUAL_ENV/gems/bin:$PATH
#!/bin/bash
# This hook is run before every virtualenv is deactivated.
export GEM_HOME=$OLD_GEM_HOME
unset GEM_PATH
@bergantine
Copy link
Author

these go in bin/postactivate and bin/predeactivate in the virtual env.
then just run $ gem install compass susy to install

from there enable django-compressor for production, in settings.py set: COMPRESS = True
add to settings.py:

COMPRESS_PRECOMPILERS = (
    ('text/x-sass', 'sass {infile} {outfile}'),
)

@bergantine
Copy link
Author

then, in your template:

    {% load compress %}
    {% compress css %}
        <link type="text/x-sass" href="{{ STATIC_URL }}stylesheets/sass/screen.sass" media="all" rel="stylesheet" charset="utf-8" />
    {% endcompress %}

@bergantine
Copy link
Author

as of now this still doesn't totally work... can't import compass... need to tie config.rb in somehow

@bergantine
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment