compass-rails 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +15 -3
- data/Appraisals +5 -0
- data/Gemfile +0 -2
- data/compass-rails.gemspec +2 -1
- data/gemfiles/rails31.gemfile +5 -6
- data/gemfiles/rails32.gemfile +5 -6
- data/gemfiles/rails40.gemfile +5 -6
- data/gemfiles/rails42.gemfile +21 -0
- data/lib/compass-rails/patches/3_1.rb +2 -2
- data/lib/compass-rails/patches/4_0.rb +16 -19
- data/lib/compass-rails/patches/sass_importer.rb +43 -5
- data/lib/compass-rails/version.rb +1 -1
- data/test/helpers/command_helper.rb +1 -1
- data/test/helpers/debug_helper.rb +1 -1
- data/test/helpers/file_helper.rb +10 -4
- data/test/helpers/rails_helper.rb +25 -21
- data/test/helpers/rails_project.rb +14 -18
- data/test/integrations/rails_test.rb +36 -0
- data/test/test_helper.rb +0 -1
- metadata +34 -8
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35b96ecdbcc4b8f31aa688118b7bd77d6d5db397
|
4
|
+
data.tar.gz: f3df7f5b7e2b6cece063d59ca2514c07bd09e138
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9add8d36252e6f429c3585f2710bcdd69147bd373d3b97fb0988980e154137a3e3ef8545d4f0221580f7564183a8d209bdd7aa37e688e82f5550ff8ce627fb59
|
7
|
+
data.tar.gz: 88057fec2aeeeb78d17f516645c6c608d590226e1901344637391f734c5eeec0c63ad47ec2f1eae6ac1a61aab567ab3029a53c953a9add9770ee75cf41a14bb9
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,5 +1,17 @@
|
|
1
|
+
language: ruby
|
1
2
|
rvm:
|
2
3
|
- 1.9.3
|
3
|
-
- 2.0
|
4
|
-
- 2.1
|
5
|
-
|
4
|
+
- 2.0
|
5
|
+
- 2.1
|
6
|
+
- 2.2
|
7
|
+
- jruby-head
|
8
|
+
|
9
|
+
matrix:
|
10
|
+
allow_failures:
|
11
|
+
- rvm: jruby-head
|
12
|
+
|
13
|
+
gemfile:
|
14
|
+
- gemfiles/rails31.gemfile
|
15
|
+
- gemfiles/rails32.gemfile
|
16
|
+
- gemfiles/rails40.gemfile
|
17
|
+
- gemfiles/rails42.gemfile
|
data/Appraisals
CHANGED
data/Gemfile
CHANGED
data/compass-rails.gemspec
CHANGED
data/gemfiles/rails31.gemfile
CHANGED
@@ -2,21 +2,20 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "rb-fsevent", :require=>false
|
6
|
-
gem "ruby_gntp", :require=>false
|
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
10
|
gem "sass-rails"
|
11
11
|
|
12
12
|
group :assets do
|
13
|
-
gem "compass-rails", :path=>".."
|
14
13
|
gem "compass-blueprint"
|
15
14
|
end
|
15
|
+
|
16
16
|
group :test do
|
17
17
|
gem "mocha"
|
18
|
-
gem "appraisal"
|
19
|
-
gem "rainbow"
|
18
|
+
gem "appraisal"
|
20
19
|
end
|
21
20
|
|
22
|
-
gemspec :path=>"../"
|
21
|
+
gemspec :path => "../"
|
data/gemfiles/rails32.gemfile
CHANGED
@@ -2,21 +2,20 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "rb-fsevent", :require=>false
|
6
|
-
gem "ruby_gntp", :require=>false
|
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
10
|
gem "sass-rails"
|
11
11
|
|
12
12
|
group :assets do
|
13
|
-
gem "compass-rails", :path=>".."
|
14
13
|
gem "compass-blueprint"
|
15
14
|
end
|
15
|
+
|
16
16
|
group :test do
|
17
17
|
gem "mocha"
|
18
|
-
gem "appraisal"
|
19
|
-
gem "rainbow"
|
18
|
+
gem "appraisal"
|
20
19
|
end
|
21
20
|
|
22
|
-
gemspec :path=>"../"
|
21
|
+
gemspec :path => "../"
|
data/gemfiles/rails40.gemfile
CHANGED
@@ -2,21 +2,20 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "rb-fsevent", :require=>false
|
6
|
-
gem "ruby_gntp", :require=>false
|
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
10
|
gem "sass-rails"
|
11
11
|
|
12
12
|
group :assets do
|
13
|
-
gem "compass-rails", :path=>".."
|
14
13
|
gem "compass-blueprint"
|
15
14
|
end
|
15
|
+
|
16
16
|
group :test do
|
17
17
|
gem "mocha"
|
18
|
-
gem "appraisal"
|
19
|
-
gem "rainbow"
|
18
|
+
gem "appraisal"
|
20
19
|
end
|
21
20
|
|
22
|
-
gemspec :path=>"../"
|
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", "~> 4.2.0"
|
10
|
+
gem "sass-rails", "~> 5.0"
|
11
|
+
|
12
|
+
group :assets do
|
13
|
+
gem "compass-blueprint"
|
14
|
+
end
|
15
|
+
|
16
|
+
group :test do
|
17
|
+
gem "mocha"
|
18
|
+
gem "appraisal"
|
19
|
+
end
|
20
|
+
|
21
|
+
gemspec :path => "../"
|
@@ -2,7 +2,7 @@ require 'compass-rails/patches/compass'
|
|
2
2
|
require 'compass-rails/patches/static_compiler'
|
3
3
|
|
4
4
|
Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl.module_eval do
|
5
|
-
def generated_image_url(path,
|
6
|
-
asset_url(path, Sass::Script::String.new(
|
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
|
@@ -3,34 +3,31 @@ require 'compass-rails/patches/sass_importer'
|
|
3
3
|
require 'compass-rails/patches/sprite_importer'
|
4
4
|
|
5
5
|
Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl.module_eval do
|
6
|
-
def generated_image_url(path,
|
7
|
-
|
8
|
-
subdirectory = pathobject.dirname.to_s
|
9
|
-
|
10
|
-
cachebust_generated_images(path, subdirectory)
|
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
|
-
bust_cache_path = generated_images_path
|
18
|
-
else
|
19
|
-
bust_cache_path = generated_images_path + "/" + subdirectory
|
20
|
-
end
|
21
|
-
bust_image_stat_path = generated_images_path + "/" + image_path.to_s
|
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)
|
22
14
|
|
23
|
-
|
15
|
+
sprockets_env = options[:sprockets][:environment]
|
16
|
+
sprockets_trail = sprockets_env.send(:trail)
|
17
|
+
sprockets_entries = sprockets_trail.instance_variable_get(:@entries) || {}
|
18
|
+
sprockets_stats = sprockets_trail.instance_variable_get(:@stats) || {}
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
if sprockets_entries.key?(generated_images_dir.to_s)
|
21
|
+
path = path.value
|
22
|
+
dir = File.dirname(path)
|
28
23
|
|
29
24
|
# Delete the entries (directories) which cache the files/dirs in a directory
|
30
|
-
|
25
|
+
entry = generated_images_dir.join(dir).to_s
|
26
|
+
sprockets_entries.delete(entry)
|
31
27
|
|
32
28
|
# Delete the stats (file/dir info) which cache the what kind of file/dir each image is
|
33
|
-
|
29
|
+
stat = generated_images_dir.join(path).to_s
|
30
|
+
sprockets_stats.delete(stat)
|
34
31
|
end
|
35
32
|
end
|
36
33
|
end
|
@@ -7,18 +7,23 @@ 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 =
|
10
|
+
cache_store =
|
11
|
+
if defined?(Sprockets::SassCacheStore)
|
12
|
+
Sprockets::SassCacheStore.new(context.environment)
|
13
|
+
else
|
14
|
+
Sprockets::SassProcessor::CacheStore.new(sprockets_cache_store, context.environment)
|
15
|
+
end
|
16
|
+
|
11
17
|
paths = context.environment.paths.map { |path| CompassRails::SpriteImporter.new(context, path) }
|
12
|
-
paths += context.environment.paths.map { |path|
|
18
|
+
paths += context.environment.paths.map { |path| sass_importer(context, path) }
|
13
19
|
paths += ::Rails.application.config.sass.load_paths
|
14
20
|
|
15
|
-
|
16
21
|
options = CompassRails.sass_config.merge( {
|
17
22
|
:filename => eval_file,
|
18
23
|
:line => line,
|
19
24
|
:syntax => syntax,
|
20
25
|
:cache_store => cache_store,
|
21
|
-
:importer =>
|
26
|
+
:importer => sass_importer(context, context.pathname),
|
22
27
|
:load_paths => paths,
|
23
28
|
:sprockets => {
|
24
29
|
:context => context,
|
@@ -26,11 +31,44 @@ klass.class_eval do
|
|
26
31
|
}
|
27
32
|
})
|
28
33
|
|
29
|
-
::Sass::Engine.new(data, options)
|
34
|
+
engine = ::Sass::Engine.new(data, options)
|
35
|
+
|
36
|
+
engine.dependencies.map do |dependency|
|
37
|
+
context.depend_on(dependency.options[:filename])
|
38
|
+
end
|
39
|
+
|
40
|
+
engine.render
|
30
41
|
rescue ::Sass::SyntaxError => e
|
31
42
|
# Annotates exception message with parse line number
|
32
43
|
context.__LINE__ = e.sass_backtrace.first[:line]
|
33
44
|
raise e
|
34
45
|
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def sass_importer_artiy
|
50
|
+
@sass_importer_artiy ||= self.class.parent::SassImporter.instance_method(:initialize).arity
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
def sass_importer(context, path)
|
55
|
+
case sass_importer_artiy.abs
|
56
|
+
when 1
|
57
|
+
self.class.parent::SassImporter.new(path)
|
58
|
+
else
|
59
|
+
self.class.parent::SassImporter.new(context, path)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def sprockets_cache_store
|
64
|
+
case Rails.application.config.assets.cache_store
|
65
|
+
when :null_store
|
66
|
+
Sprockets::Cache::NullStore.new
|
67
|
+
when :memory_store, :mem_cache_store
|
68
|
+
Sprockets::Cache::MemoryStore.new
|
69
|
+
else
|
70
|
+
Sprockets::Cache::FileStore.new(Dir::tmpdir)
|
71
|
+
end
|
72
|
+
end
|
35
73
|
end
|
36
74
|
|
@@ -43,7 +43,7 @@ module CompassRails
|
|
43
43
|
BUNDLER_COMMAND = 'bundle'
|
44
44
|
|
45
45
|
def run_command(command, gemfile=nil)
|
46
|
-
debug
|
46
|
+
debug "Running: #{command} with gemfile: #{gemfile}"
|
47
47
|
capture_all_output { CompassRails::Test::CommandRunner.new(command, gemfile).run }
|
48
48
|
end
|
49
49
|
|
data/test/helpers/file_helper.rb
CHANGED
@@ -4,19 +4,25 @@ module CompassRails
|
|
4
4
|
include DebugHelper
|
5
5
|
|
6
6
|
def mkdir_p(dir)
|
7
|
-
debug
|
7
|
+
debug "Creating Directory: #{dir}"
|
8
8
|
::FileUtils.mkdir_p dir
|
9
9
|
assert File.directory?(dir), "mkdir_p: #{dir} failed"
|
10
10
|
end
|
11
11
|
|
12
|
+
def rm(path)
|
13
|
+
debug "Removing: #{path}"
|
14
|
+
::FileUtils.rm(path)
|
15
|
+
assert !File.file?(path), "rm: #{path} failed"
|
16
|
+
end
|
17
|
+
|
12
18
|
def rm_rf(path)
|
13
|
-
debug
|
19
|
+
debug "Removing: #{path}"
|
14
20
|
::FileUtils.rm_rf(path)
|
15
21
|
assert !File.directory?(path), "rm_rf: #{path} failed"
|
16
22
|
end
|
17
23
|
|
18
24
|
def cd(path, &block)
|
19
|
-
debug
|
25
|
+
debug "Entering: #{path}"
|
20
26
|
Dir.chdir(path, &block)
|
21
27
|
end
|
22
28
|
|
@@ -27,7 +33,7 @@ module CompassRails
|
|
27
33
|
end
|
28
34
|
|
29
35
|
def touch(file)
|
30
|
-
debug
|
36
|
+
debug "Touching File: #{file}"
|
31
37
|
::FileUtils.touch(file)
|
32
38
|
end
|
33
39
|
|
@@ -1,55 +1,59 @@
|
|
1
|
-
|
2
1
|
module CompassRails
|
3
2
|
module Test
|
4
3
|
module RailsHelpers
|
5
4
|
include FileHelper
|
6
5
|
include DebugHelper
|
7
6
|
include CommandHelper
|
7
|
+
RAILS_4_2 = "4.2"
|
8
8
|
RAILS_4_0 = "4.0"
|
9
9
|
RAILS_3_2 = "3.2"
|
10
10
|
RAILS_3_1 = "3.1"
|
11
11
|
|
12
12
|
WORKING_DIR = File.join(ROOT_PATH, 'rails-temp')
|
13
13
|
|
14
|
+
VERSION_LOOKUP = {
|
15
|
+
RAILS_4_2 => %r{^4\.2\.},
|
16
|
+
RAILS_4_0 => %r{^4\.0\.},
|
17
|
+
RAILS_3_2 => %r{^3\.2\.},
|
18
|
+
RAILS_3_1 => %r{^3\.1\.},
|
19
|
+
}
|
20
|
+
|
14
21
|
GEMFILES = {
|
22
|
+
RAILS_4_2 => GEMFILES_DIR.join("rails42.gemfile").to_s,
|
15
23
|
RAILS_4_0 => GEMFILES_DIR.join("rails40.gemfile").to_s,
|
16
24
|
RAILS_3_2 => GEMFILES_DIR.join("rails32.gemfile").to_s,
|
17
25
|
RAILS_3_1 => GEMFILES_DIR.join("rails31.gemfile").to_s
|
18
26
|
}
|
19
27
|
|
20
|
-
GENERATOR_OPTIONS =
|
21
|
-
RAILS_4_0 => ['-q', '-G', '-O', '--skip-bundle'],
|
22
|
-
RAILS_3_2 => ['-q', '-G', '-O', '--skip-bundle'],
|
23
|
-
RAILS_3_1 => ['-q', '-G', '-O', '--skip-bundle']
|
24
|
-
}
|
28
|
+
GENERATOR_OPTIONS = Hash.new(['-q', '-G', '-O', '--skip-bundle'])
|
25
29
|
|
26
|
-
GENERATOR_COMMAND =
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
GENERATOR_COMMAND = Hash.new("new")
|
31
|
+
|
32
|
+
def rails_command(options)
|
33
|
+
debug "Running Rails command with: rails #{options.join(' ')}"
|
34
|
+
run_command("rails #{options.join(' ')}", GEMFILES[rails_version])
|
35
|
+
end
|
31
36
|
|
32
|
-
def
|
33
|
-
|
34
|
-
run_command("rails #{options.join(' ')}", GEMFILES[version])
|
37
|
+
def rails_version
|
38
|
+
@rails_version ||= VERSION_LOOKUP.detect { |version, regex| CompassRails.version_match(regex) }.first
|
35
39
|
end
|
36
40
|
|
37
41
|
# Generate a rails application without polluting our current set of requires
|
38
42
|
# with the rails libraries. This will allow testing against multiple versions of rails
|
39
43
|
# by manipulating the load path.
|
40
|
-
def generate_rails_app(name,
|
41
|
-
options += GENERATOR_OPTIONS[
|
42
|
-
rails_command([GENERATOR_COMMAND[
|
44
|
+
def generate_rails_app(name, options=[])
|
45
|
+
options += GENERATOR_OPTIONS[rails_version]
|
46
|
+
rails_command([GENERATOR_COMMAND[rails_version], name, *options])
|
43
47
|
end
|
44
48
|
|
45
|
-
def within_rails_app(named,
|
46
|
-
dir = "#{named}-#{
|
49
|
+
def within_rails_app(named, asset_pipeline_enabled = true, &block)
|
50
|
+
dir = "#{named}-#{rails_version}"
|
47
51
|
rm_rf File.join(WORKING_DIR, dir)
|
48
52
|
mkdir_p WORKING_DIR
|
49
53
|
cd(WORKING_DIR) do
|
50
|
-
generate_rails_app(dir,
|
54
|
+
generate_rails_app(dir, asset_pipeline_enabled ? [] : ["-S"])
|
51
55
|
cd(dir) do
|
52
|
-
yield RailsProject.new(File.join(WORKING_DIR, dir),
|
56
|
+
yield RailsProject.new(File.join(WORKING_DIR, dir), rails_version, asset_pipeline_enabled)
|
53
57
|
end
|
54
58
|
end
|
55
59
|
rm_rf File.join(WORKING_DIR, dir)
|
@@ -15,7 +15,6 @@ module CompassRails
|
|
15
15
|
APPLICATION_FILE = 'config/application.rb'
|
16
16
|
BOOT_FILE = 'config/boot.rb'
|
17
17
|
|
18
|
-
|
19
18
|
attr_reader :directory, :version, :asset_pipeline_enabled
|
20
19
|
|
21
20
|
def initialize(directory, version, asset_pipeline_enabled = true)
|
@@ -34,6 +33,10 @@ module CompassRails
|
|
34
33
|
File.basename(directory)
|
35
34
|
end
|
36
35
|
|
36
|
+
def file(path)
|
37
|
+
directory.join(path)
|
38
|
+
end
|
39
|
+
|
37
40
|
def has_file?(file)
|
38
41
|
File.exist? directory.join(file)
|
39
42
|
end
|
@@ -65,19 +68,16 @@ module CompassRails
|
|
65
68
|
end
|
66
69
|
|
67
70
|
def boots?
|
68
|
-
|
69
|
-
test_string = "puts \"#{string}\""
|
70
|
-
matcher = %r{#{string}}
|
71
|
-
r = runner(test_string)
|
72
|
-
if r =~ matcher
|
73
|
-
return true
|
74
|
-
else
|
75
|
-
return false
|
76
|
-
end
|
71
|
+
rails_property("compass.project_type") == "rails"
|
77
72
|
end
|
78
73
|
|
79
|
-
def
|
80
|
-
|
74
|
+
def precompiles?
|
75
|
+
run_command("rake assets:precompile", GEMFILES[version])
|
76
|
+
!Dir[file("public/assets/application*.css")].empty?
|
77
|
+
end
|
78
|
+
|
79
|
+
def rails_property(key)
|
80
|
+
rails_command(['runner', "'puts Rails.application.config.#{key}'"]).chomp
|
81
81
|
end
|
82
82
|
|
83
83
|
# COMPASS METHODS
|
@@ -95,11 +95,7 @@ module CompassRails
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def set_rails(property, value)
|
98
|
-
value =
|
99
|
-
"\n config.#{property} = :#{value}\n"
|
100
|
-
else
|
101
|
-
"\n config.#{property} = '#{value}'\n"
|
102
|
-
end
|
98
|
+
value = "\n config.#{property} = #{value.inspect}\n"
|
103
99
|
inject_into_file(directory.join(APPLICATION_FILE), value, :after, 'class Application < Rails::Application')
|
104
100
|
end
|
105
101
|
|
@@ -109,7 +105,7 @@ module CompassRails
|
|
109
105
|
|
110
106
|
def add_to_gemfile(name, requirements)
|
111
107
|
gemfile = directory.join(GEMFILE)
|
112
|
-
debug
|
108
|
+
debug "Adding gem #{name} to file: #{gemfile}"
|
113
109
|
if requirements
|
114
110
|
gem_string = " gem '#{name}', #{requirements}\n"
|
115
111
|
else
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class RailsTest < Test::Unit::TestCase
|
4
|
+
include CompassRails::Test::RailsHelpers
|
5
|
+
|
6
|
+
def test_rails_app_created
|
7
|
+
within_rails_app('test_railtie') do |project|
|
8
|
+
assert project.boots?
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_rails_assets_precompile
|
13
|
+
within_rails_app('test_railtie') do |project|
|
14
|
+
rm(project.file("app/assets/javascripts/application.js"))
|
15
|
+
rm(project.file("app/assets/stylesheets/application.css"))
|
16
|
+
touch(project.file("app/assets/stylesheets/application.css.sass"))
|
17
|
+
assert project.precompiles?, "Missing compiled css after assets:precompile"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_sass_preferred_syntax
|
22
|
+
within_rails_app('test_railtie') do |project|
|
23
|
+
assert_equal "scss", project.rails_property("sass.preferred_syntax")
|
24
|
+
project.set_rails('sass.preferred_syntax', :sass)
|
25
|
+
assert_equal "sass", project.rails_property("sass.preferred_syntax")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_compass_css_dir
|
30
|
+
within_rails_app('test_railtie') do |project|
|
31
|
+
assert_equal "public/assets", project.rails_property("compass.css_dir")
|
32
|
+
project.set_rails('compass.css_dir', "public/stylesheets")
|
33
|
+
assert_equal "public/stylesheets", project.rails_property("compass.css_dir")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
data/test/test_helper.rb
CHANGED
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.
|
4
|
+
version: 2.0.2
|
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: 2015-01-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: compass
|
@@ -26,6 +26,34 @@ dependencies:
|
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 1.0.0
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: sprockets
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "<"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '2.13'
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '2.13'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: sass-rails
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "<="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 5.0.1
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "<="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 5.0.1
|
29
57
|
description: Integrate Compass into Rails 3.0 and up.
|
30
58
|
email:
|
31
59
|
- jetviper21@gmail.com
|
@@ -48,6 +76,7 @@ files:
|
|
48
76
|
- gemfiles/rails31.gemfile
|
49
77
|
- gemfiles/rails32.gemfile
|
50
78
|
- gemfiles/rails40.gemfile
|
79
|
+
- gemfiles/rails42.gemfile
|
51
80
|
- lib/compass-rails.rb
|
52
81
|
- lib/compass-rails/configuration.rb
|
53
82
|
- lib/compass-rails/installer.rb
|
@@ -71,9 +100,7 @@ files:
|
|
71
100
|
- test/helpers/rails_helper.rb
|
72
101
|
- test/helpers/rails_project.rb
|
73
102
|
- test/integrations/.gitkeep
|
74
|
-
- test/integrations/
|
75
|
-
- test/integrations/rails_32_test.rb
|
76
|
-
- test/integrations/rails_40_test.rb
|
103
|
+
- test/integrations/rails_test.rb
|
77
104
|
- test/test_helper.rb
|
78
105
|
- test/units/.gitkeep
|
79
106
|
homepage: https://github.com/Compass/compass-rails
|
@@ -108,8 +135,7 @@ test_files:
|
|
108
135
|
- test/helpers/rails_helper.rb
|
109
136
|
- test/helpers/rails_project.rb
|
110
137
|
- test/integrations/.gitkeep
|
111
|
-
- test/integrations/
|
112
|
-
- test/integrations/rails_32_test.rb
|
113
|
-
- test/integrations/rails_40_test.rb
|
138
|
+
- test/integrations/rails_test.rb
|
114
139
|
- test/test_helper.rb
|
115
140
|
- test/units/.gitkeep
|
141
|
+
has_rdoc:
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Rails31Test < Test::Unit::TestCase
|
4
|
-
include CompassRails::Test::RailsHelpers
|
5
|
-
|
6
|
-
RAILS_VERSION = RAILS_3_1
|
7
|
-
|
8
|
-
def test_rails_app_created
|
9
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
10
|
-
assert project.boots?
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_installs_compass
|
15
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
16
|
-
project.run_compass('init')
|
17
|
-
assert project.has_config?
|
18
|
-
assert project.has_screen_file?
|
19
|
-
assert project.has_compass_import?
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_compass_compile
|
24
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
25
|
-
project.run_compass('init')
|
26
|
-
project.run_compass('compile')
|
27
|
-
assert project.directory.join('public/assets/screen.css').exist?
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_install_blueprint
|
32
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
33
|
-
project.run_compass('init')
|
34
|
-
project.run_compass('install blueprint --force')
|
35
|
-
assert project.directory.join('app/assets/stylesheets/partials').directory?
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_compass_preferred_syntax
|
40
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
41
|
-
project.set_rails('sass.preferred_syntax', :sass)
|
42
|
-
project.run_compass('init')
|
43
|
-
assert project.directory.join('app/assets/stylesheets/screen.css.sass').exist?
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Rails32Test < Test::Unit::TestCase
|
4
|
-
include CompassRails::Test::RailsHelpers
|
5
|
-
|
6
|
-
RAILS_VERSION = RAILS_3_2
|
7
|
-
|
8
|
-
def test_rails_app_created
|
9
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
10
|
-
assert project.boots?
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_installs_compass
|
15
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
16
|
-
project.run_compass('init')
|
17
|
-
assert project.has_config?
|
18
|
-
assert project.has_screen_file?
|
19
|
-
assert project.has_compass_import?
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_compass_compile
|
24
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
25
|
-
project.run_compass('init')
|
26
|
-
project.run_compass('compile')
|
27
|
-
assert project.directory.join('public/assets/screen.css').exist?
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_install_blueprint
|
32
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
33
|
-
project.run_compass('init')
|
34
|
-
project.run_compass('install blueprint --force')
|
35
|
-
assert project.directory.join('app/assets/stylesheets/partials').directory?
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_compass_preferred_syntax
|
40
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
41
|
-
project.set_rails('sass.preferred_syntax', :sass)
|
42
|
-
project.run_compass('init')
|
43
|
-
assert project.directory.join('app/assets/stylesheets/screen.css.sass').exist?
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class Rails40Test < Test::Unit::TestCase
|
4
|
-
include CompassRails::Test::RailsHelpers
|
5
|
-
|
6
|
-
RAILS_VERSION = RAILS_4_0
|
7
|
-
|
8
|
-
def test_rails_app_created
|
9
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
10
|
-
assert project.boots?
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_installs_compass
|
15
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
16
|
-
project.run_compass('init')
|
17
|
-
assert project.has_config?
|
18
|
-
assert project.has_screen_file?
|
19
|
-
assert project.has_compass_import?
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_compass_compile
|
24
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
25
|
-
project.run_compass('init')
|
26
|
-
project.run_compass('compile')
|
27
|
-
assert project.directory.join('public/assets/screen.css').exist?
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_install_blueprint
|
32
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
33
|
-
project.run_compass('init')
|
34
|
-
project.run_compass('install blueprint --force')
|
35
|
-
assert project.directory.join('app/assets/stylesheets/partials').directory?
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_compass_preferred_syntax
|
40
|
-
within_rails_app('test_railtie', RAILS_VERSION) do |project|
|
41
|
-
project.set_rails('sass.preferred_syntax', :sass)
|
42
|
-
project.run_compass('init')
|
43
|
-
assert project.directory.join('app/assets/stylesheets/screen.css.sass').exist?
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|