reverted chunky_png version pushed that by mistake and patched a bug that was causing callbacks to register twice

This commit is contained in:
Scott Davis 2011-03-25 00:54:47 -04:00
parent 6ff877cbd3
commit 2bf3d8f453
4 changed files with 39 additions and 10 deletions

View File

@ -1,8 +1,8 @@
PATH
remote: .
specs:
compass (0.11.beta.3.0fdf606)
chunky_png (~> 1.1.0)
compass (0.11.beta.3.6ff877c)
chunky_png (~> 0.12)
sass (>= 3.1.0.alpha.249)
GEM
@ -38,7 +38,7 @@ GEM
addressable (2.2.4)
arel (2.0.9)
builder (2.1.2)
chunky_png (1.1.0)
chunky_png (0.12.0)
compass-validator (3.0.0)
css_parser (1.0.1)
cucumber (0.9.4)

View File

@ -17,7 +17,7 @@ Gem::Specification.new do |gemspec|
gemspec.summary = %q{A Real Stylesheet Framework}
gemspec.add_dependency 'sass', '>= 3.1.0.alpha.249'
gemspec.add_dependency 'chunky_png', '~> 1.1.0'
gemspec.add_dependency 'chunky_png', '~> 0.12'
gemspec.files = %w(README.markdown LICENSE.markdown VERSION.yml Rakefile)
gemspec.files += Dir.glob("bin/*")

View File

@ -65,11 +65,14 @@ module Compass
Sass::Plugin.add_template_location sass_dir, css_dir
end
end
Sass::Plugin.on_updating_stylesheet do |sass_file, css_file|
Compass.configuration.run_callback(:stylesheet_saved, css_file)
end
Sass::Plugin.on_compilation_error do |e, filename, css|
Compass.configuration.run_callback(:stylesheet_error, filename, e.message)
unless defined?(CallbacksSetup)
Sass::Plugin.on_updating_stylesheet do |sass_file, css_file|
Compass.configuration.run_callback(:stylesheet_saved, css_file)
end
Sass::Plugin.on_compilation_error do |e, filename, css|
Compass.configuration.run_callback(:stylesheet_error, filename, e.message)
end
const_set('CallbacksSetup', true)
end
end

View File

@ -1,5 +1,4 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require "compass/sprites"
require 'digest/md5'
describe Compass::Sprites do
@ -440,5 +439,32 @@ describe Compass::Sprites do
}
CSS
end
it "should calculate corret sprite demsions when givin spacing via issue#253" do
css = render <<-SCSS
$squares-spacing: 10px;
@import "squares/*.png";
.foo {
@include sprite-background-position($squares-sprites, "twenty-by-twenty");
}
.bar {
@include sprite-background-position($squares-sprites, "ten-by-ten");
}
SCSS
image_size('squares-*.png').should == [20, 40]
css.should == <<-CSS
.squares-sprite {
background: url('/squares-e3c68372d9.png') no-repeat;
}
.foo {
background-position: 0 -20px;
}
.bar {
background-position: 0 0;
}
CSS
end
end