compass-rails 2.0.3 → 2.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d3ea3227955811ea299dc8f915573ae37ee90f5
4
- data.tar.gz: 24816da0d21eeef9ba77e4ddeb9e5d5deeda2f4a
3
+ metadata.gz: aea54e61ee5ba66c77fb1551ac1d84e80f223873
4
+ data.tar.gz: d7f0097bac198b698810651cb965368961f229b6
5
5
  SHA512:
6
- metadata.gz: 5a20909a5341932b4e5b88067d3dcbba5eaec2e7e9ed5b4c166fc55772b73e377e5363e8e6f80fcfe25b1e9bd6a7613deb12973b5200b197a31ac072a11bd387
7
- data.tar.gz: f85fc30a47c2a9f77774ecdab8bfab905acb73366d0f9e58f1485b8de03b7c488031bab426c08067795e358eeff5ddd163de6e4bff61029996693659ef541645
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(context, path) }
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 :context, :root
6
+ attr_reader :root
7
7
 
8
- def initialize(context, root)
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)
@@ -1,5 +1,5 @@
1
1
  module CompassRails
2
2
  unless defined?(::CompassRails::VERSION)
3
- VERSION = "2.0.3"
3
+ VERSION = "2.0.4"
4
4
  end
5
5
  end
@@ -18,6 +18,8 @@ describe CompassRails do
18
18
  assert_match "-moz-border-radius", css
19
19
  assert_match '.numbers-sprite-1', css
20
20
  assert_match '.numbers-sprite-2', css
21
+ assert_match '.letters-a', css
22
+ assert_match '.letters-a', css
21
23
  end
22
24
  end
23
25
  end
@@ -4,7 +4,11 @@
4
4
  // Glob import SCSS partials
5
5
  @import "partials/*";
6
6
 
7
- // Import Sprites and Inline them to save
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.3
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-07 00:00:00.000000000 Z
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