sass 3.3.0 → 3.3.1
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/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/importers/filesystem.rb +3 -3
- data/lib/sass/plugin/compiler.rb +95 -52
- data/lib/sass/script/functions.rb +1 -1
- data/lib/sass/source/map.rb +3 -3
- data/lib/sass/util.rb +16 -1
- data/vendor/listen/CHANGELOG.md +175 -35
- data/vendor/listen/Gemfile +5 -15
- data/vendor/listen/README.md +111 -77
- data/vendor/listen/Rakefile +0 -42
- data/vendor/listen/lib/listen.rb +33 -19
- data/vendor/listen/lib/listen/adapter.rb +193 -82
- data/vendor/listen/lib/listen/adapters/bsd.rb +27 -64
- data/vendor/listen/lib/listen/adapters/darwin.rb +21 -58
- data/vendor/listen/lib/listen/adapters/linux.rb +23 -55
- data/vendor/listen/lib/listen/adapters/polling.rb +25 -34
- data/vendor/listen/lib/listen/adapters/windows.rb +50 -46
- data/vendor/listen/lib/listen/directory_record.rb +96 -61
- data/vendor/listen/lib/listen/listener.rb +135 -37
- data/vendor/listen/lib/listen/turnstile.rb +9 -5
- data/vendor/listen/lib/listen/version.rb +1 -1
- data/vendor/listen/listen.gemspec +6 -0
- data/vendor/listen/spec/listen/adapter_spec.rb +37 -82
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +8 -8
- data/vendor/listen/spec/listen/directory_record_spec.rb +81 -56
- data/vendor/listen/spec/listen/listener_spec.rb +128 -39
- data/vendor/listen/spec/listen_spec.rb +15 -21
- data/vendor/listen/spec/spec_helper.rb +4 -0
- data/vendor/listen/spec/support/adapter_helper.rb +52 -15
- data/vendor/listen/spec/support/directory_record_helper.rb +7 -5
- data/vendor/listen/spec/support/listeners_helper.rb +30 -7
- metadata +3 -23
- data/ext/mkrf_conf.rb +0 -27
- data/vendor/listen/lib/listen/dependency_manager.rb +0 -126
- data/vendor/listen/lib/listen/multi_listener.rb +0 -143
- data/vendor/listen/spec/listen/dependency_manager_spec.rb +0 -107
- data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -174
@@ -1,107 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Listen::DependencyManager do
|
4
|
-
let(:dependency) { Listen::DependencyManager::Dependency.new('listen', '~> 0.0.1') }
|
5
|
-
|
6
|
-
subject { Class.new { extend Listen::DependencyManager } }
|
7
|
-
|
8
|
-
before { described_class.clear_loaded }
|
9
|
-
|
10
|
-
describe '.add_loaded' do
|
11
|
-
it 'adds a dependency to the list of loaded dependencies' do
|
12
|
-
described_class.add_loaded dependency
|
13
|
-
described_class.already_loaded?(dependency).should be_true
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe '.already_loaded?' do
|
18
|
-
it 'returns false when a dependency is not in the list of loaded dependencies' do
|
19
|
-
described_class.already_loaded?(dependency).should be_false
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'returns true when a dependency is in the list of loaded dependencies' do
|
23
|
-
described_class.add_loaded dependency
|
24
|
-
described_class.already_loaded?(dependency).should be_true
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe '.clear_loaded' do
|
29
|
-
it 'clears the whole list of loaded dependencies' do
|
30
|
-
described_class.add_loaded dependency
|
31
|
-
described_class.already_loaded?(dependency).should be_true
|
32
|
-
described_class.clear_loaded
|
33
|
-
described_class.already_loaded?(dependency).should be_false
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe '#dependency' do
|
38
|
-
it 'registers a new dependency for the managed class' do
|
39
|
-
subject.dependency 'listen', '~> 0.0.1'
|
40
|
-
subject.dependencies_loaded?.should be_false
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe '#load_depenencies' do
|
45
|
-
before { subject.dependency 'listen', '~> 0.0.1' }
|
46
|
-
|
47
|
-
context 'when dependencies can be loaded' do
|
48
|
-
before { subject.stub(:gem, :require) }
|
49
|
-
|
50
|
-
it 'loads all the registerd dependencies' do
|
51
|
-
subject.load_depenencies
|
52
|
-
subject.dependencies_loaded?.should be_true
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
context 'when dependencies can not be loaded' do
|
57
|
-
it 'raises an error' do
|
58
|
-
expect {
|
59
|
-
subject.load_depenencies
|
60
|
-
}.to raise_error(described_class::Error)
|
61
|
-
end
|
62
|
-
|
63
|
-
context 'when running under bundler' do
|
64
|
-
before { subject.should_receive(:running_under_bundler?).and_return(true) }
|
65
|
-
|
66
|
-
it 'includes the Gemfile declaration to satisfy the dependency' do
|
67
|
-
begin
|
68
|
-
subject.load_depenencies
|
69
|
-
rescue described_class::Error => e
|
70
|
-
e.message.should include("gem 'listen', '~> 0.0.1'")
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
context 'when not running under bundler' do
|
76
|
-
before { subject.should_receive(:running_under_bundler?).and_return(false) }
|
77
|
-
|
78
|
-
it 'includes the command to install the dependency' do
|
79
|
-
begin
|
80
|
-
subject.load_depenencies
|
81
|
-
rescue described_class::Error => e
|
82
|
-
e.message.should include("gem install --version '~> 0.0.1' listen")
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
describe '#dependencies_loaded?' do
|
90
|
-
it 'return false when dependencies are not loaded' do
|
91
|
-
subject.dependency 'listen', '~> 0.0.1'
|
92
|
-
subject.dependencies_loaded?.should be_false
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'return true when dependencies are loaded' do
|
96
|
-
subject.stub(:gem, :require)
|
97
|
-
|
98
|
-
subject.dependency 'listen', '~> 0.0.1'
|
99
|
-
subject.load_depenencies
|
100
|
-
subject.dependencies_loaded?.should be_true
|
101
|
-
end
|
102
|
-
|
103
|
-
it 'return true when there are no dependencies to load' do
|
104
|
-
subject.dependencies_loaded?.should be_true
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
@@ -1,174 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Listen::MultiListener do
|
4
|
-
let(:adapter) { mock(Listen::Adapter, :start => true).as_null_object }
|
5
|
-
let(:watched_directories) { [File.dirname(__FILE__), File.expand_path('../..', __FILE__)] }
|
6
|
-
|
7
|
-
subject { described_class.new(*watched_directories) }
|
8
|
-
|
9
|
-
before do
|
10
|
-
Listen::Adapter.stub(:select_and_initialize) { adapter }
|
11
|
-
# Don't build a record of the files inside the base directory.
|
12
|
-
Listen::DirectoryRecord.any_instance.stub(:build)
|
13
|
-
end
|
14
|
-
|
15
|
-
it_should_behave_like 'a listener to changes on a file-system'
|
16
|
-
|
17
|
-
describe '#initialize' do
|
18
|
-
context 'with no options' do
|
19
|
-
it 'sets the directories' do
|
20
|
-
subject.directories.should =~ watched_directories
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'converts the passed paths into absolute paths - #21' do
|
24
|
-
paths = watched_directories.map { |d| File.join(d, '..') }
|
25
|
-
described_class.new(*paths).directories.should =~ watched_directories.map{ |d| File.expand_path('..', d) }
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
context 'with custom options' do
|
30
|
-
subject do
|
31
|
-
args = watched_directories << {:ignore => /\.ssh/, :filter => [/.*\.rb/,/.*\.md/], :latency => 0.5, :force_polling => true}
|
32
|
-
described_class.new(*args)
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'passes the custom ignored paths to each directory record' do
|
36
|
-
subject.directories_records.each do |r|
|
37
|
-
r.ignoring_patterns.should include /\.ssh/
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'passes the custom filters to each directory record' do
|
42
|
-
subject.directories_records.each do |r|
|
43
|
-
r.filtering_patterns.should =~ [/.*\.rb/,/.*\.md/]
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'sets adapter_options' do
|
48
|
-
subject.instance_variable_get(:@adapter_options).should eq(:latency => 0.5, :force_polling => true)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe '#start' do
|
54
|
-
it 'selects and initializes an adapter' do
|
55
|
-
Listen::Adapter.should_receive(:select_and_initialize).with(watched_directories, {}) { adapter }
|
56
|
-
subject.start
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'builds all directories records' do
|
60
|
-
subject.directories_records.each do |r|
|
61
|
-
r.should_receive(:build)
|
62
|
-
end
|
63
|
-
subject.start
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
context 'with a started listener' do
|
68
|
-
before do
|
69
|
-
subject.stub(:initialize_adapter) { adapter }
|
70
|
-
subject.start
|
71
|
-
end
|
72
|
-
|
73
|
-
describe '#unpause' do
|
74
|
-
it 'rebuilds all directories records' do
|
75
|
-
subject.directories_records.each do |r|
|
76
|
-
r.should_receive(:build)
|
77
|
-
end
|
78
|
-
subject.unpause
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe '#ignore' do
|
84
|
-
it 'delegates the work to each directory record' do
|
85
|
-
subject.directories_records.each do |r|
|
86
|
-
r.should_receive(:ignore).with 'some_directory'
|
87
|
-
end
|
88
|
-
subject.ignore 'some_directory'
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe '#ignore!' do
|
93
|
-
it 'delegates the work to each directory record' do
|
94
|
-
subject.directories_records.each do |r|
|
95
|
-
r.should_receive(:ignore!).with 'some_directory'
|
96
|
-
end
|
97
|
-
subject.ignore! 'some_directory'
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
describe '#filter' do
|
102
|
-
it 'delegates the work to each directory record' do
|
103
|
-
subject.directories_records.each do |r|
|
104
|
-
r.should_receive(:filter).with /\.txt$/
|
105
|
-
end
|
106
|
-
subject.filter /\.txt$/
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
describe '#filter!' do
|
111
|
-
it 'delegates the work to each directory record' do
|
112
|
-
subject.directories_records.each do |r|
|
113
|
-
r.should_receive(:filter!).with /\.txt$/
|
114
|
-
end
|
115
|
-
subject.filter! /\.txt$/
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
describe '#on_change' do
|
120
|
-
let(:directories) { %w{dir1 dir2 dir3} }
|
121
|
-
let(:changes) { {:modified => [], :added => [], :removed => []} }
|
122
|
-
let(:callback) { Proc.new { @called = true } }
|
123
|
-
|
124
|
-
before do
|
125
|
-
@called = false
|
126
|
-
subject.stub(:fetch_records_changes => changes)
|
127
|
-
end
|
128
|
-
|
129
|
-
it 'fetches the changes of all directories records' do
|
130
|
-
subject.unstub(:fetch_records_changes)
|
131
|
-
|
132
|
-
subject.directories_records.each do |record|
|
133
|
-
record.should_receive(:fetch_changes).with(
|
134
|
-
directories, hash_including(:relative_paths => described_class::DEFAULT_TO_RELATIVE_PATHS)
|
135
|
-
).and_return(changes)
|
136
|
-
end
|
137
|
-
subject.on_change(directories)
|
138
|
-
end
|
139
|
-
|
140
|
-
context 'with no changes to report' do
|
141
|
-
if RUBY_VERSION[/^1.8/]
|
142
|
-
it 'does not run the callback' do
|
143
|
-
subject.change(&callback)
|
144
|
-
subject.on_change(directories)
|
145
|
-
@called.should be_false
|
146
|
-
end
|
147
|
-
else
|
148
|
-
it 'does not run the callback' do
|
149
|
-
callback.should_not_receive(:call)
|
150
|
-
subject.change(&callback)
|
151
|
-
subject.on_change(directories)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
context 'with changes to report' do
|
157
|
-
let(:changes) { {:modified => %w{path1}, :added => [], :removed => %w{path2}} }
|
158
|
-
|
159
|
-
if RUBY_VERSION[/^1.8/]
|
160
|
-
it 'runs the callback passing it the changes' do
|
161
|
-
subject.change(&callback)
|
162
|
-
subject.on_change(directories)
|
163
|
-
@called.should be_true
|
164
|
-
end
|
165
|
-
else
|
166
|
-
it 'runs the callback passing it the changes' do
|
167
|
-
callback.should_receive(:call).with(changes[:modified], changes[:added], changes[:removed])
|
168
|
-
subject.change(&callback)
|
169
|
-
subject.on_change(directories)
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|