sass-rails 3.1.4 → 3.1.5.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +8 -1
- data/lib/sass/rails/compressor.rb +9 -5
- data/lib/sass/rails/railtie.rb +1 -1
- data/lib/sass/rails/version.rb +1 -1
- data/sass-rails.gemspec +1 -1
- data/test/fixtures/scss_project/app/assets/stylesheets/application.css.scss +1 -0
- data/test/sass_rails_logger_test.rb +3 -5
- data/test/sass_rails_test.rb +1 -0
- data/test/support/sass_rails_test_case.rb +13 -6
- data/test/test_helper.rb +13 -14
- metadata +55 -100
data/README.markdown
CHANGED
@@ -21,6 +21,13 @@ properties that will be passed to Sass.
|
|
21
21
|
config.sass.syntax = :nested
|
22
22
|
end
|
23
23
|
|
24
|
+
## Important Note
|
25
|
+
|
26
|
+
Sprockets provides some directives that are placed inside of comments called `require`, `require_tree`, and
|
27
|
+
`require_self`. **<span style="color:#c00">DO NOT USE THEM IN YOUR SASS/SCSS FILES.</span>** They are very
|
28
|
+
primitive and do not work well with Sass files. Instead, use Sass's native `@import` directive which
|
29
|
+
`sass-rails` has customized to integrate with the conventions of your rails projects.
|
30
|
+
|
24
31
|
### Options
|
25
32
|
|
26
33
|
The [list of supported options](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#options) can be found on the Sass Website with the following caveats:
|
@@ -67,4 +74,4 @@ The [list of supported options](http://sass-lang.com/docs/yardoc/file.SASS_REFER
|
|
67
74
|
$ bundle install
|
68
75
|
$ bundle exec rake test
|
69
76
|
|
70
|
-
If you need to test against local gems, use Bundler's gem :path option in the Gemfile and also edit `test/support/test_helper.rb` and tell the tests where the gem is checked out.
|
77
|
+
If you need to test against local gems, use Bundler's gem :path option in the Gemfile and also edit `test/support/test_helper.rb` and tell the tests where the gem is checked out.
|
@@ -4,11 +4,15 @@ module Sass
|
|
4
4
|
module Rails
|
5
5
|
class CssCompressor
|
6
6
|
def compress(css)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
if css.count("\n") > 2
|
8
|
+
Sass::Engine.new(css,
|
9
|
+
:syntax => :scss,
|
10
|
+
:cache => false,
|
11
|
+
:read_cache => false,
|
12
|
+
:style => :compressed).render
|
13
|
+
else
|
14
|
+
css
|
15
|
+
end
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
data/lib/sass/rails/railtie.rb
CHANGED
data/lib/sass/rails/version.rb
CHANGED
data/sass-rails.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.rubyforge_project = "sass-rails"
|
16
16
|
|
17
|
-
s.add_runtime_dependency 'sass', '
|
17
|
+
s.add_runtime_dependency 'sass', '~> 3.1.10'
|
18
18
|
s.add_runtime_dependency 'railties', '~> 3.1.0'
|
19
19
|
s.add_runtime_dependency 'actionpack', '~> 3.1.0'
|
20
20
|
s.add_runtime_dependency 'tilt', '~> 1.3.2'
|
@@ -21,6 +21,7 @@
|
|
21
21
|
audio-url: audio-url("rails.mp3");
|
22
22
|
font-path: font-path("rails.ttf");
|
23
23
|
font-url: font-url("rails.ttf");
|
24
|
+
font-url-with-query-hash: font-url("rails.ttf?#iefix");
|
24
25
|
javascript-path: javascript-path("rails.js");
|
25
26
|
javascript-url: javascript-url("rails.js");
|
26
27
|
stylesheet-path: stylesheet-path("rails.css");
|
@@ -8,11 +8,9 @@ class SassRailsLoggerTest < Sass::Rails::TestCase
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
app_root = runcmd 'rails runner "print Rails.root"'
|
15
|
-
|
11
|
+
test "sending a log messages to the sass logger writes to the environment log file" do
|
12
|
+
within_rails_app "scss_project" do |app_root|
|
13
|
+
[:debug, :warn, :info, :error, :trace].each do |level|
|
16
14
|
message = "[#{level}]: sass message"
|
17
15
|
runcmd %{rails runner "Sass::logger.log_level = :#{level}; Sass::logger.log(:#{level}, %Q|#{message}|)"}
|
18
16
|
|
data/test/sass_rails_test.rb
CHANGED
@@ -84,6 +84,7 @@ class SassRailsTest < Sass::Rails::TestCase
|
|
84
84
|
assert_match css_output, %r{audio-url:\s*url\(/audios/rails.mp3\)}, 'audio-url:\s*url\(/audios/rails.mp3\)'
|
85
85
|
assert_match css_output, %r{font-path:\s*"/assets/rails.ttf"}, 'font-path:\s*"/assets/rails.ttf"'
|
86
86
|
assert_match css_output, %r{font-url:\s*url\(/assets/rails.ttf\)}, 'font-url:\s*url\(/assets/rails.ttf\)'
|
87
|
+
assert_match css_output, %r{font-url-with-query-hash:\s*url\(/assets/rails.ttf\?#iefix\)}, 'font-url:\s*url\(/assets/rails.ttf?#iefix\)'
|
87
88
|
assert_match css_output, %r{javascript-path:\s*"/assets/rails.js"}, 'javascript-path:\s*"/assets/rails.js"'
|
88
89
|
assert_match css_output, %r{javascript-url:\s*url\(/assets/rails.js\)}, 'javascript-url:\s*url\(/assets/rails.js\)'
|
89
90
|
assert_match css_output, %r{stylesheet-path:\s*"/assets/rails.css"}, 'stylesheet-path:\s*"/assets/rails.css"'
|
@@ -59,15 +59,16 @@ class Sass::Rails::TestCase < ActiveSupport::TestCase
|
|
59
59
|
#
|
60
60
|
# Automatically changes back to the working directory
|
61
61
|
# and removes the temp directory when done.
|
62
|
-
def within_rails_app(name, without_gems = [],
|
62
|
+
def within_rails_app(name, without_gems = [], gem_options = $gem_options)
|
63
63
|
sourcedir = File.expand_path("../../fixtures/#{name}", __FILE__)
|
64
64
|
Dir.mktmpdir do |tmpdir|
|
65
65
|
FileUtils.cp_r "#{sourcedir}/.", tmpdir
|
66
66
|
Dir.chdir(tmpdir) do
|
67
|
-
|
67
|
+
gem_options.each {|name, options| modify_gem_entry name, options}
|
68
68
|
without_gems.each {|name| remove_gem name}
|
69
|
+
FileUtils.rm("Gemfile.lock")
|
69
70
|
runcmd "bundle install --verbose"
|
70
|
-
yield
|
71
|
+
yield tmpdir
|
71
72
|
end
|
72
73
|
end
|
73
74
|
end
|
@@ -81,23 +82,29 @@ class Sass::Rails::TestCase < ActiveSupport::TestCase
|
|
81
82
|
end
|
82
83
|
end
|
83
84
|
|
84
|
-
def
|
85
|
+
def modify_gem_entry(gemname, options, gemfile = "Gemfile")
|
85
86
|
found = false
|
86
87
|
process_gemfile(gemfile) do |line|
|
87
88
|
if line =~ /gem *(["'])#{Regexp.escape(gemname)}\1/
|
88
89
|
found = true
|
89
|
-
|
90
|
+
gem_entry(gemname, options) + "\n"
|
90
91
|
else
|
91
92
|
line
|
92
93
|
end
|
93
94
|
end
|
94
95
|
unless found
|
95
96
|
File.open(gemfile, "a") do |f|
|
96
|
-
f.print(
|
97
|
+
f.print("\n#{gem_entry(gemname, options)}\n")
|
97
98
|
end
|
98
99
|
end
|
99
100
|
end
|
100
101
|
|
102
|
+
def gem_entry(gemname, options)
|
103
|
+
entry = %Q{gem "#{gemname}", "~> #{options[:version]}"}
|
104
|
+
entry += ", :path => #{options[:path].inspect}" if options[:path]
|
105
|
+
entry
|
106
|
+
end
|
107
|
+
|
101
108
|
def remove_gem(gemname)
|
102
109
|
process_gemfile(gemfile) do |line|
|
103
110
|
line unless line =~ /gem *(["'])#{Regexp.escape(gemname)}\1/
|
data/test/test_helper.rb
CHANGED
@@ -9,20 +9,19 @@ require 'mocha'
|
|
9
9
|
|
10
10
|
Rails.backtrace_cleaner.remove_silencers!
|
11
11
|
|
12
|
-
# Set locations of local gems in this hash.
|
13
|
-
# They will be added/replaced in the generated Gemfiles
|
14
|
-
# You should also set them in the local Gemfile
|
15
|
-
$gem_locations = {
|
16
|
-
"sass-rails" => File.expand_path("../../", __FILE__)
|
17
|
-
}
|
18
|
-
|
19
|
-
# Uncomment this if you need to test against a local rails checkout
|
20
|
-
# $gem_locations["rails"] = "/Users/chris/Projects/rails"
|
21
|
-
# Uncomment this if you need to test against a local sass checkout
|
22
|
-
# $gem_locations["sass"] = "/Users/chris/Projects/sass"
|
23
|
-
# Uncomment this if you need to test against a local sprockets checkout
|
24
|
-
# $gem_locations["sprockets"] = "/Users/chris/Projects/sprockets"
|
25
12
|
|
13
|
+
# If developing against local dependencies, this code will ensure they get picked up
|
14
|
+
# in the project fixtures that have their own bundle environment
|
15
|
+
$gem_options = {}
|
16
|
+
possible_dev_dependencies = %w(sass-rails sass rails actionpack railties sprockets)
|
17
|
+
Bundler.load.specs.each do |s|
|
18
|
+
if possible_dev_dependencies.include?(s.name)
|
19
|
+
gem_path = s.full_gem_path
|
20
|
+
gem_options = {:version => s.version}
|
21
|
+
gem_options[:path] = gem_path if File.exists?("#{gem_path}/#{s.name}.gemspec")
|
22
|
+
$gem_options[s.name] = gem_options
|
23
|
+
end
|
24
|
+
end
|
26
25
|
|
27
26
|
# Load support files
|
28
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
27
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
CHANGED
@@ -1,115 +1,80 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 1
|
9
|
-
- 4
|
10
|
-
version: 3.1.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.1.5.rc.1
|
5
|
+
prerelease: 6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- wycats
|
14
9
|
- chriseppstein
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2011-10-16 00:00:00.000000000Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
23
16
|
name: sass
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &70206023317720 !ruby/object:Gem::Requirement
|
26
18
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 3
|
33
|
-
- 1
|
34
|
-
- 4
|
35
|
-
version: 3.1.4
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.1.10
|
36
23
|
type: :runtime
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: railties
|
40
24
|
prerelease: false
|
41
|
-
|
25
|
+
version_requirements: *70206023317720
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: railties
|
28
|
+
requirement: &70206023317140 !ruby/object:Gem::Requirement
|
42
29
|
none: false
|
43
|
-
requirements:
|
30
|
+
requirements:
|
44
31
|
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
hash: 3
|
47
|
-
segments:
|
48
|
-
- 3
|
49
|
-
- 1
|
50
|
-
- 0
|
32
|
+
- !ruby/object:Gem::Version
|
51
33
|
version: 3.1.0
|
52
34
|
type: :runtime
|
53
|
-
version_requirements: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: actionpack
|
56
35
|
prerelease: false
|
57
|
-
|
36
|
+
version_requirements: *70206023317140
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: actionpack
|
39
|
+
requirement: &70206023316540 !ruby/object:Gem::Requirement
|
58
40
|
none: false
|
59
|
-
requirements:
|
41
|
+
requirements:
|
60
42
|
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
hash: 3
|
63
|
-
segments:
|
64
|
-
- 3
|
65
|
-
- 1
|
66
|
-
- 0
|
43
|
+
- !ruby/object:Gem::Version
|
67
44
|
version: 3.1.0
|
68
45
|
type: :runtime
|
69
|
-
version_requirements: *id003
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: tilt
|
72
46
|
prerelease: false
|
73
|
-
|
47
|
+
version_requirements: *70206023316540
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: tilt
|
50
|
+
requirement: &70206023316000 !ruby/object:Gem::Requirement
|
74
51
|
none: false
|
75
|
-
requirements:
|
52
|
+
requirements:
|
76
53
|
- - ~>
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
hash: 31
|
79
|
-
segments:
|
80
|
-
- 1
|
81
|
-
- 3
|
82
|
-
- 2
|
54
|
+
- !ruby/object:Gem::Version
|
83
55
|
version: 1.3.2
|
84
56
|
type: :runtime
|
85
|
-
version_requirements: *id004
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: sprockets
|
88
57
|
prerelease: false
|
89
|
-
|
58
|
+
version_requirements: *70206023316000
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: sprockets
|
61
|
+
requirement: &70206023315220 !ruby/object:Gem::Requirement
|
90
62
|
none: false
|
91
|
-
requirements:
|
63
|
+
requirements:
|
92
64
|
- - ~>
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
hash: 15
|
95
|
-
segments:
|
96
|
-
- 2
|
97
|
-
- 0
|
98
|
-
- 0
|
65
|
+
- !ruby/object:Gem::Version
|
99
66
|
version: 2.0.0
|
100
67
|
type: :runtime
|
101
|
-
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *70206023315220
|
102
70
|
description: Sass adapter for the Rails asset pipeline.
|
103
|
-
email:
|
71
|
+
email:
|
104
72
|
- wycats@gmail.com
|
105
73
|
- chris@eppsteins.net
|
106
74
|
executables: []
|
107
|
-
|
108
75
|
extensions: []
|
109
|
-
|
110
76
|
extra_rdoc_files: []
|
111
|
-
|
112
|
-
files:
|
77
|
+
files:
|
113
78
|
- .gitignore
|
114
79
|
- CHANGELOG.md
|
115
80
|
- Gemfile
|
@@ -280,41 +245,31 @@ files:
|
|
280
245
|
- test/sass_rails_test.rb
|
281
246
|
- test/support/sass_rails_test_case.rb
|
282
247
|
- test/test_helper.rb
|
283
|
-
|
284
|
-
homepage: ""
|
248
|
+
homepage: ''
|
285
249
|
licenses: []
|
286
|
-
|
287
250
|
post_install_message:
|
288
251
|
rdoc_options: []
|
289
|
-
|
290
|
-
require_paths:
|
252
|
+
require_paths:
|
291
253
|
- lib
|
292
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
254
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
293
255
|
none: false
|
294
|
-
requirements:
|
295
|
-
- -
|
296
|
-
- !ruby/object:Gem::Version
|
297
|
-
|
298
|
-
|
299
|
-
- 0
|
300
|
-
version: "0"
|
301
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
256
|
+
requirements:
|
257
|
+
- - ! '>='
|
258
|
+
- !ruby/object:Gem::Version
|
259
|
+
version: '0'
|
260
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
302
261
|
none: false
|
303
|
-
requirements:
|
304
|
-
- -
|
305
|
-
- !ruby/object:Gem::Version
|
306
|
-
|
307
|
-
segments:
|
308
|
-
- 0
|
309
|
-
version: "0"
|
262
|
+
requirements:
|
263
|
+
- - ! '>'
|
264
|
+
- !ruby/object:Gem::Version
|
265
|
+
version: 1.3.1
|
310
266
|
requirements: []
|
311
|
-
|
312
267
|
rubyforge_project: sass-rails
|
313
|
-
rubygems_version: 1.
|
268
|
+
rubygems_version: 1.8.10
|
314
269
|
signing_key:
|
315
270
|
specification_version: 3
|
316
271
|
summary: Sass adapter for the Rails asset pipeline.
|
317
|
-
test_files:
|
272
|
+
test_files:
|
318
273
|
- test/fixtures/engine_project/.gitignore
|
319
274
|
- test/fixtures/engine_project/Gemfile
|
320
275
|
- test/fixtures/engine_project/README.rdoc
|