compass 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/features/command_line.feature +22 -1
- data/features/step_definitions/command_line_steps.rb +21 -1
- data/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +1 -0
- data/frameworks/compass/stylesheets/compass/css3/_box.scss +9 -9
- data/frameworks/compass/stylesheets/compass/css3/_font-face.scss +4 -14
- data/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +14 -1
- data/lib/compass.rbc +87 -11
- data/lib/compass/actions.rb +21 -9
- data/lib/compass/actions.rbc +453 -210
- data/lib/compass/commands.rb +1 -1
- data/lib/compass/commands/clean_project.rb +79 -0
- data/lib/compass/commands/registry.rb +3 -1
- data/lib/compass/commands/sprite.rb +1 -1
- data/lib/compass/commands/update_project.rb +5 -6
- data/lib/compass/commands/watch_project.rb +1 -1
- data/lib/compass/compiler.rb +12 -9
- data/lib/compass/compiler.rbc +386 -294
- data/lib/compass/configuration/adapters.rb +2 -2
- data/lib/compass/configuration/adapters.rbc +4 -4
- data/lib/compass/configuration/data.rb +4 -2
- data/lib/compass/exec/sub_command_ui.rb +1 -1
- data/lib/compass/sass_extensions.rbc +117 -19
- data/lib/compass/sass_extensions/functions/gradient_support.rbc +489 -453
- data/lib/compass/sass_extensions/functions/sprites.rb +4 -4
- data/lib/compass/sass_extensions/functions/sprites.rbc +588 -309
- data/lib/compass/sass_extensions/functions/urls.rb +18 -3
- data/lib/compass/sass_extensions/sprites.rb +9 -7
- data/lib/compass/sass_extensions/sprites.rbc +48 -64
- data/lib/compass/sass_extensions/sprites/engines.rb +24 -0
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +13 -7
- data/lib/compass/sass_extensions/sprites/image_methods.rb +32 -0
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +54 -142
- data/lib/compass/sass_extensions/sprites/sprite_map.rbc +3839 -1536
- data/lib/compass/sass_extensions/sprites/{base.rb → sprite_methods.rb} +21 -101
- data/lib/compass/sprite_importer.rb +202 -0
- data/lib/compass/sprite_importer.rbc +3943 -0
- data/lib/compass/validator.rb +11 -4
- data/lib/compass/version.rbc +67 -109
- data/test/fixtures/sprites/public/images/bad_extensions/ten-by-ten.gif +0 -0
- data/test/fixtures/sprites/public/images/bad_extensions/twenty-by-twenty.jpg +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/config.rb +29 -0
- data/test/fixtures/stylesheets/busted_image_urls/css/screen.css +9 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/feed.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/flags/dk.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/sass/screen.sass +14 -0
- data/test/fixtures/stylesheets/busted_image_urls/tmp/screen.css +9 -0
- data/test/fixtures/stylesheets/compass/css/box.css +19 -0
- data/test/fixtures/stylesheets/compass/css/legacy_clearfix.css +9 -0
- data/test/fixtures/stylesheets/compass/css/sprites.css +1 -1
- data/test/fixtures/stylesheets/compass/css/utilities.css +7 -0
- data/test/fixtures/stylesheets/compass/images/{flag-03c3b29b35.png → flag-s03c3b29b35.png} +0 -0
- data/test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss +3 -0
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +4 -1
- data/test/fixtures/stylesheets/error/config.rb +10 -0
- data/test/fixtures/stylesheets/error/sass/screen.sass +2 -0
- data/test/integrations/compass_test.rb +22 -9
- data/test/integrations/sprites_test.rb +45 -45
- data/test/units/actions_test.rb +24 -0
- data/test/units/sprites/engine_test.rb +43 -0
- data/test/units/sprites/image_test.rb +2 -2
- data/test/units/sprites/importer_test.rb +66 -0
- data/test/units/sprites/sprite_command_test.rb +60 -0
- data/test/units/sprites/{base_test.rb → sprite_map_test.rb} +5 -5
- metadata +43 -34
- data/lib/compass/sass_extensions/sprites/sprites.rb +0 -62
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class EngineTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
sprite_filename = 'squares/ten-by-ten.png'
|
7
|
+
@images = [
|
8
|
+
Compass::SassExtensions::Sprites::Image.new(nil, File.join(sprite_filename), {})
|
9
|
+
]
|
10
|
+
@engine = Compass::SassExtensions::Sprites::Engine.new(100, 100, @images)
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
test "should have width of 100" do
|
15
|
+
assert_equal 100, @engine.width
|
16
|
+
end
|
17
|
+
|
18
|
+
test "should have height of 100" do
|
19
|
+
assert_equal 100, @engine.height
|
20
|
+
end
|
21
|
+
|
22
|
+
test "should have correct images" do
|
23
|
+
assert_equal @images, @engine.images
|
24
|
+
end
|
25
|
+
|
26
|
+
test "raises Compass::Error when calling save" do
|
27
|
+
begin
|
28
|
+
@engine.save('foo')
|
29
|
+
assert false, '#save did not raise an exception'
|
30
|
+
rescue Compass::Error
|
31
|
+
assert true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
test "raises Compass::Error when calling construct_sprite" do
|
36
|
+
begin
|
37
|
+
@engine.construct_sprite
|
38
|
+
assert false, '#construct_sprite did not raise an exception'
|
39
|
+
rescue Compass::Error
|
40
|
+
assert true
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -19,8 +19,8 @@ class SpritesImageTest < Test::Unit::TestCase
|
|
19
19
|
let(:sprite_name) { File.basename(sprite_filename, '.png') }
|
20
20
|
|
21
21
|
def parent
|
22
|
-
|
23
|
-
@parent ||= Compass::SassExtensions::Sprites::
|
22
|
+
importer = Compass::SpriteImporter.new(:uri => "selectors/*.png", :options => options)
|
23
|
+
@parent ||= Compass::SassExtensions::Sprites::SpriteMap.new(importer.sprite_names.map{|n| "selectors/#{n}.png"}, importer.path, importer.name, importer.sass_engine, importer.options)
|
24
24
|
end
|
25
25
|
|
26
26
|
let(:options) do
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'timecop'
|
3
|
+
class ImporterTest < Test::Unit::TestCase
|
4
|
+
URI = "selectors/*.png"
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@images_src_path = File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'sprites', 'public', 'images')
|
8
|
+
file = StringIO.new("images_path = #{@images_src_path.inspect}\n")
|
9
|
+
Compass.add_configuration(file, "sprite_config")
|
10
|
+
@importer = Compass::SpriteImporter.new(:uri => URI, :options => options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def teardown
|
14
|
+
Compass.reset_configuration!
|
15
|
+
end
|
16
|
+
|
17
|
+
def options
|
18
|
+
{:foo => 'bar'}
|
19
|
+
end
|
20
|
+
|
21
|
+
test "load should return an instance of SpriteImporter" do
|
22
|
+
assert Compass::SpriteImporter.load(URI, options).is_a?(Compass::SpriteImporter)
|
23
|
+
end
|
24
|
+
|
25
|
+
test "name should return the sprite name" do
|
26
|
+
assert_equal 'selectors', @importer.name
|
27
|
+
end
|
28
|
+
|
29
|
+
test "path should return the sprite path" do
|
30
|
+
assert_equal 'selectors', @importer.path
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should return all the sprite names" do
|
34
|
+
assert_equal ["ten-by-ten", "ten-by-ten_active", "ten-by-ten_hover", "ten-by-ten_target"], @importer.sprite_names
|
35
|
+
end
|
36
|
+
|
37
|
+
test "should have correct mtime" do
|
38
|
+
thirtydays = Time.now.to_i + (60*60*24*30)
|
39
|
+
file = Dir[File.join(@images_src_path, URI)].sort.first
|
40
|
+
File.utime(thirtydays, thirtydays, file)
|
41
|
+
assert_equal thirtydays, File.mtime(file).to_i
|
42
|
+
assert_equal thirtydays, @importer.mtime(URI, {}).to_i
|
43
|
+
end
|
44
|
+
|
45
|
+
test "should return sass engine on find" do
|
46
|
+
assert @importer.find(URI, {}).is_a?(Sass::Engine)
|
47
|
+
end
|
48
|
+
|
49
|
+
test "sass options should contain options" do
|
50
|
+
assert_equal 'bar', @importer.sass_options[:foo]
|
51
|
+
end
|
52
|
+
|
53
|
+
test "should fail given bad sprite extensions" do
|
54
|
+
@images_src_path = File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'sprites', 'public', 'images')
|
55
|
+
file = StringIO.new("images_path = #{@images_src_path.inspect}\n")
|
56
|
+
Compass.add_configuration(file, "sprite_config")
|
57
|
+
importer = Compass::SpriteImporter.new(:uri => 'bad_extensions/*.jpg', :options => options)
|
58
|
+
begin
|
59
|
+
importer.sass_engine
|
60
|
+
assert false, "An invalid sprite file made it past validation."
|
61
|
+
rescue Compass::Error => e
|
62
|
+
assert e.message.include?('.png')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SpriteCommandTest < Test::Unit::TestCase
|
4
|
+
attr_reader :test_dir
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@images_src_path = File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'sprites', 'public', 'images')
|
8
|
+
@images_tmp_path = File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'sprites', 'public', 'images-tmp')
|
9
|
+
@before_dir = ::Dir.pwd
|
10
|
+
create_temp_cli_dir
|
11
|
+
create_sprite_temp
|
12
|
+
File.open(File.join(@test_dir, 'config.rb'), 'w') do |f|
|
13
|
+
f << config_data
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def create_sprite_temp
|
18
|
+
::FileUtils.cp_r @images_src_path, @images_tmp_path
|
19
|
+
end
|
20
|
+
|
21
|
+
def clean_up_sprites
|
22
|
+
::FileUtils.rm_r @images_tmp_path
|
23
|
+
end
|
24
|
+
|
25
|
+
def config_data
|
26
|
+
return <<-CONFIG
|
27
|
+
images_path = #{@images_tmp_path.inspect}
|
28
|
+
CONFIG
|
29
|
+
end
|
30
|
+
|
31
|
+
def create_temp_cli_dir
|
32
|
+
directory = File.join(File.expand_path('../', __FILE__), 'test')
|
33
|
+
::FileUtils.mkdir_p directory
|
34
|
+
@test_dir = directory
|
35
|
+
end
|
36
|
+
|
37
|
+
def run_compass_with_options(options)
|
38
|
+
output = 'foo'
|
39
|
+
::Dir.chdir @test_dir
|
40
|
+
%x{compass #{options.join(' ')}}
|
41
|
+
end
|
42
|
+
|
43
|
+
def options_to_cli(options)
|
44
|
+
options.map.flatten!
|
45
|
+
end
|
46
|
+
|
47
|
+
def teardown
|
48
|
+
::Dir.chdir @before_dir
|
49
|
+
clean_up_sprites
|
50
|
+
if File.exists?(@test_dir)
|
51
|
+
::FileUtils.rm_r @test_dir
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should create sprite file" do
|
56
|
+
assert_equal 0, run_compass_with_options(['sprite', "-f", 'stylesheet.scss', "'#{@images_tmp_path}/*.png'"]).to_i
|
57
|
+
assert File.exists?(File.join(test_dir, 'stylesheet.scss'))
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class
|
3
|
+
class SpriteMapTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
6
|
Hash.send(:include, Compass::SassExtensions::Functions::Sprites::VariableReader)
|
@@ -16,8 +16,8 @@ class SpritesBaseTest < Test::Unit::TestCase
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def setup_map
|
19
|
-
@
|
20
|
-
@base = Compass::SassExtensions::Sprites::
|
19
|
+
@importer = Compass::SpriteImporter.new(:uri => "selectors/*.png", :options => @options)
|
20
|
+
@base = Compass::SassExtensions::Sprites::SpriteMap.new(@importer.sprite_names.map{|n| "selectors/#{n}.png"}, @importer.path, @importer.name, @importer.sass_engine, @importer.options)
|
21
21
|
end
|
22
22
|
|
23
23
|
def teardown
|
@@ -29,7 +29,7 @@ class SpritesBaseTest < Test::Unit::TestCase
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should have the sprite names" do
|
32
|
-
assert_equal @
|
32
|
+
assert_equal @importer.sprite_names, @base.sprite_names
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should have image filenames' do
|
@@ -49,7 +49,7 @@ class SpritesBaseTest < Test::Unit::TestCase
|
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'should have correct filename' do
|
52
|
-
assert_equal File.join(@images_tmp_path, "#{@base.path}
|
52
|
+
assert_equal File.join(@images_tmp_path, "#{@base.path}-s#{@base.uniqueness_hash}.png"), @base.filename
|
53
53
|
end
|
54
54
|
|
55
55
|
it "should return the 'ten-by-ten' image" do
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 55
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 11
|
9
|
-
- 2
|
10
|
-
version: 0.11.2
|
5
|
+
version: 0.11.3
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Chris Eppstein
|
@@ -19,7 +14,7 @@ autorequire:
|
|
19
14
|
bindir: bin
|
20
15
|
cert_chain: []
|
21
16
|
|
22
|
-
date: 2011-06-
|
17
|
+
date: 2011-06-12 00:00:00 -07:00
|
23
18
|
default_executable:
|
24
19
|
dependencies:
|
25
20
|
- !ruby/object:Gem::Dependency
|
@@ -30,10 +25,6 @@ dependencies:
|
|
30
25
|
requirements:
|
31
26
|
- - ~>
|
32
27
|
- !ruby/object:Gem::Version
|
33
|
-
hash: 5
|
34
|
-
segments:
|
35
|
-
- 3
|
36
|
-
- 1
|
37
28
|
version: "3.1"
|
38
29
|
type: :runtime
|
39
30
|
version_requirements: *id001
|
@@ -45,11 +36,7 @@ dependencies:
|
|
45
36
|
requirements:
|
46
37
|
- - ~>
|
47
38
|
- !ruby/object:Gem::Version
|
48
|
-
|
49
|
-
segments:
|
50
|
-
- 1
|
51
|
-
- 1
|
52
|
-
version: "1.1"
|
39
|
+
version: "1.2"
|
53
40
|
type: :runtime
|
54
41
|
version_requirements: *id002
|
55
42
|
- !ruby/object:Gem::Dependency
|
@@ -60,11 +47,6 @@ dependencies:
|
|
60
47
|
requirements:
|
61
48
|
- - ">="
|
62
49
|
- !ruby/object:Gem::Version
|
63
|
-
hash: 25
|
64
|
-
segments:
|
65
|
-
- 0
|
66
|
-
- 2
|
67
|
-
- 7
|
68
50
|
version: 0.2.7
|
69
51
|
type: :runtime
|
70
52
|
version_requirements: *id003
|
@@ -642,6 +624,7 @@ files:
|
|
642
624
|
- lib/compass/browser_support.rb
|
643
625
|
- lib/compass/browser_support.rbc
|
644
626
|
- lib/compass/commands/base.rb
|
627
|
+
- lib/compass/commands/clean_project.rb
|
645
628
|
- lib/compass/commands/create_project.rb
|
646
629
|
- lib/compass/commands/default.rb
|
647
630
|
- lib/compass/commands/generate_grid_background.rb
|
@@ -744,7 +727,6 @@ files:
|
|
744
727
|
- lib/compass/sass_extensions/monkey_patches/traversal.rbc
|
745
728
|
- lib/compass/sass_extensions/monkey_patches.rb
|
746
729
|
- lib/compass/sass_extensions/monkey_patches.rbc
|
747
|
-
- lib/compass/sass_extensions/sprites/base.rb
|
748
730
|
- lib/compass/sass_extensions/sprites/base.rbc
|
749
731
|
- lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb
|
750
732
|
- lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rbc
|
@@ -752,14 +734,17 @@ files:
|
|
752
734
|
- lib/compass/sass_extensions/sprites/engines.rbc
|
753
735
|
- lib/compass/sass_extensions/sprites/image.rb
|
754
736
|
- lib/compass/sass_extensions/sprites/image.rbc
|
737
|
+
- lib/compass/sass_extensions/sprites/image_methods.rb
|
755
738
|
- lib/compass/sass_extensions/sprites/sprite_map.rb
|
756
739
|
- lib/compass/sass_extensions/sprites/sprite_map.rbc
|
757
|
-
- lib/compass/sass_extensions/sprites/
|
740
|
+
- lib/compass/sass_extensions/sprites/sprite_methods.rb
|
758
741
|
- lib/compass/sass_extensions/sprites/sprites.rbc
|
759
742
|
- lib/compass/sass_extensions/sprites.rb
|
760
743
|
- lib/compass/sass_extensions/sprites.rbc
|
761
744
|
- lib/compass/sass_extensions.rb
|
762
745
|
- lib/compass/sass_extensions.rbc
|
746
|
+
- lib/compass/sprite_importer.rb
|
747
|
+
- lib/compass/sprite_importer.rbc
|
763
748
|
- lib/compass/stats.rb
|
764
749
|
- lib/compass/test_case.rb
|
765
750
|
- lib/compass/util.rb
|
@@ -769,6 +754,8 @@ files:
|
|
769
754
|
- lib/compass/version.rbc
|
770
755
|
- lib/compass.rb
|
771
756
|
- lib/compass.rbc
|
757
|
+
- test/fixtures/sprites/public/images/bad_extensions/ten-by-ten.gif
|
758
|
+
- test/fixtures/sprites/public/images/bad_extensions/twenty-by-twenty.jpg
|
772
759
|
- test/fixtures/sprites/public/images/colors/blue.png
|
773
760
|
- test/fixtures/sprites/public/images/colors/yellow.png
|
774
761
|
- test/fixtures/sprites/public/images/ko/default_background.png
|
@@ -832,6 +819,13 @@ files:
|
|
832
819
|
- test/fixtures/stylesheets/blueprint/sass/single-imports/scaffolding.scss
|
833
820
|
- test/fixtures/stylesheets/blueprint/sass/single-imports/typography.scss
|
834
821
|
- test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.scss
|
822
|
+
- test/fixtures/stylesheets/busted_image_urls/config.rb
|
823
|
+
- test/fixtures/stylesheets/busted_image_urls/css/screen.css
|
824
|
+
- test/fixtures/stylesheets/busted_image_urls/images/feed.png
|
825
|
+
- test/fixtures/stylesheets/busted_image_urls/images/flags/dk.png
|
826
|
+
- test/fixtures/stylesheets/busted_image_urls/images/grid.png
|
827
|
+
- test/fixtures/stylesheets/busted_image_urls/sass/screen.sass
|
828
|
+
- test/fixtures/stylesheets/busted_image_urls/tmp/screen.css
|
835
829
|
- test/fixtures/stylesheets/compass/100x150.jpg
|
836
830
|
- test/fixtures/stylesheets/compass/config.rb
|
837
831
|
- test/fixtures/stylesheets/compass/css/border_radius.css
|
@@ -1108,7 +1102,7 @@ files:
|
|
1108
1102
|
- test/fixtures/stylesheets/compass/images/flag/za.png
|
1109
1103
|
- test/fixtures/stylesheets/compass/images/flag/zm.png
|
1110
1104
|
- test/fixtures/stylesheets/compass/images/flag/zw.png
|
1111
|
-
- test/fixtures/stylesheets/compass/images/flag-
|
1105
|
+
- test/fixtures/stylesheets/compass/images/flag-s03c3b29b35.png
|
1112
1106
|
- test/fixtures/stylesheets/compass/sass/border_radius.scss
|
1113
1107
|
- test/fixtures/stylesheets/compass/sass/box.sass
|
1114
1108
|
- test/fixtures/stylesheets/compass/sass/box_shadow.scss
|
@@ -1131,6 +1125,8 @@ files:
|
|
1131
1125
|
- test/fixtures/stylesheets/compass/sass/transform.scss
|
1132
1126
|
- test/fixtures/stylesheets/compass/sass/utilities.scss
|
1133
1127
|
- test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss
|
1128
|
+
- test/fixtures/stylesheets/error/config.rb
|
1129
|
+
- test/fixtures/stylesheets/error/sass/screen.sass
|
1134
1130
|
- test/fixtures/stylesheets/image_urls/config.rb
|
1135
1131
|
- test/fixtures/stylesheets/image_urls/css/screen.css
|
1136
1132
|
- test/fixtures/stylesheets/image_urls/images/grid.png
|
@@ -1155,12 +1151,16 @@ files:
|
|
1155
1151
|
- test/integrations/sprites_test.rb
|
1156
1152
|
- test/integrations/test_rails_helper.rb
|
1157
1153
|
- test/test_helper.rb
|
1154
|
+
- test/units/actions_test.rb
|
1158
1155
|
- test/units/command_line_test.rb
|
1159
1156
|
- test/units/compass_png_test.rb
|
1160
1157
|
- test/units/configuration_test.rb
|
1161
1158
|
- test/units/sass_extensions_test.rb
|
1162
|
-
- test/units/sprites/
|
1159
|
+
- test/units/sprites/engine_test.rb
|
1163
1160
|
- test/units/sprites/image_test.rb
|
1161
|
+
- test/units/sprites/importer_test.rb
|
1162
|
+
- test/units/sprites/sprite_command_test.rb
|
1163
|
+
- test/units/sprites/sprite_map_test.rb
|
1164
1164
|
- features/command_line.feature
|
1165
1165
|
- features/extensions.feature
|
1166
1166
|
- features/rails_integration.feature
|
@@ -1180,27 +1180,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1180
1180
|
requirements:
|
1181
1181
|
- - ">="
|
1182
1182
|
- !ruby/object:Gem::Version
|
1183
|
-
hash: 3
|
1184
|
-
segments:
|
1185
|
-
- 0
|
1186
1183
|
version: "0"
|
1187
1184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1188
1185
|
none: false
|
1189
1186
|
requirements:
|
1190
1187
|
- - ">="
|
1191
1188
|
- !ruby/object:Gem::Version
|
1192
|
-
hash: 3
|
1193
|
-
segments:
|
1194
|
-
- 0
|
1195
1189
|
version: "0"
|
1196
1190
|
requirements: []
|
1197
1191
|
|
1198
1192
|
rubyforge_project:
|
1199
|
-
rubygems_version: 1.
|
1193
|
+
rubygems_version: 1.5.3
|
1200
1194
|
signing_key:
|
1201
1195
|
specification_version: 3
|
1202
1196
|
summary: A Real Stylesheet Framework
|
1203
1197
|
test_files:
|
1198
|
+
- test/fixtures/sprites/public/images/bad_extensions/ten-by-ten.gif
|
1199
|
+
- test/fixtures/sprites/public/images/bad_extensions/twenty-by-twenty.jpg
|
1204
1200
|
- test/fixtures/sprites/public/images/colors/blue.png
|
1205
1201
|
- test/fixtures/sprites/public/images/colors/yellow.png
|
1206
1202
|
- test/fixtures/sprites/public/images/ko/default_background.png
|
@@ -1264,6 +1260,13 @@ test_files:
|
|
1264
1260
|
- test/fixtures/stylesheets/blueprint/sass/single-imports/scaffolding.scss
|
1265
1261
|
- test/fixtures/stylesheets/blueprint/sass/single-imports/typography.scss
|
1266
1262
|
- test/fixtures/stylesheets/blueprint/sass/single-imports/utilities.scss
|
1263
|
+
- test/fixtures/stylesheets/busted_image_urls/config.rb
|
1264
|
+
- test/fixtures/stylesheets/busted_image_urls/css/screen.css
|
1265
|
+
- test/fixtures/stylesheets/busted_image_urls/images/feed.png
|
1266
|
+
- test/fixtures/stylesheets/busted_image_urls/images/flags/dk.png
|
1267
|
+
- test/fixtures/stylesheets/busted_image_urls/images/grid.png
|
1268
|
+
- test/fixtures/stylesheets/busted_image_urls/sass/screen.sass
|
1269
|
+
- test/fixtures/stylesheets/busted_image_urls/tmp/screen.css
|
1267
1270
|
- test/fixtures/stylesheets/compass/100x150.jpg
|
1268
1271
|
- test/fixtures/stylesheets/compass/config.rb
|
1269
1272
|
- test/fixtures/stylesheets/compass/css/border_radius.css
|
@@ -1540,7 +1543,7 @@ test_files:
|
|
1540
1543
|
- test/fixtures/stylesheets/compass/images/flag/za.png
|
1541
1544
|
- test/fixtures/stylesheets/compass/images/flag/zm.png
|
1542
1545
|
- test/fixtures/stylesheets/compass/images/flag/zw.png
|
1543
|
-
- test/fixtures/stylesheets/compass/images/flag-
|
1546
|
+
- test/fixtures/stylesheets/compass/images/flag-s03c3b29b35.png
|
1544
1547
|
- test/fixtures/stylesheets/compass/sass/border_radius.scss
|
1545
1548
|
- test/fixtures/stylesheets/compass/sass/box.sass
|
1546
1549
|
- test/fixtures/stylesheets/compass/sass/box_shadow.scss
|
@@ -1563,6 +1566,8 @@ test_files:
|
|
1563
1566
|
- test/fixtures/stylesheets/compass/sass/transform.scss
|
1564
1567
|
- test/fixtures/stylesheets/compass/sass/utilities.scss
|
1565
1568
|
- test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss
|
1569
|
+
- test/fixtures/stylesheets/error/config.rb
|
1570
|
+
- test/fixtures/stylesheets/error/sass/screen.sass
|
1566
1571
|
- test/fixtures/stylesheets/image_urls/config.rb
|
1567
1572
|
- test/fixtures/stylesheets/image_urls/css/screen.css
|
1568
1573
|
- test/fixtures/stylesheets/image_urls/images/grid.png
|
@@ -1587,12 +1592,16 @@ test_files:
|
|
1587
1592
|
- test/integrations/sprites_test.rb
|
1588
1593
|
- test/integrations/test_rails_helper.rb
|
1589
1594
|
- test/test_helper.rb
|
1595
|
+
- test/units/actions_test.rb
|
1590
1596
|
- test/units/command_line_test.rb
|
1591
1597
|
- test/units/compass_png_test.rb
|
1592
1598
|
- test/units/configuration_test.rb
|
1593
1599
|
- test/units/sass_extensions_test.rb
|
1594
|
-
- test/units/sprites/
|
1600
|
+
- test/units/sprites/engine_test.rb
|
1595
1601
|
- test/units/sprites/image_test.rb
|
1602
|
+
- test/units/sprites/importer_test.rb
|
1603
|
+
- test/units/sprites/sprite_command_test.rb
|
1604
|
+
- test/units/sprites/sprite_map_test.rb
|
1596
1605
|
- features/command_line.feature
|
1597
1606
|
- features/extensions.feature
|
1598
1607
|
- features/rails_integration.feature
|
@@ -1,62 +0,0 @@
|
|
1
|
-
module Compass
|
2
|
-
class Sprites < Sass::Importers::Base
|
3
|
-
attr_accessor :name, :path
|
4
|
-
|
5
|
-
def self.path_and_name(uri)
|
6
|
-
if uri =~ %r{((.+/)?([^\*.]+))/(.+?)\.png}
|
7
|
-
[$1, $3]
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.discover_sprites(uri)
|
12
|
-
self.load_map(uri, {}).files
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.sprite_name(file)
|
16
|
-
File.basename(file, '.png')
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.load_map(uri, options)
|
20
|
-
Compass.quick_cache("spritemap:#{uri}", 5) do
|
21
|
-
SpriteMap.new(uri, options)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
|
26
|
-
# Called by the sass engine to build a new SpriteMap
|
27
|
-
def find(uri, options)
|
28
|
-
if uri =~ /\.png$/
|
29
|
-
map = Compass::Sprites.load_map(uri, options)
|
30
|
-
self.path, self.name = map.path, map.name
|
31
|
-
return map.sass_engine
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# Called by the sass engine to identify the SpriteMap
|
36
|
-
def self.key(uri, options={})
|
37
|
-
[self.class.name + ":" + File.dirname(File.expand_path(uri)), File.basename(uri)]
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.mtime(uri, options)
|
41
|
-
Compass.quick_cache("mtime:#{uri}") do
|
42
|
-
map = Compass::Sprites.load_map(uri, options)
|
43
|
-
map.files.inject(Time.at(0)) do |max_time, file|
|
44
|
-
(t = File.mtime(file)) > max_time ? t : max_time
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def to_s
|
50
|
-
""
|
51
|
-
end
|
52
|
-
|
53
|
-
def hash
|
54
|
-
self.class.name.hash
|
55
|
-
end
|
56
|
-
|
57
|
-
def eql?(other)
|
58
|
-
other.class == self.class
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
end
|