mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Add -E option to executables.
This commit is contained in:
parent
8b15e2dd14
commit
27442ab8c0
3 changed files with 26 additions and 0 deletions
|
@ -17,6 +17,9 @@ Rather than defaulting to `"utf-8"`,
|
|||
it defaults to the encoding of the source document,
|
||||
and only falls back to `"utf-8"` if this encoding is `"us-ascii"`.
|
||||
|
||||
The `haml` executable also now takes an `-E` option for specifying encoding,
|
||||
which works the same way as Ruby's `-E` option.
|
||||
|
||||
### Other Changes
|
||||
|
||||
* Default to the {file:HAML_REFERENCE.md#format-option `:html5` format}
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
Sass 3.0.7 adds support for `@charset` for declaring the encoding of a stylesheet.
|
||||
For details see {file:SASS_REFERENCE.md#encodings the reference}.
|
||||
|
||||
The `sass` and `sass-convert` executables also now take an `-E` option
|
||||
for specifying the encoding of Sass/SCSS/CSS files.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* When compiling a file named `.sass` but with SCSS syntax specified,
|
||||
|
|
|
@ -323,6 +323,12 @@ END
|
|||
opts.on('-C', '--no-cache', "Don't cache to sassc files.") do
|
||||
@options[:for_engine][:cache] = false
|
||||
end
|
||||
|
||||
unless ::Haml::Util.ruby1_8?
|
||||
opts.on('-E encoding', 'Specify the default encoding for Sass files.') do |encoding|
|
||||
Encoding.default_external = encoding
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Processes the options set by the command-line arguments,
|
||||
|
@ -474,6 +480,14 @@ MSG
|
|||
@options[:load_paths] << path
|
||||
end
|
||||
|
||||
unless ::Haml::Util.ruby1_8?
|
||||
opts.on('-E ex[:in]', 'Specify the default external and internal character encodings.') do |encoding|
|
||||
external, internal = encoding.split(':')
|
||||
Encoding.default_external = external if external && !external.empty?
|
||||
Encoding.default_internal = internal if internal && !internal.empty?
|
||||
end
|
||||
end
|
||||
|
||||
opts.on('--debug', "Print out the precompiled Ruby source.") do
|
||||
@options[:debug] = true
|
||||
end
|
||||
|
@ -656,6 +670,12 @@ END
|
|||
@options[:for_engine][:read_cache] = false
|
||||
end
|
||||
|
||||
unless ::Haml::Util.ruby1_8?
|
||||
opts.on('-E encoding', 'Specify the default encoding for Sass and CSS files.') do |encoding|
|
||||
Encoding.default_external = encoding
|
||||
end
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue