Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Output Style #3

Open
sambenne opened this issue Sep 25, 2012 · 1 comment
Open

Add Output Style #3

sambenne opened this issue Sep 25, 2012 · 1 comment

Comments

@sambenne
Copy link

I have been playing around with this and have got it working the way I want. But I have been trying to add :style so I can set it to :compressed or :compact without having to change the jar each time. I have got it working but only if I manually change it.

Have you managed or know how to send the :compressed though as is and not as a String because that won' actually work.

@sambenne
Copy link
Author

I have managed to get this to work. What I had to do was move the driverScript into the compileSass just before the eval. Then I had to split the string up into smaller parts so I could add the variables in.

String driverScript = '''
    require 'rubygems'
    require 'sass'
    $mappings.each do |src, dst|
        engine = Sass::Engine.for_file(src, '''
driverScript += "{:cache_location => '$cacheLocation', :style => $outputStyle}"
driverScript += ''')
        css = engine.render
        File.open(dst, 'w') {|f| f.write(css) }
        puts "#{src} -> #{dst}"
    end
'''

I assume there is a better way of doing this but my Java/Groovy skills are low.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant