sass 3.1.21 → 3.2.0.alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -4
- data/REVISION +1 -1
- data/Rakefile +6 -15
- data/VERSION +1 -1
- data/VERSION_NAME +1 -1
- data/lib/sass.rb +0 -1
- data/lib/sass/cache_stores/base.rb +1 -3
- data/lib/sass/cache_stores/filesystem.rb +0 -3
- data/lib/sass/css.rb +49 -145
- data/lib/sass/engine.rb +23 -47
- data/lib/sass/environment.rb +5 -30
- data/lib/sass/exec.rb +7 -30
- data/lib/sass/importers/base.rb +1 -2
- data/lib/sass/importers/filesystem.rb +13 -18
- data/lib/sass/less.rb +1 -1
- data/lib/sass/plugin.rb +8 -4
- data/lib/sass/plugin/compiler.rb +67 -93
- data/lib/sass/plugin/configuration.rb +2 -0
- data/lib/sass/plugin/staleness_checker.rb +4 -14
- data/lib/sass/repl.rb +3 -2
- data/lib/sass/script.rb +1 -0
- data/lib/sass/script/color.rb +9 -4
- data/lib/sass/script/funcall.rb +3 -16
- data/lib/sass/script/functions.rb +55 -98
- data/lib/sass/script/interpolation.rb +0 -9
- data/lib/sass/script/lexer.rb +4 -2
- data/lib/sass/script/list.rb +0 -8
- data/lib/sass/script/literal.rb +20 -5
- data/lib/sass/script/node.rb +0 -8
- data/lib/sass/script/number.rb +11 -35
- data/lib/sass/script/operation.rb +0 -16
- data/lib/sass/script/parser.rb +5 -12
- data/lib/sass/script/string_interpolation.rb +0 -9
- data/lib/sass/script/unary_operation.rb +0 -7
- data/lib/sass/script/variable.rb +1 -5
- data/lib/sass/scss/parser.rb +54 -191
- data/lib/sass/scss/rx.rb +3 -15
- data/lib/sass/scss/static_parser.rb +3 -3
- data/lib/sass/selector.rb +3 -15
- data/lib/sass/selector/abstract_sequence.rb +2 -11
- data/lib/sass/selector/comma_sequence.rb +3 -8
- data/lib/sass/selector/sequence.rb +11 -74
- data/lib/sass/selector/simple.rb +1 -7
- data/lib/sass/selector/simple_sequence.rb +8 -28
- data/lib/sass/shared.rb +5 -3
- data/lib/sass/tree/comment_node.rb +12 -25
- data/lib/sass/tree/debug_node.rb +1 -1
- data/lib/sass/tree/directive_node.rb +0 -5
- data/lib/sass/tree/each_node.rb +1 -1
- data/lib/sass/tree/extend_node.rb +1 -1
- data/lib/sass/tree/for_node.rb +2 -2
- data/lib/sass/tree/function_node.rb +1 -1
- data/lib/sass/tree/if_node.rb +14 -1
- data/lib/sass/tree/media_node.rb +4 -4
- data/lib/sass/tree/mixin_def_node.rb +1 -1
- data/lib/sass/tree/mixin_node.rb +2 -2
- data/lib/sass/tree/node.rb +26 -10
- data/lib/sass/tree/return_node.rb +1 -1
- data/lib/sass/tree/root_node.rb +1 -1
- data/lib/sass/tree/rule_node.rb +11 -9
- data/lib/sass/tree/variable_node.rb +1 -1
- data/lib/sass/tree/visitors/base.rb +1 -1
- data/lib/sass/tree/visitors/check_nesting.rb +36 -29
- data/lib/sass/tree/visitors/convert.rb +9 -16
- data/lib/sass/tree/visitors/cssize.rb +9 -40
- data/lib/sass/tree/visitors/perform.rb +23 -79
- data/lib/sass/tree/visitors/to_css.rb +21 -23
- data/lib/sass/tree/warn_node.rb +1 -1
- data/lib/sass/tree/while_node.rb +1 -1
- data/lib/sass/util.rb +9 -147
- data/lib/sass/version.rb +0 -14
- data/test/sass/cache_test.rb +0 -15
- data/test/sass/conversion_test.rb +8 -50
- data/test/sass/css2sass_test.rb +0 -33
- data/test/sass/engine_test.rb +32 -283
- data/test/sass/extend_test.rb +0 -315
- data/test/sass/functions_test.rb +23 -60
- data/test/sass/importer_test.rb +0 -110
- data/test/sass/more_results/more_import.css +2 -2
- data/test/sass/plugin_test.rb +13 -40
- data/test/sass/results/import.css +2 -2
- data/test/sass/results/import_charset.css +0 -1
- data/test/sass/results/import_charset_1_8.css +0 -1
- data/test/sass/results/import_charset_ibm866.css +0 -1
- data/test/sass/results/scss_import.css +2 -2
- data/test/sass/results/units.css +1 -1
- data/test/sass/script_conversion_test.rb +0 -2
- data/test/sass/script_test.rb +4 -28
- data/test/sass/scss/css_test.rb +1 -79
- data/test/sass/scss/scss_test.rb +16 -96
- data/test/sass/templates/import_charset.sass +0 -2
- data/test/sass/templates/import_charset_1_8.sass +0 -2
- data/test/sass/templates/import_charset_ibm866.sass +0 -2
- data/test/sass/test_helper.rb +1 -1
- data/test/sass/util_test.rb +0 -28
- data/test/test_helper.rb +0 -2
- data/vendor/{listen → fssm}/LICENSE +1 -1
- data/vendor/fssm/README.markdown +55 -0
- data/vendor/fssm/Rakefile +59 -0
- data/vendor/fssm/VERSION.yml +5 -0
- data/vendor/fssm/example.rb +9 -0
- data/vendor/fssm/fssm.gemspec +77 -0
- data/vendor/fssm/lib/fssm.rb +33 -0
- data/vendor/fssm/lib/fssm/backends/fsevents.rb +36 -0
- data/vendor/fssm/lib/fssm/backends/inotify.rb +26 -0
- data/vendor/fssm/lib/fssm/backends/polling.rb +25 -0
- data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +131 -0
- data/vendor/fssm/lib/fssm/monitor.rb +26 -0
- data/vendor/fssm/lib/fssm/path.rb +91 -0
- data/vendor/fssm/lib/fssm/pathname.rb +502 -0
- data/vendor/fssm/lib/fssm/state/directory.rb +57 -0
- data/vendor/fssm/lib/fssm/state/file.rb +24 -0
- data/vendor/fssm/lib/fssm/support.rb +63 -0
- data/vendor/fssm/lib/fssm/tree.rb +176 -0
- data/vendor/fssm/profile/prof-cache.rb +40 -0
- data/vendor/fssm/profile/prof-fssm-pathname.html +1231 -0
- data/vendor/fssm/profile/prof-pathname.rb +68 -0
- data/vendor/fssm/profile/prof-plain-pathname.html +988 -0
- data/vendor/fssm/profile/prof.html +2379 -0
- data/vendor/fssm/spec/path_spec.rb +75 -0
- data/vendor/fssm/spec/root/duck/quack.txt +0 -0
- data/vendor/fssm/spec/root/file.css +0 -0
- data/vendor/fssm/spec/root/file.rb +0 -0
- data/vendor/fssm/spec/root/file.yml +0 -0
- data/vendor/fssm/spec/root/moo/cow.txt +0 -0
- data/vendor/fssm/spec/spec_helper.rb +14 -0
- metadata +246 -281
- data/VERSION_DATE +0 -1
- data/lib/sass/logger.rb +0 -15
- data/lib/sass/logger/base.rb +0 -32
- data/lib/sass/logger/log_level.rb +0 -49
- data/lib/sass/tree/visitors/deep_copy.rb +0 -87
- data/lib/sass/tree/visitors/extend.rb +0 -42
- data/lib/sass/tree/visitors/set_options.rb +0 -97
- data/lib/sass/util/multibyte_string_scanner.rb +0 -134
- data/test/Gemfile +0 -4
- data/test/Gemfile.lock +0 -19
- data/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
- data/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
- data/test/sass/logger_test.rb +0 -58
- data/test/sass/templates/_double_import_loop2.sass +0 -1
- data/test/sass/templates/bork5.sass +0 -3
- data/test/sass/templates/double_import_loop1.sass +0 -1
- data/test/sass/templates/nested_bork5.sass +0 -2
- data/test/sass/templates/single_import_loop.sass +0 -1
- data/test/sass/util/multibyte_string_scanner_test.rb +0 -147
- data/vendor/listen/CHANGELOG.md +0 -147
- data/vendor/listen/Gemfile +0 -23
- data/vendor/listen/Guardfile +0 -8
- data/vendor/listen/README.md +0 -312
- data/vendor/listen/Rakefile +0 -47
- data/vendor/listen/Vagrantfile +0 -96
- data/vendor/listen/lib/listen.rb +0 -38
- data/vendor/listen/lib/listen/adapter.rb +0 -167
- data/vendor/listen/lib/listen/adapters/darwin.rb +0 -84
- data/vendor/listen/lib/listen/adapters/linux.rb +0 -110
- data/vendor/listen/lib/listen/adapters/polling.rb +0 -66
- data/vendor/listen/lib/listen/adapters/windows.rb +0 -81
- data/vendor/listen/lib/listen/directory_record.rb +0 -318
- data/vendor/listen/lib/listen/listener.rb +0 -203
- data/vendor/listen/lib/listen/multi_listener.rb +0 -121
- data/vendor/listen/lib/listen/turnstile.rb +0 -28
- data/vendor/listen/lib/listen/version.rb +0 -3
- data/vendor/listen/listen.gemspec +0 -26
- data/vendor/listen/spec/listen/adapter_spec.rb +0 -142
- data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -31
- data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -41
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -24
- data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1138
- data/vendor/listen/spec/listen/listener_spec.rb +0 -155
- data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -156
- data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/vendor/listen/spec/listen_spec.rb +0 -73
- data/vendor/listen/spec/spec_helper.rb +0 -18
- data/vendor/listen/spec/support/adapter_helper.rb +0 -716
- data/vendor/listen/spec/support/directory_record_helper.rb +0 -55
- data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/vendor/listen/spec/support/listeners_helper.rb +0 -144
- data/vendor/listen/spec/support/platform_helper.rb +0 -11
@@ -1,55 +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
|
-
# that's why we generate a difference that's greater than 1 second.
|
37
|
-
#
|
38
|
-
def small_time_difference
|
39
|
-
t = Time.now
|
40
|
-
diff = t.to_f - t.to_i
|
41
|
-
|
42
|
-
sleep( 1.5 - (diff < 0.5 ? diff : 0.4) )
|
43
|
-
end
|
44
|
-
|
45
|
-
# Ensures that the test runs at almost the same second at which
|
46
|
-
# changes are being checked.
|
47
|
-
#
|
48
|
-
def ensure_same_second
|
49
|
-
t = Time.now
|
50
|
-
diff = t.to_f - t.to_i
|
51
|
-
|
52
|
-
if diff > 0.1 # We are not at the beginning of a second
|
53
|
-
sleep 1.1 - diff # 1.1 is used instead of 1 to account for the processing time (estimated at 0.1 sec)
|
54
|
-
end
|
55
|
-
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,144 +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 param set to false' do
|
13
|
-
it 'passes the blocking param to the adapter' do
|
14
|
-
adapter.should_receive(:start).with(false)
|
15
|
-
subject.start(false)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context 'with a started listener' do
|
21
|
-
before do
|
22
|
-
subject.start
|
23
|
-
end
|
24
|
-
|
25
|
-
describe '#stop' do
|
26
|
-
it "stops adapter" do
|
27
|
-
adapter.should_receive(:stop)
|
28
|
-
subject.stop
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe '#pause' do
|
33
|
-
it 'sets adapter.paused to true' do
|
34
|
-
adapter.should_receive(:paused=).with(true)
|
35
|
-
subject.pause
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'returns the same listener to allow chaining' do
|
39
|
-
subject.pause.should equal subject
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
describe '#unpause' do
|
44
|
-
it 'sets adapter.paused to false' do
|
45
|
-
adapter.should_receive(:paused=).with(false)
|
46
|
-
subject.unpause
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'returns the same listener to allow chaining' do
|
50
|
-
subject.unpause.should equal subject
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe '#paused?' do
|
55
|
-
it 'returns false when there is no adapter' do
|
56
|
-
subject.instance_variable_set(:@adapter, nil)
|
57
|
-
subject.should_not be_paused
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'returns true when adapter is paused' do
|
61
|
-
adapter.should_receive(:paused) { true }
|
62
|
-
subject.should be_paused
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'returns false when adapter is not paused' do
|
66
|
-
adapter.should_receive(:paused) { false }
|
67
|
-
subject.should_not be_paused
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
describe '#change' do
|
73
|
-
it 'sets the callback block' do
|
74
|
-
callback = lambda { |modified, added, removed| }
|
75
|
-
subject.change(&callback)
|
76
|
-
subject.instance_variable_get(:@block).should eq callback
|
77
|
-
end
|
78
|
-
|
79
|
-
it 'returns the same listener to allow chaining' do
|
80
|
-
subject.change(&Proc.new{}).should equal subject
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
describe '#ignore'do
|
85
|
-
it 'returns the same listener to allow chaining' do
|
86
|
-
subject.ignore('some_directory').should equal subject
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
describe '#filter' do
|
91
|
-
it 'returns the same listener to allow chaining' do
|
92
|
-
subject.filter(/\.txt$/).should equal subject
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
describe '#latency' do
|
97
|
-
it 'sets the latency to @adapter_options' do
|
98
|
-
subject.latency(0.7)
|
99
|
-
subject.instance_variable_get(:@adapter_options).should eq(:latency => 0.7)
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'returns the same listener to allow chaining' do
|
103
|
-
subject.latency(0.7).should equal subject
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe '#force_polling' do
|
108
|
-
it 'sets force_polling to @adapter_options' do
|
109
|
-
subject.force_polling(false)
|
110
|
-
subject.instance_variable_get(:@adapter_options).should eq(:force_polling => false)
|
111
|
-
end
|
112
|
-
|
113
|
-
it 'returns the same listener to allow chaining' do
|
114
|
-
subject.force_polling(true).should equal subject
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
describe '#relative_paths' do
|
119
|
-
it 'sets the relative paths option for paths in the callback' do
|
120
|
-
subject.relative_paths(true)
|
121
|
-
subject.instance_variable_get(:@use_relative_paths).should be_true
|
122
|
-
end
|
123
|
-
|
124
|
-
it 'returns the same listener to allow chaining' do
|
125
|
-
subject.relative_paths(true).should equal subject
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
describe '#polling_fallback_message' do
|
130
|
-
it 'sets custom polling fallback message to @adapter_options' do
|
131
|
-
subject.polling_fallback_message('custom message')
|
132
|
-
subject.instance_variable_get(:@adapter_options).should eq(:polling_fallback_message => 'custom message')
|
133
|
-
end
|
134
|
-
|
135
|
-
it 'sets polling fallback message to false in @adapter_options' do
|
136
|
-
subject.polling_fallback_message(false)
|
137
|
-
subject.instance_variable_get(:@adapter_options).should eq(:polling_fallback_message => false)
|
138
|
-
end
|
139
|
-
|
140
|
-
it 'returns the same listener to allow chaining' do
|
141
|
-
subject.polling_fallback_message('custom message').should equal subject
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|