[DRE-commits] [ruby-compass-rails] 02/02: add sprockets 3 support

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Fri Jan 8 07:50:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository ruby-compass-rails.

commit 792ade4618dee15531d4dd47a11456b4627e8a8b
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Fri Jan 8 13:17:12 2016 +0530

    add sprockets 3 support
---
 debian/changelog                         |   7 ++
 debian/patches/series                    |   1 +
 debian/patches/sprockets-3-support.patch | 163 +++++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3ede782..5329f22 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ruby-compass-rails (2.0.5-5) unstable; urgency=medium
+
+  * Add sprockets 3 support (add patch from upstream master branch)
+    (Closes: #810162)
+
+ -- Pirate Praveen <praveen at debian.org>  Fri, 08 Jan 2016 13:16:14 +0530
+
 ruby-compass-rails (2.0.5-4) unstable; urgency=medium
 
   * Remove relax-sprockets-version.patch (not enough, see #810162)  
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0ac6467
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+sprockets-3-support.patch
diff --git a/debian/patches/sprockets-3-support.patch b/debian/patches/sprockets-3-support.patch
new file mode 100644
index 0000000..e7a57be
--- /dev/null
+++ b/debian/patches/sprockets-3-support.patch
@@ -0,0 +1,163 @@
+Note: Version bump is skipped.
+
+From f9b9bf58b6490e16087f4cd7265426f474bc4aee Mon Sep 17 00:00:00 2001
+From: Rob Kilby <rob.kilby at smithelectric.com>
+Date: Tue, 25 Aug 2015 13:22:17 +0100
+Subject: [PATCH 1/9] Version bump
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Based on #236, I’m bumping the version to 3.0.0
+---
+Index: ruby-compass-rails/compass-rails.gemspec
+===================================================================
+--- ruby-compass-rails.orig/compass-rails.gemspec
++++ ruby-compass-rails/compass-rails.gemspec
+@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
+   gem.version       = CompassRails::VERSION
+   gem.license       = "MIT"
+ 
+-  gem.add_dependency 'compass', '~> 1.0.0'
+-  gem.add_dependency 'sprockets', '< 2.13'
++  gem.add_dependency 'compass'   , '~> 1.0.0'
++  gem.add_dependency 'sprockets' , '< 4.0'
+   gem.add_dependency 'sass-rails', '< 5.1'
+ end
+Index: ruby-compass-rails/lib/compass-rails/patches/sass_importer.rb
+===================================================================
+--- ruby-compass-rails.orig/lib/compass-rails/patches/sass_importer.rb
++++ ruby-compass-rails/lib/compass-rails/patches/sass_importer.rb
+@@ -7,11 +7,11 @@ end
+ klass.class_eval do
+   def evaluate(context, locals, &block)
+     # Use custom importer that knows about Sprockets Caching
+-    cache_store = 
+-      if defined?(Sprockets::SassCacheStore)
+-        Sprockets::SassCacheStore.new(context.environment)
+-      else
++    cache_store =
++      if defined?(Sprockets::SassProcessor::CacheStore)
+         Sprockets::SassProcessor::CacheStore.new(sprockets_cache_store, context.environment)
++      else
++        Sprockets::SassCacheStore.new(context.environment)
+       end
+ 
+     paths  = context.environment.paths.map { |path| CompassRails::SpriteImporter.new(path) }
+@@ -79,14 +79,18 @@ klass.class_eval do
+   end
+ 
+   def sprockets_cache_store
+-    case Rails.application.config.assets.cache_store
+-    when :null_store
+-      Sprockets::Cache::NullStore.new
+-    when :memory_store, :mem_cache_store
+-      Sprockets::Cache::MemoryStore.new
+-    else
+-      Sprockets::Cache::FileStore.new(Dir::tmpdir)
+-    end
+-  end
+-end    
++    cache =
++      case Rails.application.config.assets.cache_store
++      when :null_store
++        Sprockets::Cache::NullStore.new
++      when :memory_store, :mem_cache_store
++        Sprockets::Cache::MemoryStore.new
++      else
++        path = "#{Rails.application.config.root}/tmp/cache/assets/#{Rails.env}"
+ 
++        Sprockets::Cache::FileStore.new(path)
++      end
++
++    Sprockets::Cache.new(cache, Rails.logger)
++  end
++end
+Index: ruby-compass-rails/lib/compass-rails.rb
+===================================================================
+--- ruby-compass-rails.orig/lib/compass-rails.rb
++++ ruby-compass-rails/lib/compass-rails.rb
+@@ -11,14 +11,21 @@ module CompassRails
+ 
+     def setup_fake_rails_env_paths(sprockets_env)
+       return unless rails_loaded?
++
++      if sprockets_env.respond_to?(:trail, true)
++        sprockets_trail = sprockets_env.send(:trail)
++      else
++        sprockets_trail = sprockets_env.index
++      end
++
+       keys = ['app/assets', 'lib/assets', 'vendor/assets']
+       local = keys.map {|path| ::Rails.root.join(path) }.map { |path| [File.join(path, 'images'), File.join(path, 'stylesheets')] }.flatten!
+-      sprockets_env.send(:trail).paths.unshift(*local)
++      sprockets_trail.paths.unshift(*local)
+       paths = []
+       ::Rails::Engine.subclasses.each do |subclass|
+         paths = subclass.paths
+         keys.each do |key|
+-          sprockets_env.send(:trail).paths.unshift(*paths[key].existent_directories)
++          sprockets_trail.paths.unshift(*paths[key].existent_directories)
+         end
+       end
+     end
+Index: ruby-compass-rails/lib/compass-rails/patches/4_0.rb
+===================================================================
+--- ruby-compass-rails.orig/lib/compass-rails/patches/4_0.rb
++++ ruby-compass-rails/lib/compass-rails/patches/4_0.rb
+@@ -12,8 +12,14 @@ Compass::Core::SassExtensions::Functions
+     generated_images_dir = Compass.configuration.generated_images_dir
+     generated_images_dir = Rails.root.join(generated_images_dir)
+ 
+-    sprockets_env     = options[:sprockets][:environment]
+-    sprockets_trail   = sprockets_env.send(:trail)
++    sprockets_env = options[:sprockets][:environment]
++
++    if sprockets_env.respond_to?(:trail, true)
++      sprockets_trail = sprockets_env.send(:trail)
++    else
++      sprockets_trail = sprockets_env.index
++    end
++
+     sprockets_entries = sprockets_trail.instance_variable_get(:@entries) || {}
+     sprockets_stats   = sprockets_trail.instance_variable_get(:@stats) || {}
+ 
+Index: ruby-compass-rails/lib/compass-rails/railties/4_0.rb
+===================================================================
+--- ruby-compass-rails.orig/lib/compass-rails/railties/4_0.rb
++++ ruby-compass-rails/lib/compass-rails/railties/4_0.rb
+@@ -25,7 +25,12 @@ module CompassRails
+ 
+             # Clear entries in Hike::Index for this sprite's directory.
+             # This makes sure the asset can be found by find_assets
+-            index = Rails.application.assets.send(:trail).index
++            if Rails.application.assets.respond_to?(:trail, true)
++              index = Rails.application.assets.send(:trail).index
++            else
++              index = Rails.application.assets.index
++            end
++
+             index.instance_variable_get(:@entries).delete(File.dirname(filename))
+             index.instance_variable_get(:@stats).delete(filename)
+ 
+Index: ruby-compass-rails/metadata.yml
+===================================================================
+--- ruby-compass-rails.orig/metadata.yml
++++ ruby-compass-rails/metadata.yml
+@@ -32,14 +32,14 @@ dependencies:
+     requirements:
+     - - "<"
+       - !ruby/object:Gem::Version
+-        version: '2.13'
++        version: '4.0'
+   type: :runtime
+   prerelease: false
+   version_requirements: !ruby/object:Gem::Requirement
+     requirements:
+     - - "<"
+       - !ruby/object:Gem::Version
+-        version: '2.13'
++        version: '4.0'
+ - !ruby/object:Gem::Dependency
+   name: sass-rails
+   requirement: !ruby/object:Gem::Requirement

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-compass-rails.git



More information about the Pkg-ruby-extras-commits mailing list