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
|
@@ -1,59 +1,70 @@
|
|
|
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_5_2 = "5.2"
|
|
8
|
+
RAILS_5_1 = "5.1"
|
|
9
|
+
RAILS_5_0 = "5.0"
|
|
10
|
+
RAILS_4_2 = "4.2"
|
|
8
11
|
RAILS_4_0 = "4.0"
|
|
9
12
|
RAILS_3_2 = "3.2"
|
|
10
13
|
RAILS_3_1 = "3.1"
|
|
11
14
|
|
|
12
15
|
WORKING_DIR = File.join(ROOT_PATH, 'rails-temp')
|
|
13
16
|
|
|
17
|
+
VERSION_LOOKUP = {
|
|
18
|
+
RAILS_5_2 => %r{^5\.2\.},
|
|
19
|
+
RAILS_5_1 => %r{^5\.1\.},
|
|
20
|
+
RAILS_5_0 => %r{^5\.0\.},
|
|
21
|
+
RAILS_4_2 => %r{^4\.2\.},
|
|
22
|
+
RAILS_4_0 => %r{^4\.0\.},
|
|
23
|
+
RAILS_3_2 => %r{^3\.2\.},
|
|
24
|
+
RAILS_3_1 => %r{^3\.1\.},
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
GEMFILES = {
|
|
28
|
+
RAILS_5_2 => GEMFILES_DIR.join("rails_edge.gemfile").to_s,
|
|
29
|
+
RAILS_5_1 => GEMFILES_DIR.join("rails51.gemfile").to_s,
|
|
30
|
+
RAILS_5_0 => GEMFILES_DIR.join("rails50.gemfile").to_s,
|
|
31
|
+
RAILS_4_2 => GEMFILES_DIR.join("rails42.gemfile").to_s,
|
|
15
32
|
RAILS_4_0 => GEMFILES_DIR.join("rails40.gemfile").to_s,
|
|
16
33
|
RAILS_3_2 => GEMFILES_DIR.join("rails32.gemfile").to_s,
|
|
17
34
|
RAILS_3_1 => GEMFILES_DIR.join("rails31.gemfile").to_s
|
|
18
35
|
}
|
|
19
36
|
|
|
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
|
-
}
|
|
37
|
+
GENERATOR_OPTIONS = ['-q', '-G', '-O', '--skip-bundle']
|
|
25
38
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
39
|
+
def rails_command(options)
|
|
40
|
+
debug cmd = "rails #{options.join(' ')}"
|
|
41
|
+
run_command(cmd, GEMFILES[rails_version])
|
|
42
|
+
end
|
|
31
43
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
end
|
|
44
|
+
def rails_version
|
|
45
|
+
@rails_version ||= VERSION_LOOKUP.detect { |version, regex| CompassRails.version_match(regex) }.first
|
|
46
|
+
end
|
|
36
47
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
# Generate a rails application without polluting our current set of requires
|
|
49
|
+
# with the rails libraries. This will allow testing against multiple versions of rails
|
|
50
|
+
# by manipulating the load path.
|
|
51
|
+
def generate_rails_app(name, options = [])
|
|
52
|
+
options += GENERATOR_OPTIONS
|
|
53
|
+
rails_command(['new', name, *options])
|
|
54
|
+
end
|
|
44
55
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
def within_rails_app(named, &block)
|
|
57
|
+
dir = "#{named}-#{rails_version}"
|
|
58
|
+
rm_rf File.join(WORKING_DIR, dir)
|
|
59
|
+
mkdir_p WORKING_DIR
|
|
60
|
+
cd(WORKING_DIR) do
|
|
61
|
+
generate_rails_app(dir, [])
|
|
62
|
+
cd(dir) do
|
|
63
|
+
yield RailsProject.new(File.join(WORKING_DIR, dir), rails_version)
|
|
64
|
+
end
|
|
53
65
|
end
|
|
66
|
+
rm_rf File.join(WORKING_DIR, dir) unless ENV['DEBUG_COMPILE']
|
|
54
67
|
end
|
|
55
|
-
rm_rf File.join(WORKING_DIR, dir)
|
|
56
|
-
end
|
|
57
68
|
|
|
58
69
|
end
|
|
59
70
|
end
|
|
@@ -7,21 +7,14 @@ module CompassRails
|
|
|
7
7
|
include RailsHelpers
|
|
8
8
|
include Kernal::Captures
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
GEMFILE = 'Gemfile'
|
|
12
|
-
GEMFILE_LOCK = 'Gemfile.lock'
|
|
13
|
-
ENVIRONMENT = 'config/environment.rb'
|
|
14
|
-
COMPASS_CONFIG = 'config/compass.rb'
|
|
15
10
|
APPLICATION_FILE = 'config/application.rb'
|
|
16
|
-
BOOT_FILE = 'config/boot.rb'
|
|
17
|
-
|
|
18
11
|
|
|
19
|
-
attr_reader :directory, :version
|
|
12
|
+
attr_reader :directory, :version
|
|
20
13
|
|
|
21
|
-
def initialize(directory, version
|
|
14
|
+
def initialize(directory, version)
|
|
22
15
|
@directory = Pathname.new(directory)
|
|
23
16
|
@version = version
|
|
24
|
-
|
|
17
|
+
disable_cookies! if version == '3.1'
|
|
25
18
|
end
|
|
26
19
|
|
|
27
20
|
## FILE METHODS
|
|
@@ -34,89 +27,56 @@ module CompassRails
|
|
|
34
27
|
File.basename(directory)
|
|
35
28
|
end
|
|
36
29
|
|
|
37
|
-
def
|
|
38
|
-
|
|
30
|
+
def file(path)
|
|
31
|
+
directory.join(path)
|
|
39
32
|
end
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
if asset_pipeline_enabled
|
|
43
|
-
return directory.join('app', 'assets', 'stylesheets', 'screen.css.scss')
|
|
44
|
-
else
|
|
45
|
-
return directory.join('app', 'assets', 'stylesheets','screen.scss')
|
|
46
|
-
end
|
|
47
|
-
end
|
|
34
|
+
# RAILS METHODS
|
|
48
35
|
|
|
49
|
-
def
|
|
50
|
-
|
|
36
|
+
def boots?
|
|
37
|
+
rails_property("compass.project_type") == "rails"
|
|
51
38
|
end
|
|
52
39
|
|
|
53
|
-
def
|
|
54
|
-
|
|
40
|
+
def precompile!
|
|
41
|
+
run_command("rake assets:precompile", GEMFILES[version])
|
|
55
42
|
end
|
|
56
43
|
|
|
57
|
-
def
|
|
58
|
-
|
|
44
|
+
def setup_asset_fixtures!
|
|
45
|
+
rm_rf file("app/assets")
|
|
46
|
+
cp_r CompassRails::Test.root.join('test', 'fixtures', 'assets'), file("app")
|
|
59
47
|
end
|
|
60
48
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
def rails3?
|
|
64
|
-
directory.join(APPLICATION_FILE).exist?
|
|
49
|
+
def precompiled?(path)
|
|
50
|
+
!Dir[asset_path(path)].empty?
|
|
65
51
|
end
|
|
66
52
|
|
|
67
|
-
def
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
r = runner(test_string)
|
|
72
|
-
if r =~ matcher
|
|
73
|
-
return true
|
|
74
|
-
else
|
|
75
|
-
return false
|
|
53
|
+
def compiled_stylesheet(path, &block)
|
|
54
|
+
File.open(asset_path(path)).read.tap do |css|
|
|
55
|
+
debug(css)
|
|
56
|
+
yield css if block_given?
|
|
76
57
|
end
|
|
77
58
|
end
|
|
78
59
|
|
|
79
|
-
def
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
# COMPASS METHODS
|
|
84
|
-
|
|
85
|
-
def run_compass(command)
|
|
86
|
-
run_command("compass #{command}", GEMFILES[version])
|
|
60
|
+
def asset_path(path_pattern)
|
|
61
|
+
Dir[file(path_pattern)].first.tap do |asset|
|
|
62
|
+
raise 'Asset not found' if asset.nil?
|
|
63
|
+
end
|
|
87
64
|
end
|
|
88
65
|
|
|
89
|
-
def
|
|
90
|
-
|
|
91
|
-
unless file.exist?
|
|
92
|
-
touch file
|
|
93
|
-
end
|
|
94
|
-
inject_at_bottom(file, "#{property} = '#{value}'")
|
|
66
|
+
def rails_property(key)
|
|
67
|
+
rails_command(['runner', "'puts Rails.application.config.#{key}'"]).chomp
|
|
95
68
|
end
|
|
96
69
|
|
|
97
70
|
def set_rails(property, value)
|
|
98
|
-
value =
|
|
99
|
-
"\n config.#{property} = :#{value}\n"
|
|
100
|
-
else
|
|
101
|
-
"\n config.#{property} = '#{value}'\n"
|
|
102
|
-
end
|
|
71
|
+
value = "\n config.#{property} = #{value.inspect}\n"
|
|
103
72
|
inject_into_file(directory.join(APPLICATION_FILE), value, :after, 'class Application < Rails::Application')
|
|
104
73
|
end
|
|
105
74
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
def add_to_gemfile(name, requirements)
|
|
111
|
-
gemfile = directory.join(GEMFILE)
|
|
112
|
-
debug(Rainbow("Adding gem #{name} to file: #{gemfile}").foreground(:green))
|
|
113
|
-
if requirements
|
|
114
|
-
gem_string = " gem '#{name}', #{requirements}\n"
|
|
115
|
-
else
|
|
116
|
-
gem_string = " gem '#{name}'\n"
|
|
117
|
-
end
|
|
118
|
-
inject_at_bottom(gemfile, gem_string)
|
|
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')
|
|
119
78
|
end
|
|
79
|
+
|
|
120
80
|
end
|
|
121
81
|
end
|
|
122
82
|
end
|
data/test/test_helper.rb
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
require '
|
|
1
|
+
require 'minitest/autorun'
|
|
2
2
|
require 'compass-rails'
|
|
3
|
-
require '
|
|
3
|
+
require 'active_support/all'
|
|
4
4
|
|
|
5
5
|
module CompassRails
|
|
6
6
|
module Test
|
|
7
7
|
ROOT_PATH = File.expand_path('../../', __FILE__)
|
|
8
|
+
|
|
9
|
+
def self.root
|
|
10
|
+
Pathname.new(ROOT_PATH)
|
|
11
|
+
end
|
|
8
12
|
end
|
|
9
13
|
end
|
|
10
14
|
|
|
@@ -12,4 +16,5 @@ end
|
|
|
12
16
|
require File.join(File.expand_path('../', __FILE__), 'helpers', "#{helper}_helper")
|
|
13
17
|
end
|
|
14
18
|
|
|
15
|
-
require File.join(File.expand_path('../', __FILE__), 'helpers', "rails_project")
|
|
19
|
+
require File.join(File.expand_path('../', __FILE__), 'helpers', "rails_project")
|
|
20
|
+
|
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:
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Davis
|
|
@@ -10,22 +10,50 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: compass
|
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
|
18
18
|
requirements:
|
|
19
|
-
- - "
|
|
19
|
+
- - "~>"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 0.
|
|
21
|
+
version: 1.0.0
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
requirements:
|
|
26
|
-
- - "
|
|
26
|
+
- - "~>"
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 0.
|
|
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: '4.0'
|
|
36
|
+
type: :runtime
|
|
37
|
+
prerelease: false
|
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
- - "<"
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '4.0'
|
|
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.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.1'
|
|
29
57
|
description: Integrate Compass into Rails 3.0 and up.
|
|
30
58
|
email:
|
|
31
59
|
- jetviper21@gmail.com
|
|
@@ -38,19 +66,22 @@ files:
|
|
|
38
66
|
- ".gitignore"
|
|
39
67
|
- ".travis.yml"
|
|
40
68
|
- Appraisals
|
|
69
|
+
- CHANGELOG.md
|
|
41
70
|
- Gemfile
|
|
42
71
|
- Guardfile
|
|
43
72
|
- LICENSE
|
|
44
73
|
- README.md
|
|
45
74
|
- Rakefile
|
|
46
|
-
- changelog.markdown
|
|
47
75
|
- compass-rails.gemspec
|
|
48
76
|
- gemfiles/rails31.gemfile
|
|
49
77
|
- gemfiles/rails32.gemfile
|
|
50
78
|
- gemfiles/rails40.gemfile
|
|
79
|
+
- gemfiles/rails42.gemfile
|
|
80
|
+
- gemfiles/rails50.gemfile
|
|
81
|
+
- gemfiles/rails51.gemfile
|
|
82
|
+
- gemfiles/rails_edge.gemfile
|
|
51
83
|
- lib/compass-rails.rb
|
|
52
84
|
- lib/compass-rails/configuration.rb
|
|
53
|
-
- lib/compass-rails/installer.rb
|
|
54
85
|
- lib/compass-rails/patches.rb
|
|
55
86
|
- lib/compass-rails/patches/3_1.rb
|
|
56
87
|
- lib/compass-rails/patches/4_0.rb
|
|
@@ -64,18 +95,21 @@ files:
|
|
|
64
95
|
- lib/compass-rails/railties/4_0.rb
|
|
65
96
|
- lib/compass-rails/version.rb
|
|
66
97
|
- sache.json
|
|
98
|
+
- test/compass_rails_spec.rb
|
|
67
99
|
- test/fixtures/.gitkeep
|
|
100
|
+
- test/fixtures/assets/images/letters/a.png
|
|
101
|
+
- test/fixtures/assets/images/letters/b.png
|
|
102
|
+
- test/fixtures/assets/images/numbers/sprite-1.png
|
|
103
|
+
- test/fixtures/assets/images/numbers/sprite-2.png
|
|
104
|
+
- test/fixtures/assets/stylesheets/application.css.scss
|
|
105
|
+
- test/fixtures/assets/stylesheets/partials/_partial_1.scss
|
|
106
|
+
- test/fixtures/assets/stylesheets/partials/_partial_2.scss
|
|
68
107
|
- test/helpers/command_helper.rb
|
|
69
108
|
- test/helpers/debug_helper.rb
|
|
70
109
|
- test/helpers/file_helper.rb
|
|
71
110
|
- test/helpers/rails_helper.rb
|
|
72
111
|
- test/helpers/rails_project.rb
|
|
73
|
-
- test/integrations/.gitkeep
|
|
74
|
-
- test/integrations/rails_31_test.rb
|
|
75
|
-
- test/integrations/rails_32_test.rb
|
|
76
|
-
- test/integrations/rails_40_test.rb
|
|
77
112
|
- test/test_helper.rb
|
|
78
|
-
- test/units/.gitkeep
|
|
79
113
|
homepage: https://github.com/Compass/compass-rails
|
|
80
114
|
licenses:
|
|
81
115
|
- MIT
|
|
@@ -101,16 +135,18 @@ signing_key:
|
|
|
101
135
|
specification_version: 4
|
|
102
136
|
summary: Integrate Compass into Rails 3.0 and up.
|
|
103
137
|
test_files:
|
|
138
|
+
- test/compass_rails_spec.rb
|
|
104
139
|
- test/fixtures/.gitkeep
|
|
140
|
+
- test/fixtures/assets/images/letters/a.png
|
|
141
|
+
- test/fixtures/assets/images/letters/b.png
|
|
142
|
+
- test/fixtures/assets/images/numbers/sprite-1.png
|
|
143
|
+
- test/fixtures/assets/images/numbers/sprite-2.png
|
|
144
|
+
- test/fixtures/assets/stylesheets/application.css.scss
|
|
145
|
+
- test/fixtures/assets/stylesheets/partials/_partial_1.scss
|
|
146
|
+
- test/fixtures/assets/stylesheets/partials/_partial_2.scss
|
|
105
147
|
- test/helpers/command_helper.rb
|
|
106
148
|
- test/helpers/debug_helper.rb
|
|
107
149
|
- test/helpers/file_helper.rb
|
|
108
150
|
- test/helpers/rails_helper.rb
|
|
109
151
|
- test/helpers/rails_project.rb
|
|
110
|
-
- test/integrations/.gitkeep
|
|
111
|
-
- test/integrations/rails_31_test.rb
|
|
112
|
-
- test/integrations/rails_32_test.rb
|
|
113
|
-
- test/integrations/rails_40_test.rb
|
|
114
152
|
- test/test_helper.rb
|
|
115
|
-
- test/units/.gitkeep
|
|
116
|
-
has_rdoc:
|
data/changelog.markdown
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module CompassRails
|
|
2
|
-
class Installer < Compass::Installers::ManifestInstaller
|
|
3
|
-
|
|
4
|
-
SASS_FILE_REGEX = %r{(.*)(?:\.css)?\.(sass|scss)}
|
|
5
|
-
|
|
6
|
-
def completed_configuration
|
|
7
|
-
@completed_configuration ||= CompassRails.configuration
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def install_stylesheet(from, to, options)
|
|
11
|
-
if CompassRails.rails_loaded? && CompassRails.asset_pipeline_enabled?
|
|
12
|
-
_, name, ext = SASS_FILE_REGEX.match(to).to_a
|
|
13
|
-
to = "#{name}.css.#{ext}"
|
|
14
|
-
end
|
|
15
|
-
super(from, to, options)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def write_configuration_files
|
|
19
|
-
config_file = CompassRails.root.join('config', 'compass.rb')
|
|
20
|
-
unless config_file.exist?
|
|
21
|
-
write_file config_file.to_s, CompassRails.configuration.serialize
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def prepare
|
|
26
|
-
write_configuration_files
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
end
|
|
30
|
-
end
|
data/test/integrations/.gitkeep
DELETED
|
File without changes
|
|
@@ -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
|
data/test/units/.gitkeep
DELETED
|
File without changes
|