compass-rails 2.0.5 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e22b7b8fa47ae1f434e67a5df4072339d0d35cb
4
- data.tar.gz: d56d0e16a200bc8fdd45dd82eaf7fa4a573adbae
3
+ metadata.gz: c832d7ff0b8ead7078794b00ebb92f06c9b39c66
4
+ data.tar.gz: 6c8f5d59ba1a4ce114ba2a0dd9b12a5c17582b15
5
5
  SHA512:
6
- metadata.gz: ef6b6a3aa8254ef499dd9ae778fbef9009faf64711187dffafc53d513447883731e0b1ce338af06f3d6345e40e4b46ee8b4db12641d04023a02c540a8480d6ed
7
- data.tar.gz: cb3124eae3b8a7977d2c50c532f277a7573ca0de55d8990034c98d57045eee34b74cfa3bfbb9fb582f6081094a5305f4e556b963a91334744677f136be7051b0
6
+ metadata.gz: e9126f0cd8877d5fb4252e402535994306c3beae1b324c7acb4777e6921eece4bb04d7da9bc36f68bbc17b3a6e8919902c0b869127000cc0ffc6812a05f9ea8f
7
+ data.tar.gz: 3b1a7de4da19c7ebcee67bae8e0967af771a753c21712f9662c96c43f765d3c3711b618f84cbce7d3c97ecc34be33c2c31e78bea0ab9cc8f72db0c2520393c63
@@ -1,22 +1,28 @@
1
1
  language: ruby
2
-
3
2
  sudo: false
4
-
5
3
  rvm:
6
- - 1.9.3
4
+ - 1.9
7
5
  - 2.0
8
6
  - 2.1
9
- - 2.2
7
+ - 2.2.4
8
+ - 2.3.0
9
+ - ruby-head
10
10
  - 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
11
  gemfile:
19
12
  - gemfiles/rails31.gemfile
20
13
  - gemfiles/rails32.gemfile
21
14
  - gemfiles/rails40.gemfile
22
15
  - gemfiles/rails42.gemfile
16
+ - gemfiles/rails50.gemfile
17
+ matrix:
18
+ fast_finish: true
19
+ exclude:
20
+ - gemfile: gemfiles/rails50.gemfile
21
+ rvm: 1.9
22
+ - gemfile: gemfiles/rails50.gemfile
23
+ rvm: 2.0
24
+ - gemfile: gemfiles/rails50.gemfile
25
+ rvm: 2.1
26
+ allow_failures:
27
+ - rvm: ruby-head
28
+ - rvm: jruby-head
data/Appraisals CHANGED
@@ -1,19 +1,29 @@
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", "< 2.13"
22
+ gem "sass-rails", "~> 5.0"
23
+ end
24
+
25
+ appraise "rails50" do
26
+ gem "rails", ">= 5.0.0.alpha", "< 5.1"
27
+ gem "sprockets", "< 4.0"
18
28
  gem "sass-rails", "~> 5.0"
19
29
  end
@@ -1,7 +1,14 @@
1
1
  # Change log
2
2
 
3
- ## 2.0.2 - 2015-01-03
3
+ ## 3.0.0 - Unreleased
4
+ ### Added
5
+ - Added Sprockets 3 support. Issue #232, #236, #244.
6
+
7
+ ### Fixed
8
+ - Sprockets cache files are no longer saved to /tmp and now use the app-level tmp folder instead.
4
9
 
10
+ ## 2.0.2 - 2015-01-03
11
+ ### Fixed
5
12
  - 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
13
  - Support up to sass-rails 5.0.1. Issue #198
7
14
  - Fix sass_importer patches having incorrect method signatures. Issue #195
data/Gemfile CHANGED
@@ -15,3 +15,4 @@ unless ENV["CI"]
15
15
  gem 'guard'
16
16
  gem 'guard-test'
17
17
  end
18
+
data/Rakefile CHANGED
@@ -1,21 +1,9 @@
1
1
  #!/usr/bin/env rake
2
- require 'rubygems'
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]
@@ -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', '~> 1.0.0'
20
- gem.add_dependency 'sprockets', '< 2.13'
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
@@ -7,6 +7,7 @@ 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
@@ -7,6 +7,7 @@ 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
@@ -7,6 +7,7 @@ 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
@@ -7,6 +7,7 @@ gem "ruby_gntp", :require => false
7
7
  gem "guard"
8
8
  gem "guard-test"
9
9
  gem "rails", "~> 4.2.0"
10
+ gem "sprockets", "< 2.13"
10
11
  gem "sass-rails", "~> 5.0"
11
12
 
12
13
  group :test do
@@ -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.alpha", "< 5.1"
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 => "../"
@@ -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
- sprockets_env.send(:trail).paths.unshift(*local)
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
- sprockets_env.send(:trail).paths.unshift(*paths[key].existent_directories)
28
+ sprockets_trail.paths.unshift(*paths[key].existent_directories)
22
29
  end
23
30
  end
24
31
  end
@@ -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 = options[:sprockets][:environment]
16
- sprockets_trail = sprockets_env.send(:trail)
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
 
@@ -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::SassCacheStore)
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) }
@@ -79,14 +79,18 @@ klass.class_eval do
79
79
  end
80
80
 
81
81
  def sprockets_cache_store
82
- case Rails.application.config.assets.cache_store
83
- when :null_store
84
- Sprockets::Cache::NullStore.new
85
- when :memory_store, :mem_cache_store
86
- Sprockets::Cache::MemoryStore.new
87
- else
88
- Sprockets::Cache::FileStore.new(Dir::tmpdir)
89
- end
90
- end
91
- end
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,7 +25,12 @@ 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
- index = Rails.application.assets.send(:trail).index
28
+ if Rails.application.assets.respond_to?(:trail, true)
29
+ index = Rails.application.assets.send(:trail).index
30
+ else
31
+ index = Rails.application.assets.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
 
@@ -1,5 +1,3 @@
1
1
  module CompassRails
2
- unless defined?(::CompassRails::VERSION)
3
- VERSION = "2.0.5"
4
- end
2
+ VERSION = '3.0.0' unless defined?(::CompassRails::VERSION)
5
3
  end
@@ -4,6 +4,7 @@ module CompassRails
4
4
  include FileHelper
5
5
  include DebugHelper
6
6
  include CommandHelper
7
+ RAILS_5_0 = "5.0"
7
8
  RAILS_4_2 = "4.2"
8
9
  RAILS_4_0 = "4.0"
9
10
  RAILS_3_2 = "3.2"
@@ -12,6 +13,7 @@ module CompassRails
12
13
  WORKING_DIR = File.join(ROOT_PATH, 'rails-temp')
13
14
 
14
15
  VERSION_LOOKUP = {
16
+ RAILS_5_0 => %r{^5\.0\.},
15
17
  RAILS_4_2 => %r{^4\.2\.},
16
18
  RAILS_4_0 => %r{^4\.0\.},
17
19
  RAILS_3_2 => %r{^3\.2\.},
@@ -19,6 +21,7 @@ module CompassRails
19
21
  }
20
22
 
21
23
  GEMFILES = {
24
+ RAILS_5_0 => GEMFILES_DIR.join("rails50.gemfile").to_s,
22
25
  RAILS_4_2 => GEMFILES_DIR.join("rails42.gemfile").to_s,
23
26
  RAILS_4_0 => GEMFILES_DIR.join("rails40.gemfile").to_s,
24
27
  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: 2.0.5
4
+ version: 3.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: 2015-08-15 00:00:00.000000000 Z
13
+ date: 2016-01-23 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: '2.13'
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: '2.13'
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,7 @@ files:
77
77
  - gemfiles/rails32.gemfile
78
78
  - gemfiles/rails40.gemfile
79
79
  - gemfiles/rails42.gemfile
80
+ - gemfiles/rails50.gemfile
80
81
  - lib/compass-rails.rb
81
82
  - lib/compass-rails/configuration.rb
82
83
  - lib/compass-rails/patches.rb