compass-rails 2.0.0 → 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/.gitignore +1 -0
- data/.travis.yml +34 -4
- data/Appraisals +30 -0
- data/CHANGELOG.md +82 -0
- data/Gemfile +3 -8
- data/README.md +13 -11
- data/Rakefile +4 -23
- data/compass-rails.gemspec +3 -2
- data/gemfiles/rails31.gemfile +6 -10
- data/gemfiles/rails32.gemfile +6 -10
- data/gemfiles/rails40.gemfile +6 -10
- data/gemfiles/rails42.gemfile +19 -0
- data/gemfiles/rails50.gemfile +19 -0
- data/gemfiles/rails51.gemfile +19 -0
- data/gemfiles/rails_edge.gemfile +22 -0
- data/lib/compass-rails/patches/3_1.rb +3 -12
- data/lib/compass-rails/patches/4_0.rb +23 -29
- data/lib/compass-rails/patches/compass.rb +3 -3
- data/lib/compass-rails/patches/importer.rb +10 -12
- data/lib/compass-rails/patches/sass_importer.rb +67 -7
- data/lib/compass-rails/patches/sprite_importer.rb +4 -4
- data/lib/compass-rails/patches.rb +0 -3
- data/lib/compass-rails/railties/3_1.rb +5 -12
- data/lib/compass-rails/railties/4_0.rb +11 -9
- data/lib/compass-rails/railties.rb +1 -3
- data/lib/compass-rails/version.rb +1 -3
- data/lib/compass-rails.rb +16 -125
- data/test/compass_rails_spec.rb +58 -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/images/numbers/sprite-1.png +0 -0
- data/test/fixtures/assets/images/numbers/sprite-2.png +0 -0
- data/test/fixtures/assets/stylesheets/application.css.scss +23 -0
- data/test/fixtures/assets/stylesheets/partials/_partial_1.scss +3 -0
- data/test/fixtures/assets/stylesheets/partials/_partial_2.scss +3 -0
- data/test/helpers/command_helper.rb +2 -15
- data/test/helpers/debug_helper.rb +1 -1
- data/test/helpers/file_helper.rb +2 -17
- data/test/helpers/rails_helper.rb +43 -32
- data/test/helpers/rails_project.rb +30 -70
- data/test/test_helper.rb +8 -3
- metadata +55 -19
- data/changelog.markdown +0 -11
- data/lib/compass-rails/installer.rb +0 -30
- data/test/integrations/.gitkeep +0 -0
- data/test/integrations/rails_31_test.rb +0 -46
- data/test/integrations/rails_32_test.rb +0 -46
- data/test/integrations/rails_40_test.rb +0 -46
- data/test/units/.gitkeep +0 -0
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/.gitignore
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
+
language: ruby
|
|
2
|
+
sudo: false
|
|
1
3
|
rvm:
|
|
2
|
-
-
|
|
3
|
-
- 2.
|
|
4
|
-
- 2.
|
|
5
|
-
|
|
4
|
+
- 2.2.4
|
|
5
|
+
- 2.3.0
|
|
6
|
+
- 2.4.0
|
|
7
|
+
- ruby-head
|
|
8
|
+
- jruby-head
|
|
9
|
+
gemfile:
|
|
10
|
+
- gemfiles/rails31.gemfile
|
|
11
|
+
- gemfiles/rails32.gemfile
|
|
12
|
+
- gemfiles/rails40.gemfile
|
|
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,14 +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
|
|
18
|
+
|
|
19
|
+
appraise "rails42" do
|
|
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"
|
|
43
|
+
gem "sass-rails", "~> 5.0"
|
|
44
|
+
end
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Change log
|
|
2
|
+
|
|
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.
|
|
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
|
|
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
|
|
17
|
+
- Support up to sass-rails 5.0.1. Issue #198
|
|
18
|
+
- Fix sass_importer patches having incorrect method signatures. Issue #195
|
|
19
|
+
- Fixed incorrect path generation for sprites in Rails 4. Issue #190
|
|
20
|
+
|
|
21
|
+
## 2.0.0 - 2014-07-10
|
|
22
|
+
### Added
|
|
23
|
+
- Support for Rails 4.2
|
|
24
|
+
- Allow newer sass-rails with Sass 3.3 support (see #160).
|
|
25
|
+
|
|
26
|
+
### Removed
|
|
27
|
+
- Rails 3.0 support.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- Properly bust the cache on image sprites within a sub-directory that
|
|
31
|
+
are imported with a wildcard (see #166).
|
|
32
|
+
|
|
33
|
+
## 1.1.7 - 2014-03-18
|
|
34
|
+
### Fixed
|
|
35
|
+
- Locked Sprockets version to 2.11.0 (see #146).
|
|
36
|
+
|
|
37
|
+
## 1.1.6 - 2014-03-11
|
|
38
|
+
### Fixed
|
|
39
|
+
- Leave bundle selection to rails environment.
|
|
40
|
+
|
|
41
|
+
## 1.1.5 - 2014-03-11
|
|
42
|
+
### Added
|
|
43
|
+
- Support for Ruby 2.1.0.
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
- Fixed `rails_loaded?` for when Rails is defined but no application is actually loaded.
|
|
47
|
+
|
|
48
|
+
## 1.1.4 - 2014-03-18
|
|
49
|
+
### Changed
|
|
50
|
+
- Simplified README.
|
|
51
|
+
|
|
52
|
+
## 1.1.3 - 2013-12-27
|
|
53
|
+
### Fixed
|
|
54
|
+
- No longer assuming asset pipeline is running when generating sprites.
|
|
55
|
+
|
|
56
|
+
## 1.1.2 - 2013-12-06
|
|
57
|
+
### Fixed
|
|
58
|
+
- Reverted fix for `generated_image_url` introduced in 1.1.0.
|
|
59
|
+
|
|
60
|
+
## 1.1.1 - 2013-12-05
|
|
61
|
+
### Added
|
|
62
|
+
- Support for Compass versions greater than 0.12.2.
|
|
63
|
+
|
|
64
|
+
## 1.1.0 - 2013-12-05
|
|
65
|
+
### Added
|
|
66
|
+
- Rails 4 support.
|
|
67
|
+
- Ruby 2.0 support.
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
- Allow compass-rails without asset pipeline on Rails 3.2.
|
|
71
|
+
- Fix `generated_image_url` when `generated_images_dir` is set.
|
|
72
|
+
|
|
73
|
+
### Removed
|
|
74
|
+
- Support for Ruby 1.8.7 and 1.9.2.
|
|
75
|
+
- Support for Rails 2.3.
|
|
76
|
+
|
|
77
|
+
## 1.0.3 - 2012-06-26
|
|
78
|
+
### Added
|
|
79
|
+
- Bumped Compass version to 0.12.2.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
- `FixedStaticCompiler` hack so sprite source files dont show up in manifest.
|
data/Gemfile
CHANGED
|
@@ -3,16 +3,10 @@ source 'https://rubygems.org'
|
|
|
3
3
|
# Specify your gem's dependencies in compass-rails.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
-
group :assets do
|
|
7
|
-
gem "compass", '~> 0.13.alpha.0'
|
|
8
|
-
gem "compass-rails", :path=>"."
|
|
9
|
-
gem 'compass-blueprint'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
6
|
group :test do
|
|
13
7
|
gem 'mocha'
|
|
14
|
-
gem
|
|
15
|
-
gem '
|
|
8
|
+
gem 'appraisal'
|
|
9
|
+
gem 'minitest'
|
|
16
10
|
end
|
|
17
11
|
|
|
18
12
|
unless ENV["CI"]
|
|
@@ -21,3 +15,4 @@ unless ENV["CI"]
|
|
|
21
15
|
gem 'guard'
|
|
22
16
|
gem 'guard-test'
|
|
23
17
|
end
|
|
18
|
+
|
data/README.md
CHANGED
|
@@ -1,16 +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)
|
|
9
|
+
[](http://badge.fury.io/rb/compass-rails)
|
|
10
|
+
[](https://coveralls.io/r/Compass/compass-rails)
|
|
7
11
|
|
|
8
12
|
Compass rails is an adapter for the [Compass Stylesheet Authoring
|
|
9
13
|
Framework](http://compass-style.org) for [Ruby on Rails](http://rubyonrails.org/).
|
|
10
14
|
|
|
11
15
|
Since Compass v0.12.0, this is the only way to use compass with your rails application.
|
|
12
16
|
|
|
13
|
-
Supports Rails 3.2, 4.x releases.
|
|
17
|
+
Supports Rails 3.2, 4.x and 5.x releases.
|
|
14
18
|
|
|
15
19
|
## Installation
|
|
16
20
|
|
|
@@ -52,13 +56,11 @@ Use `application.css` to require files that use compass features. Ex:
|
|
|
52
56
|
|
|
53
57
|
### Configuration
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
options explained there will be methods and properties on the `config.compass`
|
|
61
|
-
configuration object exposed to rails within any configuration block.
|
|
59
|
+
Compass-rails is configured out of the box to work with Rails.
|
|
60
|
+
|
|
61
|
+
Advanced users can choose to add a `config/compass.rb` and take advantage of the [Compass configuration
|
|
62
|
+
reference](http://compass-style.org/help/documentation/configuration-reference/)
|
|
63
|
+
as is.
|
|
62
64
|
|
|
63
65
|
### Installing Compass extensions
|
|
64
66
|
|
|
@@ -72,7 +74,7 @@ For example, if you want to use susy.
|
|
|
72
74
|
```ruby
|
|
73
75
|
# Gemfile
|
|
74
76
|
gem 'compass-rails'
|
|
75
|
-
gem '
|
|
77
|
+
gem 'susy'
|
|
76
78
|
```
|
|
77
79
|
|
|
78
80
|
then run:
|
data/Rakefile
CHANGED
|
@@ -1,34 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env rake
|
|
2
|
-
require '
|
|
3
|
-
require 'bundler'
|
|
4
|
-
Bundler.setup
|
|
5
|
-
require 'rake/dsl_definition' rescue nil
|
|
6
|
-
|
|
7
|
-
require "bundler/gem_tasks"
|
|
8
|
-
require 'appraisal'
|
|
9
|
-
require 'compass'
|
|
10
|
-
|
|
11
|
-
# ----- Default: Testing ------
|
|
12
|
-
|
|
13
|
-
task :default => [:test, :features]
|
|
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
|
-
test_files = FileList['test/**/*
|
|
9
|
+
test_files = FileList['test/**/*_{test,spec}.rb']
|
|
22
10
|
test_files.exclude('test/rails/*', 'test/haml/*')
|
|
23
11
|
t.test_files = test_files
|
|
24
12
|
t.verbose = true
|
|
25
13
|
end
|
|
26
14
|
|
|
27
|
-
|
|
28
|
-
t.libs << 'lib'
|
|
29
|
-
t.libs << 'test'
|
|
30
|
-
test_files = FileList['test/units/**/*_test.rb']
|
|
31
|
-
test_files.exclude('test/rails/*', 'test/haml/*')
|
|
32
|
-
t.test_files = test_files
|
|
33
|
-
t.verbose = true
|
|
34
|
-
end
|
|
15
|
+
task :default => [:test]
|
data/compass-rails.gemspec
CHANGED
|
@@ -16,6 +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
|
-
|
|
19
|
+
gem.add_dependency 'compass', '~> 1.0.0'
|
|
20
|
+
gem.add_dependency 'sprockets', '< 4.0'
|
|
21
|
+
gem.add_dependency 'sass-rails', '< 5.1'
|
|
21
22
|
end
|
data/gemfiles/rails31.gemfile
CHANGED
|
@@ -2,22 +2,18 @@
|
|
|
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
|
-
group :assets do
|
|
13
|
-
gem "compass", "~> 0.13.alpha.0"
|
|
14
|
-
gem "compass-rails", :path=>".."
|
|
15
|
-
gem "compass-blueprint"
|
|
16
|
-
end
|
|
17
13
|
group :test do
|
|
18
14
|
gem "mocha"
|
|
19
|
-
gem "appraisal"
|
|
20
|
-
gem "
|
|
15
|
+
gem "appraisal"
|
|
16
|
+
gem "minitest"
|
|
21
17
|
end
|
|
22
18
|
|
|
23
|
-
gemspec :
|
|
19
|
+
gemspec path: "../"
|
data/gemfiles/rails32.gemfile
CHANGED
|
@@ -2,22 +2,18 @@
|
|
|
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
|
-
group :assets do
|
|
13
|
-
gem "compass", "~> 0.13.alpha.0"
|
|
14
|
-
gem "compass-rails", :path=>".."
|
|
15
|
-
gem "compass-blueprint"
|
|
16
|
-
end
|
|
17
13
|
group :test do
|
|
18
14
|
gem "mocha"
|
|
19
|
-
gem "appraisal"
|
|
20
|
-
gem "
|
|
15
|
+
gem "appraisal"
|
|
16
|
+
gem "minitest"
|
|
21
17
|
end
|
|
22
18
|
|
|
23
|
-
gemspec :
|
|
19
|
+
gemspec path: "../"
|
data/gemfiles/rails40.gemfile
CHANGED
|
@@ -2,22 +2,18 @@
|
|
|
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
|
-
group :assets do
|
|
13
|
-
gem "compass", "~> 0.13.alpha.0"
|
|
14
|
-
gem "compass-rails", :path=>".."
|
|
15
|
-
gem "compass-blueprint"
|
|
16
|
-
end
|
|
17
13
|
group :test do
|
|
18
14
|
gem "mocha"
|
|
19
|
-
gem "appraisal"
|
|
20
|
-
gem "
|
|
15
|
+
gem "appraisal"
|
|
16
|
+
gem "minitest"
|
|
21
17
|
end
|
|
22
18
|
|
|
23
|
-
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", "~> 4.2.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.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: "../"
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
require 'compass-rails/patches/compass'
|
|
2
2
|
require 'compass-rails/patches/static_compiler'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
def generated_image_url(path,
|
|
6
|
-
asset_url(path, Sass::Script::String.new(
|
|
4
|
+
Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl.module_eval do
|
|
5
|
+
def generated_image_url(path, cache_buster = Sass::Script::Bool.new(false))
|
|
6
|
+
asset_url(path, Sass::Script::String.new('image'))
|
|
7
7
|
end
|
|
8
8
|
end
|
|
9
|
-
|
|
10
|
-
module Sass::Script::Functions
|
|
11
|
-
include Compass::RailsImageFunctionPatch
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
|
|
15
|
-
class Sass::Script::Functions::EvaluationContext
|
|
16
|
-
include Sass::Script::Functions
|
|
17
|
-
end
|
|
@@ -2,44 +2,38 @@ require 'compass-rails/patches/compass'
|
|
|
2
2
|
require 'compass-rails/patches/sass_importer'
|
|
3
3
|
require 'compass-rails/patches/sprite_importer'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
def generated_image_url(path,
|
|
7
|
-
|
|
8
|
-
subdirectory = pathobject.dirname.to_s
|
|
9
|
-
|
|
10
|
-
cachebust_generated_images(path, subdirectory)
|
|
5
|
+
Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl.module_eval do
|
|
6
|
+
def generated_image_url(path, cache_buster = Sass::Script::Bool.new(false))
|
|
7
|
+
cachebust_generated_images(path)
|
|
11
8
|
asset_url(path)
|
|
12
9
|
end
|
|
13
10
|
|
|
14
|
-
def cachebust_generated_images(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
def cachebust_generated_images(path)
|
|
12
|
+
generated_images_dir = Compass.configuration.generated_images_dir
|
|
13
|
+
generated_images_dir = Rails.root.join(generated_images_dir)
|
|
14
|
+
|
|
15
|
+
sprockets_env = options[:sprockets][:environment]
|
|
16
|
+
|
|
17
|
+
if sprockets_env.respond_to?(:trail, true)
|
|
18
|
+
sprockets_trail = sprockets_env.send(:trail)
|
|
18
19
|
else
|
|
19
|
-
|
|
20
|
+
sprockets_trail = sprockets_env.index
|
|
20
21
|
end
|
|
21
|
-
bust_image_stat_path = generated_images_path + "/" + image_path.to_s
|
|
22
22
|
|
|
23
|
-
sprockets_entries =
|
|
23
|
+
sprockets_entries = sprockets_trail.instance_variable_get(:@entries) || {}
|
|
24
|
+
sprockets_stats = sprockets_trail.instance_variable_get(:@stats) || {}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
if sprockets_entries.key?(generated_images_dir.to_s)
|
|
27
|
+
path = path.value
|
|
28
|
+
dir = File.dirname(path)
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
# Delete the entries (directories) which cache the files/dirs in a directory
|
|
31
|
+
entry = generated_images_dir.join(dir).to_s
|
|
32
|
+
sprockets_entries.delete(entry)
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
# Delete the stats (file/dir info) which cache the what kind of file/dir each image is
|
|
35
|
+
stat = generated_images_dir.join(path).to_s
|
|
36
|
+
sprockets_stats.delete(stat)
|
|
34
37
|
end
|
|
35
38
|
end
|
|
36
39
|
end
|
|
37
|
-
|
|
38
|
-
module Sass::Script::Functions
|
|
39
|
-
include Compass::RailsImageFunctionPatch
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
|
|
43
|
-
class Sass::Script::Functions::EvaluationContext
|
|
44
|
-
include Sass::Script::Functions
|
|
45
|
-
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
Compass::Core::SassExtensions::Functions::ImageSize.class_eval do
|
|
2
2
|
private
|
|
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
|
|
@@ -4,18 +4,16 @@ module Compass
|
|
|
4
4
|
attr_accessor :sass_options
|
|
5
5
|
STYLESHEET = /stylesheet/
|
|
6
6
|
def sass_options
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@sass_options[:load_paths] << ::Sass::Rails::Importer.new(context)
|
|
18
|
-
end
|
|
7
|
+
@sass_options[:custom] ||= {}
|
|
8
|
+
@sass_options[:custom] = {:resolver => ::Sass::Rails::Resolver.new(CompassRails.context)}
|
|
9
|
+
@sass_options[:load_paths] ||= []
|
|
10
|
+
unless @sass_options[:load_paths].any? {|k| k.is_a?(::Sass::Rails::Importer) }
|
|
11
|
+
::CompassRails.sprockets.paths.each do |path|
|
|
12
|
+
next unless path.to_s =~ STYLESHEET
|
|
13
|
+
Dir["#{path}/**/*"].each do |pathname|
|
|
14
|
+
# args are: sprockets environment, the logical_path ex. 'stylesheets', and the full path name for the render
|
|
15
|
+
context = ::CompassRails.context.new(::CompassRails.sprockets, File.basename(path), Pathname.new(pathname))
|
|
16
|
+
@sass_options[:load_paths] << ::Sass::Rails::Importer.new(context)
|
|
19
17
|
end
|
|
20
18
|
end
|
|
21
19
|
end
|