sass 3.4.25 → 3.5.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/README.md +1 -1
- data/Rakefile +13 -157
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/VERSION_NAME +1 -1
- data/lib/sass.rb +3 -10
- data/lib/sass/cache_stores/filesystem.rb +1 -1
- data/lib/sass/css.rb +2 -3
- data/lib/sass/engine.rb +46 -32
- data/lib/sass/environment.rb +27 -6
- data/lib/sass/error.rb +5 -5
- data/lib/sass/exec/base.rb +3 -12
- data/lib/sass/features.rb +1 -0
- data/lib/sass/importers/filesystem.rb +2 -2
- data/lib/sass/plugin.rb +1 -1
- data/lib/sass/plugin/compiler.rb +21 -51
- data/lib/sass/plugin/configuration.rb +1 -1
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/railtie.rb +1 -1
- data/lib/sass/script.rb +3 -3
- data/lib/sass/script/functions.rb +238 -47
- data/lib/sass/script/lexer.rb +8 -6
- data/lib/sass/script/parser.rb +76 -75
- data/lib/sass/script/tree/funcall.rb +35 -30
- data/lib/sass/script/tree/list_literal.rb +23 -8
- data/lib/sass/script/tree/map_literal.rb +2 -2
- data/lib/sass/script/tree/node.rb +2 -10
- data/lib/sass/script/tree/operation.rb +16 -50
- data/lib/sass/script/value.rb +2 -0
- data/lib/sass/script/value/arg_list.rb +1 -1
- data/lib/sass/script/value/base.rb +20 -3
- data/lib/sass/script/value/callable.rb +25 -0
- data/lib/sass/script/value/color.rb +10 -10
- data/lib/sass/script/value/function.rb +19 -0
- data/lib/sass/script/value/helpers.rb +16 -7
- data/lib/sass/script/value/list.rb +33 -12
- data/lib/sass/script/value/map.rb +2 -2
- data/lib/sass/script/value/number.rb +3 -3
- data/lib/sass/script/value/string.rb +12 -5
- data/lib/sass/scss/parser.rb +101 -45
- data/lib/sass/scss/rx.rb +5 -11
- data/lib/sass/scss/static_parser.rb +0 -7
- data/lib/sass/selector.rb +4 -0
- data/lib/sass/selector/abstract_sequence.rb +5 -5
- data/lib/sass/selector/comma_sequence.rb +3 -15
- data/lib/sass/selector/pseudo.rb +4 -0
- data/lib/sass/selector/sequence.rb +30 -3
- data/lib/sass/selector/simple.rb +13 -7
- data/lib/sass/selector/simple_sequence.rb +1 -1
- data/lib/sass/shared.rb +3 -5
- data/lib/sass/source/map.rb +4 -4
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/stack.rb +21 -1
- data/lib/sass/tree/charset_node.rb +1 -1
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/node.rb +3 -3
- data/lib/sass/tree/prop_node.rb +46 -54
- data/lib/sass/tree/rule_node.rb +7 -15
- data/lib/sass/tree/visitors/check_nesting.rb +1 -1
- data/lib/sass/tree/visitors/convert.rb +2 -3
- data/lib/sass/tree/visitors/cssize.rb +1 -10
- data/lib/sass/tree/visitors/deep_copy.rb +2 -2
- data/lib/sass/tree/visitors/perform.rb +23 -12
- data/lib/sass/tree/visitors/set_options.rb +1 -1
- data/lib/sass/tree/visitors/to_css.rb +46 -12
- data/lib/sass/util.rb +16 -321
- data/lib/sass/util/multibyte_string_scanner.rb +127 -131
- data/lib/sass/util/normalized_map.rb +1 -8
- data/lib/sass/version.rb +2 -2
- data/test/sass-spec.yml +1 -1
- data/test/sass/compiler_test.rb +4 -14
- data/test/sass/conversion_test.rb +113 -162
- data/test/sass/css2sass_test.rb +17 -19
- data/test/sass/css_variable_test.rb +176 -70
- data/test/sass/encoding_test.rb +2 -32
- data/test/sass/engine_test.rb +114 -65
- data/test/sass/extend_test.rb +37 -51
- data/test/sass/functions_test.rb +57 -15
- data/test/sass/importer_test.rb +2 -2
- data/test/sass/more_templates/more1.sass +10 -10
- data/test/sass/more_templates/more_import.sass +2 -2
- data/test/sass/plugin_test.rb +9 -12
- data/test/sass/script_conversion_test.rb +9 -0
- data/test/sass/script_test.rb +38 -48
- data/test/sass/scss/css_test.rb +5 -19
- data/test/sass/scss/scss_test.rb +58 -39
- data/test/sass/source_map_test.rb +26 -28
- data/test/sass/templates/_partial.sass +1 -1
- data/test/sass/templates/basic.sass +10 -10
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/bork5.sass +1 -1
- data/test/sass/templates/compact.sass +10 -10
- data/test/sass/templates/complex.sass +187 -187
- data/test/sass/templates/compressed.sass +10 -10
- data/test/sass/templates/expanded.sass +10 -10
- data/test/sass/templates/import.sass +2 -2
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/mixins.sass +22 -22
- data/test/sass/templates/multiline.sass +4 -4
- data/test/sass/templates/nested.sass +13 -13
- data/test/sass/templates/parent_ref.sass +12 -12
- data/test/sass/templates/script.sass +70 -70
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
- data/test/sass/templates/subdir/subdir.sass +3 -3
- data/test/sass/templates/units.sass +10 -10
- data/test/sass/util/multibyte_string_scanner_test.rb +139 -149
- data/test/sass/util_test.rb +0 -36
- data/test/test_helper.rb +39 -0
- metadata +30 -57
- data/extra/sass-spec-ref.sh +0 -32
- data/lib/sass/deprecation.rb +0 -55
- data/lib/sass/script/css_variable_warning.rb +0 -52
- data/lib/sass/util/cross_platform_random.rb +0 -19
- data/lib/sass/util/ordered_hash.rb +0 -192
- data/test/sass/results/import_charset_1_8.css +0 -5
- data/test/sass/templates/import_charset_1_8.sass +0 -6
- data/vendor/listen/CHANGELOG.md +0 -1
- data/vendor/listen/CONTRIBUTING.md +0 -38
- data/vendor/listen/Gemfile +0 -20
- data/vendor/listen/Guardfile +0 -8
- data/vendor/listen/LICENSE +0 -20
- data/vendor/listen/README.md +0 -349
- data/vendor/listen/Rakefile +0 -5
- data/vendor/listen/Vagrantfile +0 -96
- data/vendor/listen/lib/listen.rb +0 -54
- data/vendor/listen/lib/listen/adapter.rb +0 -327
- data/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
- data/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
- data/vendor/listen/lib/listen/adapters/linux.rb +0 -81
- data/vendor/listen/lib/listen/adapters/polling.rb +0 -58
- data/vendor/listen/lib/listen/adapters/windows.rb +0 -91
- data/vendor/listen/lib/listen/directory_record.rb +0 -406
- data/vendor/listen/lib/listen/listener.rb +0 -323
- data/vendor/listen/lib/listen/turnstile.rb +0 -32
- data/vendor/listen/lib/listen/version.rb +0 -3
- data/vendor/listen/listen.gemspec +0 -28
- data/vendor/listen/spec/listen/adapter_spec.rb +0 -149
- data/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
- data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
- data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
- data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
- data/vendor/listen/spec/listen/listener_spec.rb +0 -258
- data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/vendor/listen/spec/listen_spec.rb +0 -67
- data/vendor/listen/spec/spec_helper.rb +0 -25
- data/vendor/listen/spec/support/adapter_helper.rb +0 -666
- data/vendor/listen/spec/support/directory_record_helper.rb +0 -57
- data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/vendor/listen/spec/support/listeners_helper.rb +0 -179
- data/vendor/listen/spec/support/platform_helper.rb +0 -15
@@ -1,57 +0,0 @@
|
|
1
|
-
# Prepares a record for the test and fetches changes
|
2
|
-
# afterwards.
|
3
|
-
#
|
4
|
-
# @param [String] root_path the path to watch
|
5
|
-
# @param [Hash] options
|
6
|
-
# @option options [Array<string>] :paths optional paths fetch changes for
|
7
|
-
# @option options [Boolean] :use_last_record allow the use of an already
|
8
|
-
# created record, handy for ordered tests.
|
9
|
-
#
|
10
|
-
# @return [Array, Array, Array] the changes
|
11
|
-
#
|
12
|
-
def changes(root_path, options = {})
|
13
|
-
unless @record || options[:use_last_record]
|
14
|
-
@record = Listen::DirectoryRecord.new(root_path)
|
15
|
-
@record.filter(options.delete(:filter)) if options[:filter]
|
16
|
-
@record.ignore(options.delete(:ignore)) if options[:ignore]
|
17
|
-
|
18
|
-
# Build the record after adding the filtering and ignoring patterns
|
19
|
-
@record.build
|
20
|
-
end
|
21
|
-
|
22
|
-
yield if block_given?
|
23
|
-
|
24
|
-
paths = options.delete(:paths) || [root_path]
|
25
|
-
options[:recursive] = true if options[:recursive].nil?
|
26
|
-
|
27
|
-
changes = @record.fetch_changes(paths, { :relative_paths => true }.merge(options))
|
28
|
-
|
29
|
-
[changes[:modified], changes[:added], changes[:removed]]
|
30
|
-
end
|
31
|
-
|
32
|
-
# Generates a small time difference before performing a time sensitive
|
33
|
-
# task (like comparing mtimes of files).
|
34
|
-
#
|
35
|
-
# @note Modification time for files only includes the milliseconds on Linux with MRI > 1.9.2
|
36
|
-
# and platform that support it (OS X 10.8 not included),
|
37
|
-
# that's why we generate a difference that's greater than 1 second.
|
38
|
-
#
|
39
|
-
def small_time_difference
|
40
|
-
t = Time.now
|
41
|
-
diff = t.to_f - t.to_i
|
42
|
-
|
43
|
-
sleep(1.05 - diff)
|
44
|
-
end
|
45
|
-
|
46
|
-
# Ensures that the test runs at almost the same second at which
|
47
|
-
# changes are being checked.
|
48
|
-
#
|
49
|
-
def ensure_same_second
|
50
|
-
t = Time.now
|
51
|
-
diff = t.to_f - t.to_i
|
52
|
-
|
53
|
-
# We are not at the end of a second
|
54
|
-
if diff >= (1 - Listen::Adapter::DEFAULT_LATENCY)
|
55
|
-
sleep(1.05 - diff)
|
56
|
-
end
|
57
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'tmpdir'
|
2
|
-
|
3
|
-
include FileUtils
|
4
|
-
|
5
|
-
# Prepares temporary fixture-directories and
|
6
|
-
# cleans them afterwards.
|
7
|
-
#
|
8
|
-
# @param [Fixnum] number_of_directories the number of fixture-directories to make
|
9
|
-
#
|
10
|
-
# @yield [path1, path2, ...] the empty fixture-directories
|
11
|
-
# @yieldparam [String] path the path to a fixture directory
|
12
|
-
#
|
13
|
-
def fixtures(number_of_directories = 1)
|
14
|
-
current_pwd = pwd
|
15
|
-
paths = 1.upto(number_of_directories).map do
|
16
|
-
File.expand_path(File.join(pwd, "spec/.fixtures/#{Time.now.to_f.to_s.sub('.', '') + rand(9999).to_s}"))
|
17
|
-
end
|
18
|
-
|
19
|
-
# Create the dirs
|
20
|
-
paths.each { |p| mkdir_p(p) }
|
21
|
-
|
22
|
-
cd(paths.first) if number_of_directories == 1
|
23
|
-
|
24
|
-
yield(*paths)
|
25
|
-
|
26
|
-
ensure
|
27
|
-
cd current_pwd
|
28
|
-
paths.map { |p| rm_rf(p) if File.exists?(p) }
|
29
|
-
end
|
@@ -1,179 +0,0 @@
|
|
1
|
-
shared_examples_for 'a listener to changes on a file-system' do
|
2
|
-
describe '#start' do
|
3
|
-
before do
|
4
|
-
subject.stub(:initialize_adapter) { adapter }
|
5
|
-
end
|
6
|
-
|
7
|
-
it 'starts the adapter' do
|
8
|
-
adapter.should_receive(:start)
|
9
|
-
subject.start
|
10
|
-
end
|
11
|
-
|
12
|
-
context 'with the blocking deprecated param set to true' do
|
13
|
-
it 'displays a deprecation notice' do
|
14
|
-
Kernel.should_receive(:warn).with(/#{Listen::Listener::BLOCKING_PARAMETER_DEPRECATION_MESSAGE}/)
|
15
|
-
subject.start(true)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
context 'with the blocking deprecated param set to false' do
|
20
|
-
it 'displays a deprecation notice' do
|
21
|
-
Kernel.should_receive(:warn).with(/#{Listen::Listener::BLOCKING_PARAMETER_DEPRECATION_MESSAGE}/)
|
22
|
-
subject.start(false)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe '#start!' do
|
28
|
-
before do
|
29
|
-
subject.stub(:initialize_adapter) { adapter }
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'starts the adapter' do
|
33
|
-
adapter.should_receive(:start!)
|
34
|
-
subject.start!
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'passes the blocking param to the adapter' do
|
38
|
-
adapter.should_receive(:start!)
|
39
|
-
subject.start!
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context 'with a started listener' do
|
44
|
-
before do
|
45
|
-
subject.start
|
46
|
-
end
|
47
|
-
|
48
|
-
describe '#stop' do
|
49
|
-
it "stops adapter" do
|
50
|
-
adapter.should_receive(:stop)
|
51
|
-
subject.stop
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe '#pause' do
|
56
|
-
it 'sets adapter.paused to true' do
|
57
|
-
adapter.should_receive(:pause)
|
58
|
-
subject.pause
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'returns the same listener to allow chaining' do
|
62
|
-
subject.pause.should equal subject
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
describe '#unpause' do
|
67
|
-
it 'sets adapter.paused to false' do
|
68
|
-
adapter.should_receive(:unpause)
|
69
|
-
subject.unpause
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'returns the same listener to allow chaining' do
|
73
|
-
subject.unpause.should equal subject
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
describe '#paused?' do
|
78
|
-
it 'returns false when there is no adapter' do
|
79
|
-
subject.instance_variable_set(:@adapter, nil)
|
80
|
-
subject.should_not be_paused
|
81
|
-
end
|
82
|
-
|
83
|
-
it 'returns true when adapter is paused' do
|
84
|
-
adapter.should_receive(:paused?) { true }
|
85
|
-
subject.should be_paused
|
86
|
-
end
|
87
|
-
|
88
|
-
it 'returns false when adapter is not paused' do
|
89
|
-
adapter.should_receive(:paused?) { false }
|
90
|
-
subject.should_not be_paused
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
describe '#change' do
|
96
|
-
it 'sets the callback block' do
|
97
|
-
callback = lambda { |modified, added, removed| }
|
98
|
-
subject.change(&callback)
|
99
|
-
subject.instance_variable_get(:@block).should eq callback
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'returns the same listener to allow chaining' do
|
103
|
-
subject.change(&Proc.new{}).should equal subject
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe '#ignore' do
|
108
|
-
it 'returns the same listener to allow chaining' do
|
109
|
-
subject.ignore('some_directory').should equal subject
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
describe '#ignore!' do
|
114
|
-
it 'returns the same listener to allow chaining' do
|
115
|
-
subject.ignore!('some_directory').should equal subject
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
describe '#filter' do
|
120
|
-
it 'returns the same listener to allow chaining' do
|
121
|
-
subject.filter(/\.txt$/).should equal subject
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe '#filter!' do
|
126
|
-
it 'returns the same listener to allow chaining' do
|
127
|
-
subject.filter!(/\.txt$/).should equal subject
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
describe '#latency' do
|
132
|
-
it 'sets the latency to @adapter_options' do
|
133
|
-
subject.latency(0.7)
|
134
|
-
subject.instance_variable_get(:@adapter_options).should eq(:latency => 0.7)
|
135
|
-
end
|
136
|
-
|
137
|
-
it 'returns the same listener to allow chaining' do
|
138
|
-
subject.latency(0.7).should equal subject
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
describe '#force_polling' do
|
143
|
-
it 'sets force_polling to @adapter_options' do
|
144
|
-
subject.force_polling(false)
|
145
|
-
subject.instance_variable_get(:@adapter_options).should eq(:force_polling => false)
|
146
|
-
end
|
147
|
-
|
148
|
-
it 'returns the same listener to allow chaining' do
|
149
|
-
subject.force_polling(true).should equal subject
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
describe '#relative_paths' do
|
154
|
-
it 'sets the relative paths option for paths in the callback' do
|
155
|
-
subject.relative_paths(true)
|
156
|
-
subject.instance_variable_get(:@use_relative_paths).should be_true
|
157
|
-
end
|
158
|
-
|
159
|
-
it 'returns the same listener to allow chaining' do
|
160
|
-
subject.relative_paths(true).should equal subject
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
describe '#polling_fallback_message' do
|
165
|
-
it 'sets custom polling fallback message to @adapter_options' do
|
166
|
-
subject.polling_fallback_message('custom message')
|
167
|
-
subject.instance_variable_get(:@adapter_options).should eq(:polling_fallback_message => 'custom message')
|
168
|
-
end
|
169
|
-
|
170
|
-
it 'sets polling fallback message to false in @adapter_options' do
|
171
|
-
subject.polling_fallback_message(false)
|
172
|
-
subject.instance_variable_get(:@adapter_options).should eq(:polling_fallback_message => false)
|
173
|
-
end
|
174
|
-
|
175
|
-
it 'returns the same listener to allow chaining' do
|
176
|
-
subject.polling_fallback_message('custom message').should equal subject
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
def mac?
|
2
|
-
RbConfig::CONFIG['target_os'] =~ /darwin/i
|
3
|
-
end
|
4
|
-
|
5
|
-
def linux?
|
6
|
-
RbConfig::CONFIG['target_os'] =~ /linux/i
|
7
|
-
end
|
8
|
-
|
9
|
-
def bsd?
|
10
|
-
RbConfig::CONFIG['target_os'] =~ /freebsd/i
|
11
|
-
end
|
12
|
-
|
13
|
-
def windows?
|
14
|
-
RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
15
|
-
end
|