compass-rails 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +1 -1
- data/CHANGELOG.md +5 -1
- data/gemfiles/rails42.gemfile +1 -1
- data/lib/compass-rails.rb +2 -3
- data/lib/compass-rails/patches/compass.rb +1 -1
- data/lib/compass-rails/patches/importer.rb +2 -2
- data/lib/compass-rails/railties/3_1.rb +2 -2
- data/lib/compass-rails/railties/4_0.rb +4 -4
- data/lib/compass-rails/version.rb +1 -1
- data/test/compass_rails_spec.rb +20 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6248e53c74d94049fe347ed3cbea2136890672c
|
4
|
+
data.tar.gz: b8ad885403b583040e2e1a6e7b37627e5e0a5960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afffc7bad6944625683b6a6ec836912ce8b373fbe0d307bcc7e178a72d8a296bbce536e7fd720faa813485ee062532f3568d06d0a078d72031c87b8aaabfe1e5
|
7
|
+
data.tar.gz: f9af8bd85ba66408dd42ac23a05158098fdf3c083b58a9a2f0b2c17509d35dd20b4b5ef7431a2475c39042bdcd8122833585b7f92413a4fc3a730ffb2c26d987
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
data/gemfiles/rails42.gemfile
CHANGED
data/lib/compass-rails.rb
CHANGED
@@ -35,14 +35,14 @@ module CompassRails
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def sprockets
|
38
|
-
@sprockets ||=
|
38
|
+
@sprockets ||= Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)
|
39
39
|
end
|
40
40
|
|
41
41
|
def context
|
42
42
|
@context ||= begin
|
43
43
|
sprockets.version = ::Rails.env + "-#{sprockets.version}"
|
44
44
|
setup_fake_rails_env_paths(sprockets)
|
45
|
-
context = ::
|
45
|
+
context = ::CompassRails.sprockets.context_class
|
46
46
|
context.extend(::Sprockets::Helpers::IsolatedHelper)
|
47
47
|
context.extend(::Sprockets::Helpers::RailsHelper)
|
48
48
|
context.extend(::Sass::Rails::Railtie::SassContext)
|
@@ -125,4 +125,3 @@ if defined?(::Rails)
|
|
125
125
|
require "compass-rails/patches"
|
126
126
|
require "compass-rails/railties"
|
127
127
|
end
|
128
|
-
|
@@ -3,7 +3,7 @@ Compass::Core::SassExtensions::Functions::ImageSize.class_eval do
|
|
3
3
|
|
4
4
|
def image_path_for_size(image_file)
|
5
5
|
begin
|
6
|
-
file = ::
|
6
|
+
file = ::CompassRails.sprockets.find_asset(image_file)
|
7
7
|
return file
|
8
8
|
rescue ::Sprockets::FileOutsidePaths
|
9
9
|
return super(image_file)
|
@@ -8,11 +8,11 @@ module Compass
|
|
8
8
|
@sass_options[:custom] = {:resolver => ::Sass::Rails::Resolver.new(CompassRails.context)}
|
9
9
|
@sass_options[:load_paths] ||= []
|
10
10
|
unless @sass_options[:load_paths].any? {|k| k.is_a?(::Sass::Rails::Importer) }
|
11
|
-
::
|
11
|
+
::CompassRails.sprockets.paths.each do |path|
|
12
12
|
next unless path.to_s =~ STYLESHEET
|
13
13
|
Dir["#{path}/**/*"].each do |pathname|
|
14
14
|
# args are: sprockets environment, the logical_path ex. 'stylesheets', and the full path name for the render
|
15
|
-
context = ::CompassRails.context.new(::
|
15
|
+
context = ::CompassRails.context.new(::CompassRails.sprockets, File.basename(path), Pathname.new(pathname))
|
16
16
|
@sass_options[:load_paths] << ::Sass::Rails::Importer.new(context)
|
17
17
|
end
|
18
18
|
end
|
@@ -25,11 +25,11 @@ module CompassRails
|
|
25
25
|
|
26
26
|
# Clear entries in Hike::Index for this sprite's directory.
|
27
27
|
# This makes sure the asset can be found by find_assets
|
28
|
-
|
28
|
+
CompassRails.sprockets.send(:trail).instance_variable_get(:@entries).delete(File.dirname(filename))
|
29
29
|
|
30
30
|
pathname = Pathname.new(filename)
|
31
31
|
logical_path = pathname.relative_path_from(Pathname.new(Compass.configuration.images_path))
|
32
|
-
asset =
|
32
|
+
asset = CompassRails.sprockets.find_asset(logical_path)
|
33
33
|
target = File.join(Rails.public_path, Rails.application.config.assets.prefix, asset.digest_path)
|
34
34
|
|
35
35
|
# Adds the asset to the manifest file.
|
@@ -25,10 +25,10 @@ module CompassRails
|
|
25
25
|
|
26
26
|
# Clear entries in Hike::Index for this sprite's directory.
|
27
27
|
# This makes sure the asset can be found by find_assets
|
28
|
-
if
|
29
|
-
index =
|
28
|
+
if CompassRails.sprockets.respond_to?(:trail, true)
|
29
|
+
index = CompassRails.sprockets.send(:trail).index
|
30
30
|
else
|
31
|
-
index =
|
31
|
+
index = CompassRails.sprockets.index
|
32
32
|
end
|
33
33
|
|
34
34
|
index.instance_variable_get(:@entries).delete(File.dirname(filename))
|
@@ -36,7 +36,7 @@ module CompassRails
|
|
36
36
|
|
37
37
|
pathname = Pathname.new(filename)
|
38
38
|
logical_path = pathname.relative_path_from(Pathname.new(Compass.configuration.images_path))
|
39
|
-
asset =
|
39
|
+
asset = CompassRails.sprockets.find_asset(logical_path)
|
40
40
|
target = File.join(Rails.public_path, Rails.application.config.assets.prefix, asset.digest_path)
|
41
41
|
|
42
42
|
# Adds the asset to the manifest file.
|
data/test/compass_rails_spec.rb
CHANGED
@@ -36,4 +36,23 @@ describe CompassRails do
|
|
36
36
|
assert_equal "public/stylesheets", project.rails_property("compass.css_dir")
|
37
37
|
end
|
38
38
|
end unless ENV['DEBUG_COMPILE']
|
39
|
-
|
39
|
+
|
40
|
+
it "compiles when in production mode" do
|
41
|
+
within_rails_app('test_railtie') do |project|
|
42
|
+
project.setup_asset_fixtures!
|
43
|
+
|
44
|
+
# Mimic Rails production mode
|
45
|
+
project.set_rails('assets.compile', false)
|
46
|
+
|
47
|
+
assert project.boots?
|
48
|
+
|
49
|
+
project.precompile!
|
50
|
+
|
51
|
+
project.compiled_stylesheet 'public/assets/application*.css' do |css|
|
52
|
+
refute css.empty?
|
53
|
+
assert_match 'body container', css
|
54
|
+
assert_match '.numbers-sprite-1', css
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
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: 3.0.
|
4
|
+
version: 3.0.1
|
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: 2016-
|
13
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: compass
|