compass-rails 2.0.5 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +17 -15
- data/Appraisals +16 -12
- data/CHANGELOG.md +12 -1
- data/Gemfile +2 -0
- data/README.md +9 -7
- data/Rakefile +4 -14
- data/compass-rails.gemspec +2 -2
- data/gemfiles/{rails42.gemfile → rails52.gemfile} +6 -4
- data/gemfiles/rails60.gemfile +21 -0
- data/gemfiles/rails_edge.gemfile +21 -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 -12
- data/test/helpers/rails_project.rb +6 -0
- metadata +8 -11
- data/gemfiles/rails31.gemfile +0 -18
- data/gemfiles/rails32.gemfile +0 -18
- data/gemfiles/rails40.gemfile +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 051e3425d85a8db3f1b3d76430f4523a905b19d51b3d29476188f18441fe315b
|
4
|
+
data.tar.gz: 30d80439765d7c6288c1f460ee1ad45d710bb690f3e8fda29bbd7c13039d7199
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be5c5939deedbe57b6c64e801cb69ef14947722de615a279e51e051f6b8efc063197fe72b26a97eb6036b31012d123762ad20f8409a78e30ebd113f62895ea1
|
7
|
+
data.tar.gz: 4b95ded34fbfeae63c2df0645b63e8452040046ec38e11e5601624764a70c9353829a88d210f4569110c04987530237829f6563347b141f5fd21ee116b49f1b9
|
data/.travis.yml
CHANGED
@@ -1,22 +1,24 @@
|
|
1
1
|
language: ruby
|
2
|
-
|
3
2
|
sudo: false
|
4
|
-
|
5
3
|
rvm:
|
6
|
-
-
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
- 2.
|
4
|
+
- 2.4.9
|
5
|
+
- 2.5.7
|
6
|
+
- 2.6.5
|
7
|
+
- 2.7.0
|
8
|
+
- ruby-head
|
10
9
|
- jruby-head
|
11
|
-
|
12
|
-
|
10
|
+
gemfile:
|
11
|
+
- gemfiles/rails52.gemfile
|
12
|
+
- gemfiles/rails60.gemfile
|
13
|
+
- gemfiles/rails_edge.gemfile
|
13
14
|
matrix:
|
15
|
+
exclude:
|
16
|
+
- rvm: 2.4.9
|
17
|
+
gemfile: gemfiles/rails60.gemfile
|
18
|
+
- rvm: 2.4.9
|
19
|
+
gemfile: gemfiles/rails_edge.gemfile
|
20
|
+
fast_finish: true
|
14
21
|
allow_failures:
|
22
|
+
- rvm: ruby-head
|
15
23
|
- rvm: jruby-head
|
16
|
-
-
|
17
|
-
|
18
|
-
gemfile:
|
19
|
-
- gemfiles/rails31.gemfile
|
20
|
-
- gemfiles/rails32.gemfile
|
21
|
-
- gemfiles/rails40.gemfile
|
22
|
-
- gemfiles/rails42.gemfile
|
24
|
+
- gemfile: gemfiles/rails_edge.gemfile
|
data/Appraisals
CHANGED
@@ -1,19 +1,23 @@
|
|
1
|
-
appraise "
|
2
|
-
gem "rails", "
|
3
|
-
gem "
|
1
|
+
appraise "rails52" do
|
2
|
+
gem "rails", "~> 5.2.0"
|
3
|
+
gem "sprockets", "< 4.0"
|
4
|
+
gem "sass-rails", "~> 5.0"
|
5
|
+
gem "bootsnap", require: false
|
4
6
|
end
|
5
7
|
|
6
|
-
appraise "
|
7
|
-
gem "rails", "~>
|
8
|
-
gem "
|
8
|
+
appraise "rails60" do
|
9
|
+
gem "rails", "~> 6.0.0"
|
10
|
+
gem "sprockets", "< 4.0"
|
11
|
+
gem "sass-rails", "~> 5.0"
|
12
|
+
gem "webpacker", "~> 4.0"
|
13
|
+
gem "bootsnap", ">= 1.4.2", require: false
|
9
14
|
end
|
10
15
|
|
11
|
-
appraise "
|
12
|
-
gem "rails",
|
13
|
-
gem "sass-rails"
|
14
|
-
end
|
16
|
+
appraise "rails_edge" do
|
17
|
+
gem "rails", github: "rails/rails"
|
15
18
|
|
16
|
-
|
17
|
-
gem "rails", "~> 4.2.0"
|
19
|
+
gem "sprockets", "< 4.0"
|
18
20
|
gem "sass-rails", "~> 5.0"
|
21
|
+
gem "webpacker", "~> 4.0"
|
22
|
+
gem "bootsnap", ">= 1.4.2", require: false
|
19
23
|
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
|
-
[![Build Status](https://travis-ci.org/Compass/compass-rails.
|
6
|
-
[![Code Climate](https://codeclimate.com/github/Compass/compass-rails.
|
7
|
+
[![Build Status](https://travis-ci.org/Compass/compass-rails.svg?branch=master)](https://travis-ci.org/Compass/compass-rails)
|
8
|
+
[![Code Climate](https://codeclimate.com/github/Compass/compass-rails.svg)](https://codeclimate.com/github/Compass/compass-rails)
|
7
9
|
[![Gem Version](https://badge.fury.io/rb/compass-rails.svg)](http://badge.fury.io/rb/compass-rails)
|
8
|
-
[![Coverage Status](https://coveralls.io/repos/Compass/compass-rails/badge.
|
10
|
+
[![Coverage Status](https://coveralls.io/repos/Compass/compass-rails/badge.svg)](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
|
17
|
+
Supports Rails 5.2 and 6.x releases.
|
16
18
|
|
17
19
|
## Installation
|
18
20
|
|
@@ -54,9 +56,9 @@ Use `application.css` to require files that use compass features. Ex:
|
|
54
56
|
|
55
57
|
### Configuration
|
56
58
|
|
57
|
-
Compass-rails is configured out of the box to work with Rails.
|
59
|
+
Compass-rails is configured out of the box to work with Rails.
|
58
60
|
|
59
|
-
Advanced users can choose to add a `config/compass.rb` and take advantage of the [Compass configuration
|
61
|
+
Advanced users can choose to add a `config/compass.rb` and take advantage of the [Compass configuration
|
60
62
|
reference](http://compass-style.org/help/documentation/configuration-reference/)
|
61
63
|
as is.
|
62
64
|
|
@@ -64,7 +66,7 @@ as is.
|
|
64
66
|
|
65
67
|
Step 1: Add it to your Gemfile and run the `bundle` command to install it.
|
66
68
|
|
67
|
-
Step 2: Install the extension's assets: `bundle exec compass install
|
69
|
+
Step 2: Install the extension's assets: `bundle exec compass install
|
68
70
|
<extension/template>`
|
69
71
|
|
70
72
|
For example, if you want to use susy.
|
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
|
@@ -2,12 +2,14 @@
|
|
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
|
-
gem "rails", "~>
|
9
|
+
gem "rails", "~> 5.2.0"
|
10
|
+
gem "sprockets", "< 4.0"
|
10
11
|
gem "sass-rails", "~> 5.0"
|
12
|
+
gem "bootsnap", require: false
|
11
13
|
|
12
14
|
group :test do
|
13
15
|
gem "mocha"
|
@@ -15,4 +17,4 @@ group :test do
|
|
15
17
|
gem "minitest"
|
16
18
|
end
|
17
19
|
|
18
|
-
gemspec :
|
20
|
+
gemspec path: "../"
|
@@ -0,0 +1,21 @@
|
|
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", "~> 6.0.0"
|
10
|
+
gem "sprockets", "< 4.0"
|
11
|
+
gem "sass-rails", "~> 5.0"
|
12
|
+
gem "webpacker", "~> 4.0"
|
13
|
+
gem "bootsnap", ">= 1.4.2", require: false
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem "mocha"
|
17
|
+
gem "appraisal"
|
18
|
+
gem "minitest"
|
19
|
+
end
|
20
|
+
|
21
|
+
gemspec path: "../"
|
@@ -0,0 +1,21 @@
|
|
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", git: "https://github.com/rails/rails.git"
|
10
|
+
gem "sprockets", "< 4.0"
|
11
|
+
gem "sass-rails", "~> 5.0"
|
12
|
+
gem "webpacker", "~> 4.0"
|
13
|
+
gem "bootsnap", ">= 1.4.2", require: false
|
14
|
+
|
15
|
+
group :test do
|
16
|
+
gem "mocha"
|
17
|
+
gem "appraisal"
|
18
|
+
gem "minitest"
|
19
|
+
end
|
20
|
+
|
21
|
+
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,25 +4,22 @@ module CompassRails
|
|
4
4
|
include FileHelper
|
5
5
|
include DebugHelper
|
6
6
|
include CommandHelper
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
RAILS_3_1 = "3.1"
|
7
|
+
RAILS_6_1 = "6.1"
|
8
|
+
RAILS_6_0 = "6.0"
|
9
|
+
RAILS_5_2 = "5.2"
|
11
10
|
|
12
11
|
WORKING_DIR = File.join(ROOT_PATH, 'rails-temp')
|
13
12
|
|
14
13
|
VERSION_LOOKUP = {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
RAILS_3_1 => %r{^3\.1\.},
|
14
|
+
RAILS_6_1 => %r{^6\.1\.},
|
15
|
+
RAILS_6_0 => %r{^6\.0\.},
|
16
|
+
RAILS_5_2 => %r{^5\.2\.},
|
19
17
|
}
|
20
18
|
|
21
19
|
GEMFILES = {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
RAILS_3_1 => GEMFILES_DIR.join("rails31.gemfile").to_s
|
20
|
+
RAILS_6_1 => GEMFILES_DIR.join("rails_edge.gemfile").to_s,
|
21
|
+
RAILS_6_0 => GEMFILES_DIR.join("rails60.gemfile").to_s,
|
22
|
+
RAILS_5_2 => GEMFILES_DIR.join("rails52.gemfile").to_s,
|
26
23
|
}
|
27
24
|
|
28
25
|
GENERATOR_OPTIONS = ['-q', '-G', '-O', '--skip-bundle']
|
@@ -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: 4.0.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: 2020-02-18 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
|
@@ -73,10 +73,9 @@ files:
|
|
73
73
|
- README.md
|
74
74
|
- Rakefile
|
75
75
|
- compass-rails.gemspec
|
76
|
-
- gemfiles/
|
77
|
-
- gemfiles/
|
78
|
-
- gemfiles/
|
79
|
-
- gemfiles/rails42.gemfile
|
76
|
+
- gemfiles/rails52.gemfile
|
77
|
+
- gemfiles/rails60.gemfile
|
78
|
+
- gemfiles/rails_edge.gemfile
|
80
79
|
- lib/compass-rails.rb
|
81
80
|
- lib/compass-rails/configuration.rb
|
82
81
|
- lib/compass-rails/patches.rb
|
@@ -126,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
125
|
- !ruby/object:Gem::Version
|
127
126
|
version: '0'
|
128
127
|
requirements: []
|
129
|
-
|
130
|
-
rubygems_version: 2.2.2
|
128
|
+
rubygems_version: 3.0.3
|
131
129
|
signing_key:
|
132
130
|
specification_version: 4
|
133
131
|
summary: Integrate Compass into Rails 3.0 and up.
|
@@ -147,4 +145,3 @@ test_files:
|
|
147
145
|
- test/helpers/rails_helper.rb
|
148
146
|
- test/helpers/rails_project.rb
|
149
147
|
- test/test_helper.rb
|
150
|
-
has_rdoc:
|
data/gemfiles/rails31.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
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", "3.1.3"
|
10
|
-
gem "sass-rails"
|
11
|
-
|
12
|
-
group :test do
|
13
|
-
gem "mocha"
|
14
|
-
gem "appraisal"
|
15
|
-
gem "minitest"
|
16
|
-
end
|
17
|
-
|
18
|
-
gemspec :path => "../"
|
data/gemfiles/rails32.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
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", "~> 3.2"
|
10
|
-
gem "sass-rails"
|
11
|
-
|
12
|
-
group :test do
|
13
|
-
gem "mocha"
|
14
|
-
gem "appraisal"
|
15
|
-
gem "minitest"
|
16
|
-
end
|
17
|
-
|
18
|
-
gemspec :path => "../"
|
data/gemfiles/rails40.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
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", "~> 4.0.0"
|
10
|
-
gem "sass-rails"
|
11
|
-
|
12
|
-
group :test do
|
13
|
-
gem "mocha"
|
14
|
-
gem "appraisal"
|
15
|
-
gem "minitest"
|
16
|
-
end
|
17
|
-
|
18
|
-
gemspec :path => "../"
|