sass 3.1.15 → 3.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/README.md +4 -5
  2. data/Rakefile +2 -2
  3. data/VERSION +1 -1
  4. data/lib/sass/css.rb +144 -48
  5. data/lib/sass/engine.rb +3 -1
  6. data/lib/sass/plugin/compiler.rb +25 -32
  7. data/lib/sass/plugin/listener.rb +59 -0
  8. data/lib/sass/script/lexer.rb +1 -1
  9. data/lib/sass/script/list.rb +1 -0
  10. data/lib/sass/scss/parser.rb +90 -4
  11. data/lib/sass/scss/rx.rb +5 -0
  12. data/lib/sass/scss/static_parser.rb +1 -1
  13. data/lib/sass/selector/abstract_sequence.rb +11 -2
  14. data/lib/sass/selector/simple.rb +6 -0
  15. data/lib/sass/tree/comment_node.rb +1 -1
  16. data/lib/sass/tree/node.rb +2 -2
  17. data/lib/sass/tree/visitors/check_nesting.rb +2 -2
  18. data/lib/sass/tree/visitors/cssize.rb +1 -1
  19. data/lib/sass/util.rb +3 -2
  20. data/test/sass/conversion_test.rb +10 -0
  21. data/test/sass/css2sass_test.rb +24 -0
  22. data/test/sass/engine_test.rb +1 -0
  23. data/test/sass/scss/css_test.rb +53 -0
  24. data/vendor/listen/CHANGELOG.md +72 -0
  25. data/vendor/listen/Gemfile +35 -0
  26. data/vendor/listen/Guardfile +8 -0
  27. data/vendor/{fssm → listen}/LICENSE +1 -1
  28. data/vendor/listen/README.md +297 -0
  29. data/vendor/listen/Rakefile +47 -0
  30. data/vendor/listen/Vagrantfile +96 -0
  31. data/vendor/listen/lib/listen.rb +38 -0
  32. data/vendor/listen/lib/listen/adapter.rb +159 -0
  33. data/vendor/listen/lib/listen/adapters/darwin.rb +84 -0
  34. data/vendor/listen/lib/listen/adapters/linux.rb +99 -0
  35. data/vendor/listen/lib/listen/adapters/polling.rb +66 -0
  36. data/vendor/listen/lib/listen/adapters/windows.rb +82 -0
  37. data/vendor/listen/lib/listen/directory_record.rb +257 -0
  38. data/vendor/listen/lib/listen/listener.rb +186 -0
  39. data/vendor/listen/lib/listen/multi_listener.rb +121 -0
  40. data/vendor/listen/lib/listen/turnstile.rb +28 -0
  41. data/vendor/listen/lib/listen/version.rb +3 -0
  42. data/vendor/listen/listen.gemspec +26 -0
  43. data/vendor/listen/spec/listen/adapter_spec.rb +142 -0
  44. data/vendor/listen/spec/listen/adapters/darwin_spec.rb +31 -0
  45. data/vendor/listen/spec/listen/adapters/linux_spec.rb +30 -0
  46. data/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
  47. data/vendor/listen/spec/listen/adapters/windows_spec.rb +24 -0
  48. data/vendor/listen/spec/listen/directory_record_spec.rb +807 -0
  49. data/vendor/listen/spec/listen/listener_spec.rb +151 -0
  50. data/vendor/listen/spec/listen/multi_listener_spec.rb +151 -0
  51. data/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
  52. data/vendor/listen/spec/listen_spec.rb +73 -0
  53. data/vendor/listen/spec/spec_helper.rb +16 -0
  54. data/vendor/listen/spec/support/adapter_helper.rb +538 -0
  55. data/vendor/listen/spec/support/directory_record_helper.rb +35 -0
  56. data/vendor/listen/spec/support/fixtures_helper.rb +29 -0
  57. data/vendor/listen/spec/support/listeners_helper.rb +133 -0
  58. data/vendor/listen/spec/support/platform_helper.rb +11 -0
  59. metadata +40 -40
  60. data/vendor/fssm/Gemfile +0 -3
  61. data/vendor/fssm/README.markdown +0 -83
  62. data/vendor/fssm/Rakefile +0 -11
  63. data/vendor/fssm/example.rb +0 -12
  64. data/vendor/fssm/ext/rakefile.rb +0 -14
  65. data/vendor/fssm/fssm.gemspec +0 -27
  66. data/vendor/fssm/lib/fssm.rb +0 -74
  67. data/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
  68. data/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
  69. data/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
  70. data/vendor/fssm/lib/fssm/backends/rbfsevent.rb +0 -42
  71. data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
  72. data/vendor/fssm/lib/fssm/monitor.rb +0 -36
  73. data/vendor/fssm/lib/fssm/path.rb +0 -94
  74. data/vendor/fssm/lib/fssm/pathname.rb +0 -36
  75. data/vendor/fssm/lib/fssm/state/directory.rb +0 -75
  76. data/vendor/fssm/lib/fssm/state/file.rb +0 -24
  77. data/vendor/fssm/lib/fssm/support.rb +0 -87
  78. data/vendor/fssm/lib/fssm/tree.rb +0 -176
  79. data/vendor/fssm/lib/fssm/version.rb +0 -3
  80. data/vendor/fssm/profile/prof-cache.rb +0 -40
  81. data/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
  82. data/vendor/fssm/profile/prof-pathname-rubinius.rb +0 -35
  83. data/vendor/fssm/profile/prof-pathname.rb +0 -68
  84. data/vendor/fssm/profile/prof-plain-pathname.html +0 -988
  85. data/vendor/fssm/profile/prof.html +0 -2379
  86. data/vendor/fssm/spec/count_down_latch.rb +0 -151
  87. data/vendor/fssm/spec/monitor_spec.rb +0 -202
  88. data/vendor/fssm/spec/path_spec.rb +0 -96
  89. data/vendor/fssm/spec/root/duck/quack.txt +0 -0
  90. data/vendor/fssm/spec/root/file.css +0 -0
  91. data/vendor/fssm/spec/root/file.rb +0 -0
  92. data/vendor/fssm/spec/root/file.yml +0 -0
  93. data/vendor/fssm/spec/root/moo/cow.txt +0 -0
  94. data/vendor/fssm/spec/spec_helper.rb +0 -14
@@ -0,0 +1,35 @@
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.build
16
+ @record.filter(options.delete(:filter)) if options[:filter]
17
+ @record.ignore(options.delete(:ignore)) if options[:ignore]
18
+ end
19
+
20
+ yield
21
+
22
+ paths = options.delete(:paths) || [root_path]
23
+ options[:recursive] = true if options[:recursive].nil?
24
+
25
+ changes = @record.fetch_changes(paths, {:relative_paths => true}.merge(options))
26
+
27
+ [changes[:modified], changes[:added], changes[:removed]]
28
+ end
29
+
30
+ def ensure_same_second
31
+ t = Time.now
32
+ if t.to_f - t.to_i > 0.1
33
+ sleep 1.5 - (t.to_f - t.to_i)
34
+ end
35
+ end
@@ -0,0 +1,29 @@
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
@@ -0,0 +1,133 @@
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 '#polling_fallback_message' do
119
+ it 'sets custom polling fallback message to @adapter_options' do
120
+ subject.polling_fallback_message('custom message')
121
+ subject.instance_variable_get(:@adapter_options).should eq(:polling_fallback_message => 'custom message')
122
+ end
123
+
124
+ it 'sets polling fallback message to false in @adapter_options' do
125
+ subject.polling_fallback_message(false)
126
+ subject.instance_variable_get(:@adapter_options).should eq(:polling_fallback_message => false)
127
+ end
128
+
129
+ it 'returns the same listener to allow chaining' do
130
+ subject.polling_fallback_message('custom message').should equal subject
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,11 @@
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 windows?
10
+ RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
11
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 35
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 15
10
- version: 3.1.15
9
+ - 16
10
+ version: 3.1.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Weizenbaum
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-02-09 00:00:00 -08:00
20
+ date: 2012-04-20 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -70,6 +70,7 @@ files:
70
70
  - lib/sass/plugin/merb.rb
71
71
  - lib/sass/plugin/staleness_checker.rb
72
72
  - lib/sass/plugin/rack.rb
73
+ - lib/sass/plugin/listener.rb
73
74
  - lib/sass/plugin/rails.rb
74
75
  - lib/sass/plugin/configuration.rb
75
76
  - lib/sass/plugin/generic.rb
@@ -162,42 +163,41 @@ files:
162
163
  - lib/sass/railtie.rb
163
164
  - lib/sass/environment.rb
164
165
  - lib/sass/exec.rb
165
- - vendor/fssm/README.markdown
166
- - vendor/fssm/ext/rakefile.rb
167
- - vendor/fssm/example.rb
168
- - vendor/fssm/Gemfile
169
- - vendor/fssm/lib/fssm/version.rb
170
- - vendor/fssm/lib/fssm/pathname.rb
171
- - vendor/fssm/lib/fssm/state/file.rb
172
- - vendor/fssm/lib/fssm/state/directory.rb
173
- - vendor/fssm/lib/fssm/monitor.rb
174
- - vendor/fssm/lib/fssm/tree.rb
175
- - vendor/fssm/lib/fssm/support.rb
176
- - vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb
177
- - vendor/fssm/lib/fssm/backends/polling.rb
178
- - vendor/fssm/lib/fssm/backends/inotify.rb
179
- - vendor/fssm/lib/fssm/backends/fsevents.rb
180
- - vendor/fssm/lib/fssm/backends/rbfsevent.rb
181
- - vendor/fssm/lib/fssm/path.rb
182
- - vendor/fssm/lib/fssm.rb
183
- - vendor/fssm/profile/prof-plain-pathname.html
184
- - vendor/fssm/profile/prof-pathname.rb
185
- - vendor/fssm/profile/prof.html
186
- - vendor/fssm/profile/prof-cache.rb
187
- - vendor/fssm/profile/prof-fssm-pathname.html
188
- - vendor/fssm/profile/prof-pathname-rubinius.rb
189
- - vendor/fssm/fssm.gemspec
190
- - vendor/fssm/Rakefile
191
- - vendor/fssm/LICENSE
192
- - vendor/fssm/spec/count_down_latch.rb
193
- - vendor/fssm/spec/monitor_spec.rb
194
- - vendor/fssm/spec/path_spec.rb
195
- - vendor/fssm/spec/root/moo/cow.txt
196
- - vendor/fssm/spec/root/file.yml
197
- - vendor/fssm/spec/root/file.css
198
- - vendor/fssm/spec/root/file.rb
199
- - vendor/fssm/spec/root/duck/quack.txt
200
- - vendor/fssm/spec/spec_helper.rb
166
+ - vendor/listen/README.md
167
+ - vendor/listen/Guardfile
168
+ - vendor/listen/Gemfile
169
+ - vendor/listen/lib/listen/turnstile.rb
170
+ - vendor/listen/lib/listen/directory_record.rb
171
+ - vendor/listen/lib/listen/version.rb
172
+ - vendor/listen/lib/listen/multi_listener.rb
173
+ - vendor/listen/lib/listen/listener.rb
174
+ - vendor/listen/lib/listen/adapters/polling.rb
175
+ - vendor/listen/lib/listen/adapters/darwin.rb
176
+ - vendor/listen/lib/listen/adapters/linux.rb
177
+ - vendor/listen/lib/listen/adapters/windows.rb
178
+ - vendor/listen/lib/listen/adapter.rb
179
+ - vendor/listen/lib/listen.rb
180
+ - vendor/listen/CHANGELOG.md
181
+ - vendor/listen/Rakefile
182
+ - vendor/listen/LICENSE
183
+ - vendor/listen/listen.gemspec
184
+ - vendor/listen/Vagrantfile
185
+ - vendor/listen/spec/listen/directory_record_spec.rb
186
+ - vendor/listen/spec/listen/adapters/linux_spec.rb
187
+ - vendor/listen/spec/listen/adapters/darwin_spec.rb
188
+ - vendor/listen/spec/listen/adapters/polling_spec.rb
189
+ - vendor/listen/spec/listen/adapters/windows_spec.rb
190
+ - vendor/listen/spec/listen/turnstile_spec.rb
191
+ - vendor/listen/spec/listen/adapter_spec.rb
192
+ - vendor/listen/spec/listen/listener_spec.rb
193
+ - vendor/listen/spec/listen/multi_listener_spec.rb
194
+ - vendor/listen/spec/listen_spec.rb
195
+ - vendor/listen/spec/spec_helper.rb
196
+ - vendor/listen/spec/support/directory_record_helper.rb
197
+ - vendor/listen/spec/support/listeners_helper.rb
198
+ - vendor/listen/spec/support/adapter_helper.rb
199
+ - vendor/listen/spec/support/platform_helper.rb
200
+ - vendor/listen/spec/support/fixtures_helper.rb
201
201
  - bin/sass-convert
202
202
  - bin/scss
203
203
  - bin/sass
@@ -1,3 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gemspec
@@ -1,83 +0,0 @@
1
- # FSSM ![project status](http://stillmaintained.com/ttilley/fssm.png) #
2
-
3
- Monitor API
4
- ===========
5
-
6
- There are three ways you can run the monitor.
7
-
8
- 1. call monitor with a path parameter, and define callbacks in a block
9
- 2. call monitor with a block to configure multiple paths and callbacks
10
- 3. create a monitor object and run each step manually
11
-
12
- Monitor with path
13
- -----------------
14
-
15
- This form watches one path, and enters the run loop automatically. The first parameter is the path to watch, and the second parameter is an optional glob pattern or array of glob patterns that a file must match in order to trigger a callback. The default glob, if ommitted, is `'**/*'`.
16
-
17
- FSSM.monitor('/some/directory/', '**/*') do
18
- update {|base, relative|}
19
- delete {|base, relative|}
20
- create {|base, relative|}
21
- end
22
-
23
- Monitor with block
24
- ------------------
25
-
26
- This form watches one or more paths, and enters the run loop automatically. The glob configuration call can be ommitted, and defaults to `'**/*'`.
27
-
28
- FSSM.monitor do
29
- path '/some/directory/' do
30
- glob '**/*.yml'
31
-
32
- update {|base, relative|}
33
- delete {|base, relative|}
34
- create {|base, relative|}
35
- end
36
-
37
- path '/some/other/directory/' do
38
- update {|base, relative|}
39
- delete {|base, relative|}
40
- create {|base, relative|}
41
- end
42
- end
43
-
44
- Monitor object
45
- --------------
46
-
47
- This form doesn't enter the run loop automatically.
48
-
49
- monitor = FSSM::Monitor.new
50
-
51
- monitor.path '/some/directory/' do
52
- update {|base, relative|}
53
- delete {|base, relative|}
54
- create {|base, relative|}
55
- end
56
-
57
- monitor.run
58
-
59
- Monitoring directories
60
- ----------------------
61
-
62
- By default, FSSM monitors changes in files only. To enable monitoring of files and directories, pass option `directories => true` in a hash to the monitor. Please note that this may not work as expected in all backends. For example:
63
-
64
- FSSM::Monitor.new(:directories => true)
65
- FSSM.monitor(dir, file_glob, :directories => true)
66
-
67
- When directories are monitored, there's an additional third argument to the callbacks. Instead of
68
-
69
- FSSM.monitor('/some/directory/', '**/*') do
70
- update {|base, relative|}
71
- delete {|base, relative|}
72
- create {|base, relative|}
73
- end
74
-
75
- you get this:
76
-
77
- FSSM.monitor('/some/directory/', '**/*', :directories => true) do
78
- update {|base, relative, type|}
79
- delete {|base, relative, type|}
80
- create {|base, relative, type|}
81
- end
82
-
83
- The value of `type` argument is either `:file` or `:directory`.
@@ -1,11 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- Bundler::GemHelper.install_tasks
4
-
5
- require 'rspec/core/rake_task'
6
- RSpec::Core::RakeTask.new(:spec) do |spec|
7
- spec.rspec_opts = ["--color", "--backtrace", "--format", "documentation"]
8
- spec.verbose = true
9
- end
10
-
11
- task :default => :spec
@@ -1,12 +0,0 @@
1
- $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
-
3
- # for rb-inotify/rb-fsevent
4
- require 'rubygems'
5
-
6
- require 'fssm'
7
-
8
- FSSM.monitor('.', '**/*') do
9
- update { |b, r| puts "Update in #{b} to #{r}" }
10
- delete { |b, r| puts "Delete in #{b} to #{r}" }
11
- create { |b, r| puts "Create in #{b} to #{r}" }
12
- end
@@ -1,14 +0,0 @@
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