Binary mode support for proper handling of binary files on Windows.
All images will now be installed using binary mode. Additionally, any file can be installed in binary mode if the manifest specifies the option :binary => true for that file.
This commit is contained in:
parent
e6ea58fc3a
commit
0492fc9969
@ -1,14 +1,23 @@
|
|||||||
COMPASS CHANGELOG
|
COMPASS CHANGELOG
|
||||||
=================
|
=================
|
||||||
|
0.8.10 (August 16, 2009)
|
||||||
|
------------------------
|
||||||
|
Bug Fix Release:
|
||||||
|
|
||||||
|
* Write files in binary mode to avoid data corruption when installing images on windows.
|
||||||
|
Fixes [Issue #39](http://github.com/chriseppstein/compass/issues/#issue/39)
|
||||||
|
|
||||||
0.8.9 (August 9, 2009)
|
0.8.9 (August 9, 2009)
|
||||||
----------------------
|
----------------------
|
||||||
Bug Fix Release:
|
Bug Fix Release:
|
||||||
|
|
||||||
* [Blueprint] The default screen.sass generated invalid selectors due to improper nesting. A better fix is coming in the next release.
|
* [Blueprint] The default screen.sass generated invalid selectors due to improper nesting. A better fix is coming in the next release.
|
||||||
|
|
||||||
0.8.8 (July 21, 2009)
|
0.8.8 (July 21, 2009)
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
Bug Fix Release:
|
Bug Fix Release:
|
||||||
|
|
||||||
* [Compass Core] Fixed a bug in alternating_rows_and_columns. Improper nesting caused some styles to be improperly rendered.
|
* [Compass Core] Fixed a bug in alternating_rows_and_columns. Improper nesting caused some styles to be improperly rendered.
|
||||||
[Commit](http://github.com/chriseppstein/compass/commit/e277ed2cd3fded0b98ddaa87fc4d3b9d37cb7354)
|
[Commit](http://github.com/chriseppstein/compass/commit/e277ed2cd3fded0b98ddaa87fc4d3b9d37cb7354)
|
||||||
* [YUI] Fixed a bug in yui grids where the .first div wouldn't get the right styles in some rare cases due to incorrect nesting.
|
* [YUI] Fixed a bug in yui grids where the .first div wouldn't get the right styles in some rare cases due to incorrect nesting.
|
||||||
@ -19,6 +28,7 @@ Bug Fix Release:
|
|||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
Bug Fix Release:
|
Bug Fix Release:
|
||||||
|
|
||||||
* Load haml-edge only if it's all new and shiny. Closes GH-26.
|
* Load haml-edge only if it's all new and shiny. Closes GH-26.
|
||||||
[Commit](http://github.com/chriseppstein/compass/commit/59a6067b3a67a79bfd9a5ce325fc1be4bb6c9e78)
|
[Commit](http://github.com/chriseppstein/compass/commit/59a6067b3a67a79bfd9a5ce325fc1be4bb6c9e78)
|
||||||
* [Blueprint] Added more descriptive comments to the Blueprint IE template.
|
* [Blueprint] Added more descriptive comments to the Blueprint IE template.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
:patch: 9
|
:patch: 10
|
||||||
:major: 0
|
:major: 0
|
||||||
:minor: 8
|
:minor: 8
|
||||||
|
@ -8,10 +8,10 @@ module Compass
|
|||||||
end
|
end
|
||||||
|
|
||||||
# copy/process a template in the compass template directory to the project directory.
|
# copy/process a template in the compass template directory to the project directory.
|
||||||
def copy(from, to, options = nil)
|
def copy(from, to, options = nil, binary = false)
|
||||||
options ||= self.options if self.respond_to?(:options)
|
options ||= self.options if self.respond_to?(:options)
|
||||||
contents = File.new(from).read
|
contents = File.new(from).read
|
||||||
write_file to, contents, options
|
write_file to, contents, options, binary
|
||||||
end
|
end
|
||||||
|
|
||||||
# create a directory and all the directories necessary to reach it.
|
# create a directory and all the directories necessary to reach it.
|
||||||
@ -29,7 +29,7 @@ module Compass
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Write a file given the file contents as a string
|
# Write a file given the file contents as a string
|
||||||
def write_file(file_name, contents, options = nil)
|
def write_file(file_name, contents, options = nil, binary = false)
|
||||||
options ||= self.options if self.respond_to?(:options)
|
options ||= self.options if self.respond_to?(:options)
|
||||||
skip_write = options[:dry_run]
|
skip_write = options[:dry_run]
|
||||||
if File.exists?(file_name)
|
if File.exists?(file_name)
|
||||||
@ -49,7 +49,9 @@ module Compass
|
|||||||
if skip_write
|
if skip_write
|
||||||
FileUtils.touch file_name
|
FileUtils.touch file_name
|
||||||
else
|
else
|
||||||
open(file_name,'w') do |file|
|
mode = "w"
|
||||||
|
mode << "b" if binary
|
||||||
|
open(file_name, mode) do |file|
|
||||||
file.write(contents)
|
file.write(contents)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -87,7 +87,7 @@ module Compass
|
|||||||
"#{options[:pattern_name]}/" if options[:pattern_name]
|
"#{options[:pattern_name]}/" if options[:pattern_name]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.installer(type, &locator)
|
def self.installer(type, installer_opts = {}, &locator)
|
||||||
locator ||= lambda{|to| to}
|
locator ||= lambda{|to| to}
|
||||||
loc_method = "install_location_for_#{type}".to_sym
|
loc_method = "install_location_for_#{type}".to_sym
|
||||||
define_method("simple_#{loc_method}", locator)
|
define_method("simple_#{loc_method}", locator)
|
||||||
@ -99,7 +99,9 @@ module Compass
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
define_method "install_#{type}" do |from, to, options|
|
define_method "install_#{type}" do |from, to, options|
|
||||||
copy templatize(from), targetize(send(loc_method, to, options))
|
from = templatize(from)
|
||||||
|
to = targetize(send(loc_method, to, options))
|
||||||
|
copy from, to, nil, (installer_opts[:binary] || options[:binary])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -111,7 +113,7 @@ module Compass
|
|||||||
"#{css_dir}/#{to}"
|
"#{css_dir}/#{to}"
|
||||||
end
|
end
|
||||||
|
|
||||||
installer :image do |to|
|
installer :image, :binary => true do |to|
|
||||||
"#{images_dir}/#{to}"
|
"#{images_dir}/#{to}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user