compass-rails 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/compass-rails/patches/sass_importer.rb +1 -1
- data/lib/compass-rails/patches/sprite_importer.rb +3 -3
- data/lib/compass-rails/railties/4_0.rb +6 -0
- data/lib/compass-rails/version.rb +1 -1
- data/test/compass_rails_spec.rb +2 -0
- data/test/fixtures/assets/images/letters/a.png +0 -0
- data/test/fixtures/assets/images/letters/b.png +0 -0
- data/test/fixtures/assets/stylesheets/application.css.scss +5 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aea54e61ee5ba66c77fb1551ac1d84e80f223873
|
4
|
+
data.tar.gz: d7f0097bac198b698810651cb965368961f229b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98f86f7f3febe3e167f2d61f5d76637c685a30cc1b640a5b89df9d13ddf29b54f3d4b6859ee2664e96f90380cb05d6d2ee431eef84bcb71da93236e484e3d3a8
|
7
|
+
data.tar.gz: 3cb173724d727cd77c63294d28cedf7f87260866a4fc3891bc0dab725d10d0d65c9071769b6252c2e5f24382e0da29d4943807ffb6110e96a566815bdf1f82c2
|
@@ -14,7 +14,7 @@ klass.class_eval do
|
|
14
14
|
Sprockets::SassProcessor::CacheStore.new(sprockets_cache_store, context.environment)
|
15
15
|
end
|
16
16
|
|
17
|
-
paths = context.environment.paths.map { |path| CompassRails::SpriteImporter.new(
|
17
|
+
paths = context.environment.paths.map { |path| CompassRails::SpriteImporter.new(path) }
|
18
18
|
paths += context.environment.paths.map { |path| sass_importer(context, path) }
|
19
19
|
paths += ::Rails.application.config.sass.load_paths
|
20
20
|
|
@@ -3,15 +3,15 @@ require 'compass/sprite_importer'
|
|
3
3
|
|
4
4
|
module CompassRails
|
5
5
|
class SpriteImporter < Compass::SpriteImporter
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :root
|
7
7
|
|
8
|
-
def initialize(
|
9
|
-
@context = context
|
8
|
+
def initialize(root)
|
10
9
|
@root = root
|
11
10
|
end
|
12
11
|
|
13
12
|
def find(uri, options)
|
14
13
|
if old = super(uri, options)
|
14
|
+
context = options[:sprockets][:context]
|
15
15
|
self.class.files(uri).each do |file|
|
16
16
|
relative_path = Pathname.new(file).relative_path_from(Pathname.new(root))
|
17
17
|
begin
|
@@ -23,6 +23,12 @@ module CompassRails
|
|
23
23
|
caller.grep(%r{/sprockets/rails/task.rb}).any? && #OMG HAX - check if we're being precompiled
|
24
24
|
Compass.configuration.generated_images_path[Compass.configuration.images_path.to_s] # if the generated images path is not in the assets images directory, we don't have to do these backflips
|
25
25
|
|
26
|
+
# Clear entries in Hike::Index for this sprite's directory.
|
27
|
+
# This makes sure the asset can be found by find_assets
|
28
|
+
index = Rails.application.assets.send(:trail).index
|
29
|
+
index.instance_variable_get(:@entries).delete(File.dirname(filename))
|
30
|
+
index.instance_variable_get(:@stats).delete(filename)
|
31
|
+
|
26
32
|
pathname = Pathname.new(filename)
|
27
33
|
logical_path = pathname.relative_path_from(Pathname.new(Compass.configuration.images_path))
|
28
34
|
asset = Rails.application.assets.find_asset(logical_path)
|
data/test/compass_rails_spec.rb
CHANGED
Binary file
|
Binary file
|
@@ -4,7 +4,11 @@
|
|
4
4
|
// Glob import SCSS partials
|
5
5
|
@import "partials/*";
|
6
6
|
|
7
|
-
// Import Sprites
|
7
|
+
// Import Sprites
|
8
|
+
@import "letters/*.png";
|
9
|
+
@include all-letters-sprites;
|
10
|
+
|
11
|
+
// Inline Sprites
|
8
12
|
$numbers-inline: true;
|
9
13
|
@import "numbers/sprite-*.png";
|
10
14
|
@include all-numbers-sprites;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Davis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-01-
|
13
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: compass
|
@@ -94,6 +94,8 @@ files:
|
|
94
94
|
- sache.json
|
95
95
|
- test/compass_rails_spec.rb
|
96
96
|
- test/fixtures/.gitkeep
|
97
|
+
- test/fixtures/assets/images/letters/a.png
|
98
|
+
- test/fixtures/assets/images/letters/b.png
|
97
99
|
- test/fixtures/assets/images/numbers/sprite-1.png
|
98
100
|
- test/fixtures/assets/images/numbers/sprite-2.png
|
99
101
|
- test/fixtures/assets/stylesheets/application.css.scss
|
@@ -132,6 +134,8 @@ summary: Integrate Compass into Rails 3.0 and up.
|
|
132
134
|
test_files:
|
133
135
|
- test/compass_rails_spec.rb
|
134
136
|
- test/fixtures/.gitkeep
|
137
|
+
- test/fixtures/assets/images/letters/a.png
|
138
|
+
- test/fixtures/assets/images/letters/b.png
|
135
139
|
- test/fixtures/assets/images/numbers/sprite-1.png
|
136
140
|
- test/fixtures/assets/images/numbers/sprite-2.png
|
137
141
|
- test/fixtures/assets/stylesheets/application.css.scss
|