compass-rails 2.0.5 → 3.1.0
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 +4 -4
- data/.travis.yml +26 -13
- data/Appraisals +25 -0
- data/CHANGELOG.md +12 -1
- data/Gemfile +1 -0
- data/README.md +6 -4
- data/Rakefile +4 -14
- data/compass-rails.gemspec +2 -2
- data/gemfiles/rails31.gemfile +4 -3
- data/gemfiles/rails32.gemfile +4 -3
- data/gemfiles/rails40.gemfile +4 -3
- data/gemfiles/rails42.gemfile +4 -3
- data/gemfiles/rails50.gemfile +19 -0
- data/gemfiles/rails51.gemfile +19 -0
- data/gemfiles/rails_edge.gemfile +22 -0
- data/lib/compass-rails/patches/4_0.rb +8 -2
- data/lib/compass-rails/patches/compass.rb +2 -2
- data/lib/compass-rails/patches/importer.rb +2 -2
- data/lib/compass-rails/patches/sass_importer.rb +19 -15
- data/lib/compass-rails/patches/sprite_importer.rb +1 -1
- data/lib/compass-rails/railties/3_1.rb +2 -2
- data/lib/compass-rails/railties/4_0.rb +9 -4
- data/lib/compass-rails/version.rb +1 -3
- data/lib/compass-rails.rb +11 -5
- data/test/compass_rails_spec.rb +20 -1
- data/test/helpers/rails_helper.rb +9 -0
- data/test/helpers/rails_project.rb +6 -0
- metadata +7 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eea50b65faf9ecd3bf9bcd471f11376149600c62
|
|
4
|
+
data.tar.gz: 8ffed3f19d288998804e98dbed2e25c473a06afc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 671825816ee26661cfaf09da988a0ff3fd9535a63cdef5c8513bd44d1cb27835dad9127eb13382cac3e21181df4038c1587e40c73f2926c6fe2e200e9ef8a1a6
|
|
7
|
+
data.tar.gz: f8eb49b0f9369b164c5679a52b0fc10ec2efe8241c5899dfa4738133a403b773bfbc8b9643f76ce9f8ca85558ece494d4eb1854c21bd95029303ebde102daece
|
data/.travis.yml
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
language: ruby
|
|
2
|
-
|
|
3
2
|
sudo: false
|
|
4
|
-
|
|
5
3
|
rvm:
|
|
6
|
-
-
|
|
7
|
-
- 2.0
|
|
8
|
-
- 2.
|
|
9
|
-
-
|
|
4
|
+
- 2.2.4
|
|
5
|
+
- 2.3.0
|
|
6
|
+
- 2.4.0
|
|
7
|
+
- ruby-head
|
|
10
8
|
- jruby-head
|
|
11
|
-
- rbx-2.4.1
|
|
12
|
-
|
|
13
|
-
matrix:
|
|
14
|
-
allow_failures:
|
|
15
|
-
- rvm: jruby-head
|
|
16
|
-
- rvm: rbx-2.4.1
|
|
17
|
-
|
|
18
9
|
gemfile:
|
|
19
10
|
- gemfiles/rails31.gemfile
|
|
20
11
|
- gemfiles/rails32.gemfile
|
|
21
12
|
- gemfiles/rails40.gemfile
|
|
22
13
|
- gemfiles/rails42.gemfile
|
|
14
|
+
- gemfiles/rails50.gemfile
|
|
15
|
+
- gemfiles/rails51.gemfile
|
|
16
|
+
- gemfiles/rails_edge.gemfile
|
|
17
|
+
matrix:
|
|
18
|
+
exclude:
|
|
19
|
+
- rvm: 2.4.0
|
|
20
|
+
gemfile: gemfiles/rails31.gemfile
|
|
21
|
+
- rvm: 2.4.0
|
|
22
|
+
gemfile: gemfiles/rails32.gemfile
|
|
23
|
+
- rvm: 2.4.0
|
|
24
|
+
gemfile: gemfiles/rails40.gemfile
|
|
25
|
+
- rvm: ruby-head
|
|
26
|
+
gemfile: gemfiles/rails31.gemfile
|
|
27
|
+
- rvm: ruby-head
|
|
28
|
+
gemfile: gemfiles/rails32.gemfile
|
|
29
|
+
- rvm: ruby-head
|
|
30
|
+
gemfile: gemfiles/rails40.gemfile
|
|
31
|
+
fast_finish: true
|
|
32
|
+
allow_failures:
|
|
33
|
+
- rvm: ruby-head
|
|
34
|
+
- rvm: jruby-head
|
|
35
|
+
- gemfile: gemfiles/rails_edge.gemfile
|
data/Appraisals
CHANGED
|
@@ -1,19 +1,44 @@
|
|
|
1
1
|
appraise "rails31" do
|
|
2
2
|
gem "rails", "3.1.3"
|
|
3
|
+
gem "sprockets", "< 2.13"
|
|
3
4
|
gem "sass-rails"
|
|
4
5
|
end
|
|
5
6
|
|
|
6
7
|
appraise "rails32" do
|
|
7
8
|
gem "rails", "~> 3.2"
|
|
9
|
+
gem "sprockets", "< 2.13"
|
|
8
10
|
gem "sass-rails"
|
|
9
11
|
end
|
|
10
12
|
|
|
11
13
|
appraise "rails40" do
|
|
12
14
|
gem "rails", "~> 4.0.0"
|
|
15
|
+
gem "sprockets", "< 2.13"
|
|
13
16
|
gem "sass-rails"
|
|
14
17
|
end
|
|
15
18
|
|
|
16
19
|
appraise "rails42" do
|
|
17
20
|
gem "rails", "~> 4.2.0"
|
|
21
|
+
gem "sprockets", "< 4.0"
|
|
22
|
+
gem "sass-rails", "~> 5.0"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
appraise "rails50" do
|
|
26
|
+
gem "rails", "~> 5.0.0"
|
|
27
|
+
gem "sprockets", "< 4.0"
|
|
28
|
+
gem "sass-rails", "~> 5.0"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
appraise "rails51" do
|
|
32
|
+
gem "rails", "~> 5.1.0"
|
|
33
|
+
gem "sprockets", "< 4.0"
|
|
34
|
+
gem "sass-rails", "~> 5.0"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
appraise "rails_edge" do
|
|
38
|
+
git 'git://github.com/rails/rails.git' do
|
|
39
|
+
gem "rails"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
gem "sprockets", "< 4.0"
|
|
18
43
|
gem "sass-rails", "~> 5.0"
|
|
19
44
|
end
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
# Change log
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.1 - 2016-2
|
|
4
|
+
### Fixed
|
|
5
|
+
- Fix running rake assts:precompile to be run in production mode. Issue #257.
|
|
6
|
+
|
|
7
|
+
## 3.0.0 - 2016-01-23
|
|
8
|
+
### Added
|
|
9
|
+
- Added Sprockets 3 support. Issue #232, #236, #244.
|
|
4
10
|
|
|
11
|
+
### Fixed
|
|
12
|
+
- Sprockets cache files are no longer saved to /tmp and now use the app-level tmp folder instead.
|
|
13
|
+
|
|
14
|
+
## 2.0.2 - 2015-01-03
|
|
15
|
+
### Fixed
|
|
5
16
|
- Fixed test suite to test against Rails 3.1, 3.2, 4.0, 4.2 on Ruby 1.9.3, 2.0.0, 2.1.0, 2.2.0 and jruby-head. Issue #206
|
|
6
17
|
- Support up to sass-rails 5.0.1. Issue #198
|
|
7
18
|
- Fix sass_importer patches having incorrect method signatures. Issue #195
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
# compass-rails
|
|
2
2
|
|
|
3
|
+
**Don't start new projects with compass, it is no longer supported, see the [compass statement](https://github.com/Compass/compass/pull/2094)**
|
|
4
|
+
|
|
3
5
|
**We Take Pull Requests!**
|
|
4
6
|
|
|
5
|
-
[](https://travis-ci.org/Compass/compass-rails)
|
|
8
|
+
[](https://codeclimate.com/github/Compass/compass-rails)
|
|
7
9
|
[](http://badge.fury.io/rb/compass-rails)
|
|
8
|
-
[](https://coveralls.io/r/Compass/compass-rails)
|
|
9
11
|
|
|
10
12
|
Compass rails is an adapter for the [Compass Stylesheet Authoring
|
|
11
13
|
Framework](http://compass-style.org) for [Ruby on Rails](http://rubyonrails.org/).
|
|
12
14
|
|
|
13
15
|
Since Compass v0.12.0, this is the only way to use compass with your rails application.
|
|
14
16
|
|
|
15
|
-
Supports Rails 3.2, 4.x releases.
|
|
17
|
+
Supports Rails 3.2, 4.x and 5.x releases.
|
|
16
18
|
|
|
17
19
|
## Installation
|
|
18
20
|
|
data/Rakefile
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env rake
|
|
2
|
-
require '
|
|
3
|
-
require 'bundler'
|
|
4
|
-
Bundler.setup
|
|
5
|
-
require 'rake/dsl_definition'
|
|
6
|
-
|
|
7
|
-
require "bundler/gem_tasks"
|
|
8
|
-
require 'appraisal'
|
|
9
|
-
require 'compass'
|
|
10
|
-
|
|
11
|
-
# ----- Default: Testing ------
|
|
12
|
-
|
|
13
|
-
task :default => [:test]
|
|
14
|
-
|
|
2
|
+
require 'bundler/gem_tasks'
|
|
15
3
|
require 'rake/testtask'
|
|
16
|
-
require 'fileutils'
|
|
17
4
|
|
|
18
5
|
Rake::TestTask.new :test do |t|
|
|
6
|
+
require 'fileutils'
|
|
19
7
|
t.libs << 'lib'
|
|
20
8
|
t.libs << 'test'
|
|
21
9
|
test_files = FileList['test/**/*_{test,spec}.rb']
|
|
@@ -23,3 +11,5 @@ Rake::TestTask.new :test do |t|
|
|
|
23
11
|
t.test_files = test_files
|
|
24
12
|
t.verbose = true
|
|
25
13
|
end
|
|
14
|
+
|
|
15
|
+
task :default => [:test]
|
data/compass-rails.gemspec
CHANGED
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
|
16
16
|
gem.version = CompassRails::VERSION
|
|
17
17
|
gem.license = "MIT"
|
|
18
18
|
|
|
19
|
-
gem.add_dependency 'compass',
|
|
20
|
-
gem.add_dependency 'sprockets',
|
|
19
|
+
gem.add_dependency 'compass', '~> 1.0.0'
|
|
20
|
+
gem.add_dependency 'sprockets', '< 4.0'
|
|
21
21
|
gem.add_dependency 'sass-rails', '< 5.1'
|
|
22
22
|
end
|
data/gemfiles/rails31.gemfile
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
source "https://rubygems.org"
|
|
4
4
|
|
|
5
|
-
gem "rb-fsevent", :
|
|
6
|
-
gem "ruby_gntp", :
|
|
5
|
+
gem "rb-fsevent", require: false
|
|
6
|
+
gem "ruby_gntp", require: false
|
|
7
7
|
gem "guard"
|
|
8
8
|
gem "guard-test"
|
|
9
9
|
gem "rails", "3.1.3"
|
|
10
|
+
gem "sprockets", "< 2.13"
|
|
10
11
|
gem "sass-rails"
|
|
11
12
|
|
|
12
13
|
group :test do
|
|
@@ -15,4 +16,4 @@ group :test do
|
|
|
15
16
|
gem "minitest"
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
gemspec :
|
|
19
|
+
gemspec path: "../"
|
data/gemfiles/rails32.gemfile
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
source "https://rubygems.org"
|
|
4
4
|
|
|
5
|
-
gem "rb-fsevent", :
|
|
6
|
-
gem "ruby_gntp", :
|
|
5
|
+
gem "rb-fsevent", require: false
|
|
6
|
+
gem "ruby_gntp", require: false
|
|
7
7
|
gem "guard"
|
|
8
8
|
gem "guard-test"
|
|
9
9
|
gem "rails", "~> 3.2"
|
|
10
|
+
gem "sprockets", "< 2.13"
|
|
10
11
|
gem "sass-rails"
|
|
11
12
|
|
|
12
13
|
group :test do
|
|
@@ -15,4 +16,4 @@ group :test do
|
|
|
15
16
|
gem "minitest"
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
gemspec :
|
|
19
|
+
gemspec path: "../"
|
data/gemfiles/rails40.gemfile
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
source "https://rubygems.org"
|
|
4
4
|
|
|
5
|
-
gem "rb-fsevent", :
|
|
6
|
-
gem "ruby_gntp", :
|
|
5
|
+
gem "rb-fsevent", require: false
|
|
6
|
+
gem "ruby_gntp", require: false
|
|
7
7
|
gem "guard"
|
|
8
8
|
gem "guard-test"
|
|
9
9
|
gem "rails", "~> 4.0.0"
|
|
10
|
+
gem "sprockets", "< 2.13"
|
|
10
11
|
gem "sass-rails"
|
|
11
12
|
|
|
12
13
|
group :test do
|
|
@@ -15,4 +16,4 @@ group :test do
|
|
|
15
16
|
gem "minitest"
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
gemspec :
|
|
19
|
+
gemspec path: "../"
|
data/gemfiles/rails42.gemfile
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
source "https://rubygems.org"
|
|
4
4
|
|
|
5
|
-
gem "rb-fsevent", :
|
|
6
|
-
gem "ruby_gntp", :
|
|
5
|
+
gem "rb-fsevent", require: false
|
|
6
|
+
gem "ruby_gntp", require: false
|
|
7
7
|
gem "guard"
|
|
8
8
|
gem "guard-test"
|
|
9
9
|
gem "rails", "~> 4.2.0"
|
|
10
|
+
gem "sprockets", "< 4.0"
|
|
10
11
|
gem "sass-rails", "~> 5.0"
|
|
11
12
|
|
|
12
13
|
group :test do
|
|
@@ -15,4 +16,4 @@ group :test do
|
|
|
15
16
|
gem "minitest"
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
gemspec :
|
|
19
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rb-fsevent", require: false
|
|
6
|
+
gem "ruby_gntp", require: false
|
|
7
|
+
gem "guard"
|
|
8
|
+
gem "guard-test"
|
|
9
|
+
gem "rails", "~> 5.0.0"
|
|
10
|
+
gem "sprockets", "< 4.0"
|
|
11
|
+
gem "sass-rails", "~> 5.0"
|
|
12
|
+
|
|
13
|
+
group :test do
|
|
14
|
+
gem "mocha"
|
|
15
|
+
gem "appraisal"
|
|
16
|
+
gem "minitest"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rb-fsevent", require: false
|
|
6
|
+
gem "ruby_gntp", require: false
|
|
7
|
+
gem "guard"
|
|
8
|
+
gem "guard-test"
|
|
9
|
+
gem "rails", "~> 5.1.0"
|
|
10
|
+
gem "sprockets", "< 4.0"
|
|
11
|
+
gem "sass-rails", "~> 5.0"
|
|
12
|
+
|
|
13
|
+
group :test do
|
|
14
|
+
gem "mocha"
|
|
15
|
+
gem "appraisal"
|
|
16
|
+
gem "minitest"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
git "git://github.com/rails/rails.git" do
|
|
6
|
+
gem "rails"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
gem "rb-fsevent", require: false
|
|
10
|
+
gem "ruby_gntp", require: false
|
|
11
|
+
gem "guard"
|
|
12
|
+
gem "guard-test"
|
|
13
|
+
gem "sprockets", "< 4.0"
|
|
14
|
+
gem "sass-rails", "~> 5.0"
|
|
15
|
+
|
|
16
|
+
group :test do
|
|
17
|
+
gem "mocha"
|
|
18
|
+
gem "appraisal"
|
|
19
|
+
gem "minitest"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
gemspec path: "../"
|
|
@@ -12,8 +12,14 @@ Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl.module_eval do
|
|
|
12
12
|
generated_images_dir = Compass.configuration.generated_images_dir
|
|
13
13
|
generated_images_dir = Rails.root.join(generated_images_dir)
|
|
14
14
|
|
|
15
|
-
sprockets_env
|
|
16
|
-
|
|
15
|
+
sprockets_env = options[:sprockets][:environment]
|
|
16
|
+
|
|
17
|
+
if sprockets_env.respond_to?(:trail, true)
|
|
18
|
+
sprockets_trail = sprockets_env.send(:trail)
|
|
19
|
+
else
|
|
20
|
+
sprockets_trail = sprockets_env.index
|
|
21
|
+
end
|
|
22
|
+
|
|
17
23
|
sprockets_entries = sprockets_trail.instance_variable_get(:@entries) || {}
|
|
18
24
|
sprockets_stats = sprockets_trail.instance_variable_get(:@stats) || {}
|
|
19
25
|
|
|
@@ -3,8 +3,8 @@ Compass::Core::SassExtensions::Functions::ImageSize.class_eval do
|
|
|
3
3
|
|
|
4
4
|
def image_path_for_size(image_file)
|
|
5
5
|
begin
|
|
6
|
-
file = ::
|
|
7
|
-
return file
|
|
6
|
+
file = ::CompassRails.sprockets.find_asset(image_file)
|
|
7
|
+
return (file.respond_to?(:pathname) ? file.pathname.to_s : file)
|
|
8
8
|
rescue ::Sprockets::FileOutsidePaths
|
|
9
9
|
return super(image_file)
|
|
10
10
|
end
|
|
@@ -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
|
|
@@ -7,11 +7,11 @@ end
|
|
|
7
7
|
klass.class_eval do
|
|
8
8
|
def evaluate(context, locals, &block)
|
|
9
9
|
# Use custom importer that knows about Sprockets Caching
|
|
10
|
-
cache_store =
|
|
11
|
-
if defined?(Sprockets::
|
|
12
|
-
Sprockets::SassCacheStore.new(context.environment)
|
|
13
|
-
else
|
|
10
|
+
cache_store =
|
|
11
|
+
if defined?(Sprockets::SassProcessor::CacheStore)
|
|
14
12
|
Sprockets::SassProcessor::CacheStore.new(sprockets_cache_store, context.environment)
|
|
13
|
+
else
|
|
14
|
+
Sprockets::SassCacheStore.new(context.environment)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
paths = context.environment.paths.map { |path| CompassRails::SpriteImporter.new(path) }
|
|
@@ -41,7 +41,7 @@ klass.class_eval do
|
|
|
41
41
|
context.depend_on(f)
|
|
42
42
|
end
|
|
43
43
|
else
|
|
44
|
-
context.depend_on(filename)
|
|
44
|
+
context.depend_on(filename) if File.exist?(filename)
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
@@ -79,14 +79,18 @@ klass.class_eval do
|
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
def sprockets_cache_store
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
cache =
|
|
83
|
+
case Rails.application.config.assets.cache_store
|
|
84
|
+
when :null_store
|
|
85
|
+
Sprockets::Cache::NullStore.new
|
|
86
|
+
when :memory_store, :mem_cache_store
|
|
87
|
+
Sprockets::Cache::MemoryStore.new
|
|
88
|
+
else
|
|
89
|
+
path = "#{Rails.application.config.root}/tmp/cache/assets/#{Rails.env}"
|
|
90
|
+
|
|
91
|
+
Sprockets::Cache::FileStore.new(path)
|
|
92
|
+
end
|
|
92
93
|
|
|
94
|
+
Sprockets::Cache.new(cache, Rails.logger)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -15,7 +15,7 @@ module CompassRails
|
|
|
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
|
|
18
|
-
pathname = context.resolve(relative_path)
|
|
18
|
+
pathname = context.resolve(relative_path.to_s)
|
|
19
19
|
context.depend_on_asset(pathname)
|
|
20
20
|
rescue Sprockets::FileNotFound
|
|
21
21
|
|
|
@@ -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,19 +25,24 @@ 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
|
+
if CompassRails.sprockets.respond_to?(:trail, true)
|
|
29
|
+
index = CompassRails.sprockets.send(:trail).index
|
|
30
|
+
else
|
|
31
|
+
index = CompassRails.sprockets.index
|
|
32
|
+
end
|
|
33
|
+
|
|
29
34
|
index.instance_variable_get(:@entries).delete(File.dirname(filename))
|
|
30
35
|
index.instance_variable_get(:@stats).delete(filename)
|
|
31
36
|
|
|
32
37
|
pathname = Pathname.new(filename)
|
|
33
|
-
logical_path = pathname.relative_path_from(Pathname.new(Compass.configuration.images_path))
|
|
34
|
-
asset =
|
|
38
|
+
logical_path = pathname.relative_path_from(Pathname.new(Compass.configuration.images_path)).to_s
|
|
39
|
+
asset = CompassRails.sprockets.find_asset(logical_path)
|
|
35
40
|
target = File.join(Rails.public_path, Rails.application.config.assets.prefix, asset.digest_path)
|
|
36
41
|
|
|
37
42
|
# Adds the asset to the manifest file.
|
|
38
43
|
|
|
39
44
|
manifest = ActionView::Base.assets_manifest
|
|
40
|
-
manifest.assets[logical_path
|
|
45
|
+
manifest.assets[logical_path] = asset.digest_path
|
|
41
46
|
|
|
42
47
|
|
|
43
48
|
# Adds the fingerprinted asset to the public directory
|
data/lib/compass-rails.rb
CHANGED
|
@@ -11,14 +11,21 @@ module CompassRails
|
|
|
11
11
|
|
|
12
12
|
def setup_fake_rails_env_paths(sprockets_env)
|
|
13
13
|
return unless rails_loaded?
|
|
14
|
+
|
|
15
|
+
if sprockets_env.respond_to?(:trail, true)
|
|
16
|
+
sprockets_trail = sprockets_env.send(:trail)
|
|
17
|
+
else
|
|
18
|
+
sprockets_trail = sprockets_env.index
|
|
19
|
+
end
|
|
20
|
+
|
|
14
21
|
keys = ['app/assets', 'lib/assets', 'vendor/assets']
|
|
15
22
|
local = keys.map {|path| ::Rails.root.join(path) }.map { |path| [File.join(path, 'images'), File.join(path, 'stylesheets')] }.flatten!
|
|
16
|
-
|
|
23
|
+
sprockets_trail.paths.unshift(*local)
|
|
17
24
|
paths = []
|
|
18
25
|
::Rails::Engine.subclasses.each do |subclass|
|
|
19
26
|
paths = subclass.paths
|
|
20
27
|
keys.each do |key|
|
|
21
|
-
|
|
28
|
+
sprockets_trail.paths.unshift(*paths[key].existent_directories)
|
|
22
29
|
end
|
|
23
30
|
end
|
|
24
31
|
end
|
|
@@ -28,14 +35,14 @@ module CompassRails
|
|
|
28
35
|
end
|
|
29
36
|
|
|
30
37
|
def sprockets
|
|
31
|
-
@sprockets ||=
|
|
38
|
+
@sprockets ||= Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)
|
|
32
39
|
end
|
|
33
40
|
|
|
34
41
|
def context
|
|
35
42
|
@context ||= begin
|
|
36
43
|
sprockets.version = ::Rails.env + "-#{sprockets.version}"
|
|
37
44
|
setup_fake_rails_env_paths(sprockets)
|
|
38
|
-
context = ::
|
|
45
|
+
context = ::CompassRails.sprockets.context_class
|
|
39
46
|
context.extend(::Sprockets::Helpers::IsolatedHelper)
|
|
40
47
|
context.extend(::Sprockets::Helpers::RailsHelper)
|
|
41
48
|
context.extend(::Sass::Rails::Railtie::SassContext)
|
|
@@ -118,4 +125,3 @@ if defined?(::Rails)
|
|
|
118
125
|
require "compass-rails/patches"
|
|
119
126
|
require "compass-rails/railties"
|
|
120
127
|
end
|
|
121
|
-
|
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
|
|
@@ -4,6 +4,9 @@ module CompassRails
|
|
|
4
4
|
include FileHelper
|
|
5
5
|
include DebugHelper
|
|
6
6
|
include CommandHelper
|
|
7
|
+
RAILS_5_2 = "5.2"
|
|
8
|
+
RAILS_5_1 = "5.1"
|
|
9
|
+
RAILS_5_0 = "5.0"
|
|
7
10
|
RAILS_4_2 = "4.2"
|
|
8
11
|
RAILS_4_0 = "4.0"
|
|
9
12
|
RAILS_3_2 = "3.2"
|
|
@@ -12,6 +15,9 @@ module CompassRails
|
|
|
12
15
|
WORKING_DIR = File.join(ROOT_PATH, 'rails-temp')
|
|
13
16
|
|
|
14
17
|
VERSION_LOOKUP = {
|
|
18
|
+
RAILS_5_2 => %r{^5\.2\.},
|
|
19
|
+
RAILS_5_1 => %r{^5\.1\.},
|
|
20
|
+
RAILS_5_0 => %r{^5\.0\.},
|
|
15
21
|
RAILS_4_2 => %r{^4\.2\.},
|
|
16
22
|
RAILS_4_0 => %r{^4\.0\.},
|
|
17
23
|
RAILS_3_2 => %r{^3\.2\.},
|
|
@@ -19,6 +25,9 @@ module CompassRails
|
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
GEMFILES = {
|
|
28
|
+
RAILS_5_2 => GEMFILES_DIR.join("rails_edge.gemfile").to_s,
|
|
29
|
+
RAILS_5_1 => GEMFILES_DIR.join("rails51.gemfile").to_s,
|
|
30
|
+
RAILS_5_0 => GEMFILES_DIR.join("rails50.gemfile").to_s,
|
|
22
31
|
RAILS_4_2 => GEMFILES_DIR.join("rails42.gemfile").to_s,
|
|
23
32
|
RAILS_4_0 => GEMFILES_DIR.join("rails40.gemfile").to_s,
|
|
24
33
|
RAILS_3_2 => GEMFILES_DIR.join("rails32.gemfile").to_s,
|
|
@@ -14,6 +14,7 @@ module CompassRails
|
|
|
14
14
|
def initialize(directory, version)
|
|
15
15
|
@directory = Pathname.new(directory)
|
|
16
16
|
@version = version
|
|
17
|
+
disable_cookies! if version == '3.1'
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
## FILE METHODS
|
|
@@ -71,6 +72,11 @@ module CompassRails
|
|
|
71
72
|
inject_into_file(directory.join(APPLICATION_FILE), value, :after, 'class Application < Rails::Application')
|
|
72
73
|
end
|
|
73
74
|
|
|
75
|
+
def disable_cookies!
|
|
76
|
+
value = "\n config.middleware.delete 'ActionDispatch::Session::CookieStore'\n"
|
|
77
|
+
inject_into_file(directory.join(APPLICATION_FILE), value, :after, 'class Application < Rails::Application')
|
|
78
|
+
end
|
|
79
|
+
|
|
74
80
|
end
|
|
75
81
|
end
|
|
76
82
|
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:
|
|
4
|
+
version: 3.1.0
|
|
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:
|
|
13
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: compass
|
|
@@ -32,14 +32,14 @@ dependencies:
|
|
|
32
32
|
requirements:
|
|
33
33
|
- - "<"
|
|
34
34
|
- !ruby/object:Gem::Version
|
|
35
|
-
version: '
|
|
35
|
+
version: '4.0'
|
|
36
36
|
type: :runtime
|
|
37
37
|
prerelease: false
|
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
39
39
|
requirements:
|
|
40
40
|
- - "<"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '
|
|
42
|
+
version: '4.0'
|
|
43
43
|
- !ruby/object:Gem::Dependency
|
|
44
44
|
name: sass-rails
|
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -77,6 +77,9 @@ files:
|
|
|
77
77
|
- gemfiles/rails32.gemfile
|
|
78
78
|
- gemfiles/rails40.gemfile
|
|
79
79
|
- gemfiles/rails42.gemfile
|
|
80
|
+
- gemfiles/rails50.gemfile
|
|
81
|
+
- gemfiles/rails51.gemfile
|
|
82
|
+
- gemfiles/rails_edge.gemfile
|
|
80
83
|
- lib/compass-rails.rb
|
|
81
84
|
- lib/compass-rails/configuration.rb
|
|
82
85
|
- lib/compass-rails/patches.rb
|
|
@@ -147,4 +150,3 @@ test_files:
|
|
|
147
150
|
- test/helpers/rails_helper.rb
|
|
148
151
|
- test/helpers/rails_project.rb
|
|
149
152
|
- test/test_helper.rb
|
|
150
|
-
has_rdoc:
|