如何在Windows上配置Compass以生成带有Unix行尾的文件? [英] How to configure Compass to generate files with Unix line endings on Windows?

查看:79
本文介绍了如何在Windows上配置Compass以生成带有Unix行尾的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Windows 7和Ruby 1.9.2上安装了Compass 0.11.5.

I just installed Compass 0.11.5 on Windows 7 with Ruby 1.9.2.

我已将开发环境设置为对所有文件使用Unix行结尾.

I have my development environment set up to use Unix line endings for all files.

我创建了一个初始的sass-test项目,并注意到它创建的所有文件都具有Windows行尾.我将现有的.css文件从另一个项目(带有UNIX行尾)移到sass文件夹中,并将扩展名更改为.scss.我运行了"compass compile"命令,以为此新文件生成.css文件,并且它创建的.css文件具有Windows行尾.

I created an initial sass-test project and noticed that all the files it created had Windows line endings. I moved an existing .css file from another project (with unix line endings) into the sass folder and changed the extension to .scss. I ran the 'compass compile' command to generate the .css file for this new file and the .css file it created had Windows line endings.

我无法在Compass文档中找到任何配置选项来强制Compass生成带有Unix行尾的文件.

I can't find any configuration options in the Compass documentation to force Compass to generate files with Unix line endings.

是否可以在Windows上配置Compass以生成带有Unix行尾的文件?

Is it possible to configure Compass to generate files with Unix line endings on Windows?

经过进一步调查,可以选择将配置选项从Compass传递到Sass.

After further investigation, there is an option to to pass configuration options to Sass from Compass.

Property Name   Type    Description
sass_options    Hash    These options are passed directly to the Sass compiler. For more details on the format of sass options, please read the sass options documentation.

Sass有一个用于生成unix行尾的选项:

Sass has an option for generating unix line endings:

:unix_newlines
如果为true,则在写入文件时使用Unix风格的换行符.仅在Windows上具有意义,并且仅在Sass写入文件时(在Rack,Rails或Merb中,直接使用Sass :: Plugin或使用命令行可执行文件时).

:unix_newlines
If true, use Unix-style newlines when writing files. Only has meaning on Windows, and only when Sass is writing the files (in Rack, Rails, or Merb, when using Sass::Plugin directly, or when using the command-line executable).

似乎在sass-test项目的config.rb文件中添加以下行应该可以解决此问题:

It appears that adding the following line to the sass-test project's config.rb file should solve the issue:

sass_options = {:unix_newlines => true}

但是,它对创建的结果.css文件没有任何影响-它们仍然具有Windows行尾.

But, it doesn't have any effect on the resulting .css files created - they still have Windows line endings.

推荐答案

根据 https://github.com/chriseppstein/compass/issues/949 应该在sass 3.1.20中修复 但是在我的盒子上没有喜悦...仍然是Windows行结尾

According to https://github.com/chriseppstein/compass/issues/949 it should be fixed in sass 3.1.20 but on my box no joy... still Windows line endings

这篇关于如何在Windows上配置Compass以生成带有Unix行尾的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆