compass-rails 3.0.0 → 3.0.1

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: c832d7ff0b8ead7078794b00ebb92f06c9b39c66
4
- data.tar.gz: 6c8f5d59ba1a4ce114ba2a0dd9b12a5c17582b15
3
+ metadata.gz: a6248e53c74d94049fe347ed3cbea2136890672c
4
+ data.tar.gz: b8ad885403b583040e2e1a6e7b37627e5e0a5960
5
5
  SHA512:
6
- metadata.gz: e9126f0cd8877d5fb4252e402535994306c3beae1b324c7acb4777e6921eece4bb04d7da9bc36f68bbc17b3a6e8919902c0b869127000cc0ffc6812a05f9ea8f
7
- data.tar.gz: 3b1a7de4da19c7ebcee67bae8e0967af771a753c21712f9662c96c43f765d3c3711b618f84cbce7d3c97ecc34be33c2c31e78bea0ab9cc8f72db0c2520393c63
6
+ metadata.gz: afffc7bad6944625683b6a6ec836912ce8b373fbe0d307bcc7e178a72d8a296bbce536e7fd720faa813485ee062532f3568d06d0a078d72031c87b8aaabfe1e5
7
+ data.tar.gz: f9af8bd85ba66408dd42ac23a05158098fdf3c083b58a9a2f0b2c17509d35dd20b4b5ef7431a2475c39042bdcd8122833585b7f92413a4fc3a730ffb2c26d987
data/Appraisals CHANGED
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  appraise "rails42" do
20
20
  gem "rails", "~> 4.2.0"
21
- gem "sprockets", "< 2.13"
21
+ gem "sprockets", "< 4.0"
22
22
  gem "sass-rails", "~> 5.0"
23
23
  end
24
24
 
@@ -1,6 +1,10 @@
1
1
  # Change log
2
2
 
3
- ## 3.0.0 - Unreleased
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
4
8
  ### Added
5
9
  - Added Sprockets 3 support. Issue #232, #236, #244.
6
10
 
@@ -7,7 +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
+ gem "sprockets", "< 4.0"
11
11
  gem "sass-rails", "~> 5.0"
12
12
 
13
13
  group :test do
@@ -35,14 +35,14 @@ module CompassRails
35
35
  end
36
36
 
37
37
  def sprockets
38
- @sprockets ||= ::Rails.application.assets
38
+ @sprockets ||= Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)
39
39
  end
40
40
 
41
41
  def context
42
42
  @context ||= begin
43
43
  sprockets.version = ::Rails.env + "-#{sprockets.version}"
44
44
  setup_fake_rails_env_paths(sprockets)
45
- context = ::Rails.application.assets.context_class
45
+ context = ::CompassRails.sprockets.context_class
46
46
  context.extend(::Sprockets::Helpers::IsolatedHelper)
47
47
  context.extend(::Sprockets::Helpers::RailsHelper)
48
48
  context.extend(::Sass::Rails::Railtie::SassContext)
@@ -125,4 +125,3 @@ if defined?(::Rails)
125
125
  require "compass-rails/patches"
126
126
  require "compass-rails/railties"
127
127
  end
128
-
@@ -3,7 +3,7 @@ Compass::Core::SassExtensions::Functions::ImageSize.class_eval do
3
3
 
4
4
  def image_path_for_size(image_file)
5
5
  begin
6
- file = ::Rails.application.assets.find_asset(image_file)
6
+ file = ::CompassRails.sprockets.find_asset(image_file)
7
7
  return file
8
8
  rescue ::Sprockets::FileOutsidePaths
9
9
  return super(image_file)
@@ -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
- ::Rails.application.assets.paths.each do |path|
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(::Rails.application.assets, File.basename(path), Pathname.new(pathname))
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
@@ -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
- Rails.application.assets.send(:trail).instance_variable_get(:@entries).delete(File.dirname(filename))
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 = Rails.application.assets.find_asset(logical_path)
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,10 +25,10 @@ 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
- if Rails.application.assets.respond_to?(:trail, true)
29
- index = Rails.application.assets.send(:trail).index
28
+ if CompassRails.sprockets.respond_to?(:trail, true)
29
+ index = CompassRails.sprockets.send(:trail).index
30
30
  else
31
- index = Rails.application.assets.index
31
+ index = CompassRails.sprockets.index
32
32
  end
33
33
 
34
34
  index.instance_variable_get(:@entries).delete(File.dirname(filename))
@@ -36,7 +36,7 @@ module CompassRails
36
36
 
37
37
  pathname = Pathname.new(filename)
38
38
  logical_path = pathname.relative_path_from(Pathname.new(Compass.configuration.images_path))
39
- asset = Rails.application.assets.find_asset(logical_path)
39
+ asset = CompassRails.sprockets.find_asset(logical_path)
40
40
  target = File.join(Rails.public_path, Rails.application.config.assets.prefix, asset.digest_path)
41
41
 
42
42
  # Adds the asset to the manifest file.
@@ -1,3 +1,3 @@
1
1
  module CompassRails
2
- VERSION = '3.0.0' unless defined?(::CompassRails::VERSION)
2
+ VERSION = '3.0.1' unless defined?(::CompassRails::VERSION)
3
3
  end
@@ -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
- end
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
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: 3.0.0
4
+ version: 3.0.1
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: 2016-01-23 00:00:00.000000000 Z
13
+ date: 2016-02-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: compass