sass 3.2.0.alpha.64 → 3.2.0.alpha.70
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.
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/lib/sass/css.rb +2 -0
- data/lib/sass/engine.rb +1 -1
- data/lib/sass/exec.rb +24 -3
- data/lib/sass/plugin/staleness_checker.rb +14 -4
- data/lib/sass/repl.rb +2 -2
- data/lib/sass/script/color.rb +150 -19
- data/lib/sass/script/functions.rb +36 -7
- data/lib/sass/script/parser.rb +1 -1
- data/lib/sass/scss/parser.rb +1 -1
- data/lib/sass/tree/visitors/convert.rb +4 -2
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/perform.rb +3 -1
- data/test/sass/conversion_test.rb +321 -95
- data/test/sass/engine_test.rb +7 -0
- data/test/sass/extend_test.rb +14 -0
- data/test/sass/functions_test.rb +13 -3
- data/test/sass/less_conversion_test.rb +162 -79
- data/test/sass/plugin_test.rb +24 -0
- data/test/sass/templates/_double_import_loop2.sass +1 -0
- data/test/sass/templates/double_import_loop1.sass +1 -0
- data/test/sass/templates/single_import_loop.sass +1 -0
- data/vendor/fssm/ext/rakefile.rb +14 -0
- data/vendor/fssm/fssm.gemspec +3 -0
- data/vendor/fssm/lib/fssm.rb +57 -20
- data/vendor/fssm/lib/fssm/support.rb +20 -25
- data/vendor/fssm/lib/fssm/version.rb +1 -1
- metadata +12 -8
data/test/sass/plugin_test.rb
CHANGED
@@ -110,6 +110,30 @@ CSS
|
|
110
110
|
File.delete(tempfile_loc('bork1'))
|
111
111
|
end
|
112
112
|
|
113
|
+
def test_single_level_import_loop
|
114
|
+
File.delete(tempfile_loc('single_import_loop'))
|
115
|
+
check_for_updates!
|
116
|
+
File.open(tempfile_loc('single_import_loop')) do |file|
|
117
|
+
assert_equal(<<CSS.strip, file.read.split("\n")[0...2].join("\n"))
|
118
|
+
/*
|
119
|
+
Sass::SyntaxError: An @import loop has been found: #{template_loc('single_import_loop')} imports itself
|
120
|
+
CSS
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_double_level_import_loop
|
125
|
+
File.delete(tempfile_loc('double_import_loop1'))
|
126
|
+
check_for_updates!
|
127
|
+
File.open(tempfile_loc('double_import_loop1')) do |file|
|
128
|
+
assert_equal(<<CSS.strip, file.read.split("\n")[0...4].join("\n"))
|
129
|
+
/*
|
130
|
+
Sass::SyntaxError: An @import loop has been found:
|
131
|
+
#{template_loc('double_import_loop1')} imports #{template_loc('_double_import_loop2')}
|
132
|
+
#{template_loc('_double_import_loop2')} imports #{template_loc('double_import_loop1')}
|
133
|
+
CSS
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
113
137
|
def test_nonfull_exception_handling
|
114
138
|
old_full_exception = Sass::Plugin.options[:full_exception]
|
115
139
|
Sass::Plugin.options[:full_exception] = false
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "double_import_loop1"
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "double_import_loop2"
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "single_import_loop"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', File.dirname(__FILE__)))
|
3
|
+
|
4
|
+
require 'rubygems/dependency_installer'
|
5
|
+
require 'fssm'
|
6
|
+
|
7
|
+
# semi-elegant solution or hack? *shrug*
|
8
|
+
task :default do
|
9
|
+
name, version = FSSM::Support.optimal_backend_dependency
|
10
|
+
if name and version
|
11
|
+
installer = Gem::DependencyInstaller.new({:domain => :both, :env_shebang => true})
|
12
|
+
installer.install name, version
|
13
|
+
end
|
14
|
+
end
|
data/vendor/fssm/fssm.gemspec
CHANGED
@@ -19,6 +19,9 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
|
+
|
23
|
+
# s.extensions = 'ext/rakefile.rb'
|
22
24
|
|
25
|
+
s.add_development_dependency "rake"
|
23
26
|
s.add_development_dependency "rspec", ">= 2.4.0"
|
24
27
|
end
|
data/vendor/fssm/lib/fssm.rb
CHANGED
@@ -1,12 +1,62 @@
|
|
1
|
-
dir = File.dirname(__FILE__)
|
1
|
+
dir = File.expand_path(File.dirname(__FILE__))
|
2
2
|
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
3
3
|
|
4
|
-
|
5
|
-
module FSSM
|
6
|
-
FileNotFoundError = Class.new(StandardError)
|
7
|
-
FileNotRealError = Class.new(StandardError)
|
8
|
-
CallbackError = Class.new(StandardError)
|
4
|
+
require 'thread'
|
9
5
|
|
6
|
+
module FSSM
|
7
|
+
|
8
|
+
FSSMError = Class.new(StandardError)
|
9
|
+
FileNotFoundError = Class.new(FSSMError)
|
10
|
+
FileNotRealError = Class.new(FSSMError)
|
11
|
+
CallbackError = Class.new(FSSMError)
|
12
|
+
|
13
|
+
autoload :VERSION, 'fssm/version'
|
14
|
+
autoload :Pathname, 'fssm/pathname'
|
15
|
+
autoload :Support, 'fssm/support'
|
16
|
+
autoload :Tree, 'fssm/tree'
|
17
|
+
autoload :Path, 'fssm/path'
|
18
|
+
autoload :Monitor, 'fssm/monitor'
|
19
|
+
|
20
|
+
module State
|
21
|
+
autoload :Directory, 'fssm/state/directory'
|
22
|
+
autoload :File, 'fssm/state/file'
|
23
|
+
end
|
24
|
+
|
25
|
+
module Backends
|
26
|
+
autoload :Polling, 'fssm/backends/polling'
|
27
|
+
autoload :FSEvents, 'fssm/backends/fsevents'
|
28
|
+
autoload :RBFSEvent, 'fssm/backends/rbfsevent'
|
29
|
+
autoload :Inotify, 'fssm/backends/inotify'
|
30
|
+
|
31
|
+
class << self
|
32
|
+
def set_backend(const_symbol=nil, value=nil)
|
33
|
+
const_symbol ||= :Default
|
34
|
+
value ||= ::FSSM::Support.backend
|
35
|
+
|
36
|
+
if (value.is_a?(Symbol) || value.is_a?(String))
|
37
|
+
unless const_defined?(value)
|
38
|
+
raise NameError,
|
39
|
+
"uninitialized constant FSSM::Backends::#{value}"
|
40
|
+
end
|
41
|
+
value = const_get(value)
|
42
|
+
end
|
43
|
+
|
44
|
+
unless value.is_a?(Class)
|
45
|
+
raise ArgumentError,
|
46
|
+
"value must be a class or the symbol of an existing backend"
|
47
|
+
end
|
48
|
+
|
49
|
+
remove_const(const_symbol) if const_defined?(const_symbol)
|
50
|
+
const_set(const_symbol, value)
|
51
|
+
end
|
52
|
+
|
53
|
+
def const_missing(symbol)
|
54
|
+
symbol == :Default ? set_backend(symbol, FSSM::Support.backend) : super
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
10
60
|
class << self
|
11
61
|
def dbg(msg=nil)
|
12
62
|
STDERR.puts("FSSM -> #{msg}")
|
@@ -20,18 +70,5 @@ module FSSM
|
|
20
70
|
monitor.run
|
21
71
|
end
|
22
72
|
end
|
73
|
+
|
23
74
|
end
|
24
|
-
|
25
|
-
require 'thread'
|
26
|
-
|
27
|
-
require 'fssm/version'
|
28
|
-
require 'fssm/pathname'
|
29
|
-
require 'fssm/support'
|
30
|
-
require 'fssm/tree'
|
31
|
-
require 'fssm/path'
|
32
|
-
require 'fssm/state/directory'
|
33
|
-
require 'fssm/state/file'
|
34
|
-
require 'fssm/monitor'
|
35
|
-
|
36
|
-
require "fssm/backends/#{FSSM::Support.backend.downcase}"
|
37
|
-
FSSM::Backends::Default = FSSM::Backends.const_get(FSSM::Support.backend)
|
@@ -3,29 +3,24 @@ require 'rbconfig'
|
|
3
3
|
module FSSM::Support
|
4
4
|
class << self
|
5
5
|
def usable_backend
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
FSSM.dbg("An optimized backend is available for this platform!")
|
25
|
-
FSSM.dbg(" gem install #{optimal}")
|
6
|
+
case
|
7
|
+
when mac? && !lion? && !jruby? && carbon_core?
|
8
|
+
'FSEvents'
|
9
|
+
when mac? && rb_fsevent?
|
10
|
+
'RBFSEvent'
|
11
|
+
when linux? && rb_inotify?
|
12
|
+
'Inotify'
|
13
|
+
else
|
14
|
+
'Polling'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def optimal_backend_dependency
|
19
|
+
return case
|
20
|
+
when mac? then ['rb-fsevent', '>= 0.4.3.1']
|
21
|
+
when linux? then ['rb-inotify', '>= 0.8.8']
|
22
|
+
else [nil, nil]
|
26
23
|
end
|
27
|
-
|
28
|
-
choice
|
29
24
|
end
|
30
25
|
|
31
26
|
def backend
|
@@ -37,15 +32,15 @@ module FSSM::Support
|
|
37
32
|
end
|
38
33
|
|
39
34
|
def mac?
|
40
|
-
|
35
|
+
RbConfig::CONFIG['target_os'] =~ /darwin/i
|
41
36
|
end
|
42
37
|
|
43
38
|
def lion?
|
44
|
-
|
39
|
+
RbConfig::CONFIG['target_os'] =~ /darwin11/i
|
45
40
|
end
|
46
41
|
|
47
42
|
def linux?
|
48
|
-
|
43
|
+
RbConfig::CONFIG['target_os'] =~ /linux/i
|
49
44
|
end
|
50
45
|
|
51
46
|
def carbon_core?
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 592302993
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 3.2.0.alpha.
|
11
|
+
- 70
|
12
|
+
version: 3.2.0.alpha.70
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Nathan Weizenbaum
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2012-02-
|
22
|
+
date: 2012-02-09 00:00:00 -05:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
@@ -86,7 +86,7 @@ files:
|
|
86
86
|
- lib/sass/logger.rb
|
87
87
|
- lib/sass/logger/base.rb
|
88
88
|
- lib/sass/logger/log_level.rb
|
89
|
-
- lib/sass/
|
89
|
+
- lib/sass/repl.rb
|
90
90
|
- lib/sass/plugin.rb
|
91
91
|
- lib/sass/plugin/compiler.rb
|
92
92
|
- lib/sass/plugin/configuration.rb
|
@@ -96,7 +96,7 @@ files:
|
|
96
96
|
- lib/sass/plugin/rails.rb
|
97
97
|
- lib/sass/plugin/staleness_checker.rb
|
98
98
|
- lib/sass/railtie.rb
|
99
|
-
- lib/sass/
|
99
|
+
- lib/sass/media.rb
|
100
100
|
- lib/sass/root.rb
|
101
101
|
- lib/sass/script.rb
|
102
102
|
- lib/sass/script/bool.rb
|
@@ -151,7 +151,6 @@ files:
|
|
151
151
|
- lib/sass/tree/root_node.rb
|
152
152
|
- lib/sass/tree/rule_node.rb
|
153
153
|
- lib/sass/tree/content_node.rb
|
154
|
-
- lib/sass/tree/trace_node.rb
|
155
154
|
- lib/sass/tree/variable_node.rb
|
156
155
|
- lib/sass/tree/visitors/base.rb
|
157
156
|
- lib/sass/tree/visitors/check_nesting.rb
|
@@ -163,7 +162,8 @@ files:
|
|
163
162
|
- lib/sass/tree/visitors/to_css.rb
|
164
163
|
- lib/sass/tree/warn_node.rb
|
165
164
|
- lib/sass/tree/while_node.rb
|
166
|
-
- lib/sass/
|
165
|
+
- lib/sass/tree/trace_node.rb
|
166
|
+
- lib/sass/util.rb
|
167
167
|
- lib/sass/util/multibyte_string_scanner.rb
|
168
168
|
- lib/sass/util/subset_map.rb
|
169
169
|
- lib/sass/version.rb
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- vendor/fssm/README.markdown
|
173
173
|
- vendor/fssm/Rakefile
|
174
174
|
- vendor/fssm/example.rb
|
175
|
+
- vendor/fssm/ext/rakefile.rb
|
175
176
|
- vendor/fssm/fssm.gemspec
|
176
177
|
- vendor/fssm/lib/fssm.rb
|
177
178
|
- vendor/fssm/lib/fssm/backends/fsevents.rb
|
@@ -306,6 +307,9 @@ files:
|
|
306
307
|
- test/sass/templates/units.sass
|
307
308
|
- test/sass/templates/warn.sass
|
308
309
|
- test/sass/templates/warn_imported.sass
|
310
|
+
- test/sass/templates/_double_import_loop2.sass
|
311
|
+
- test/sass/templates/double_import_loop1.sass
|
312
|
+
- test/sass/templates/single_import_loop.sass
|
309
313
|
- test/sass/test_helper.rb
|
310
314
|
- test/sass/util/multibyte_string_scanner_test.rb
|
311
315
|
- test/sass/util/subset_map_test.rb
|