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
@@ -1,36 +0,0 @@
1
- require 'fileutils'
2
- require 'find'
3
- require 'pathname'
4
-
5
- module FSSM
6
- class Pathname < ::Pathname
7
- VIRTUAL_REGEX = /^file:([^!]*)!/
8
-
9
- class << self
10
- def for(path)
11
- path.is_a?(::FSSM::Pathname) ? path : new(path)
12
- end
13
-
14
- alias :[] :glob
15
- end
16
-
17
- def is_virtual?
18
- !!(VIRTUAL_REGEX =~ to_s)
19
- end
20
-
21
- def segments
22
- path = to_s
23
- array = path.split(File::SEPARATOR)
24
- array.delete('')
25
- array.insert(0, File::SEPARATOR) if path[0, 1] == File::SEPARATOR
26
- array[0] += File::SEPARATOR if path[0, 3] =~ SEPARATOR_PAT
27
- array
28
- end
29
-
30
- def glob(pattern, flags = 0, &block)
31
- patterns = [pattern].flatten
32
- patterns.map! { |p| self.class.glob(to_s + p, flags, &block) }
33
- patterns.flatten
34
- end
35
- end
36
- end
@@ -1,75 +0,0 @@
1
- module FSSM::State
2
- class Directory
3
- attr_reader :path
4
-
5
- def initialize(path, options={})
6
- @path = path
7
- @options = options
8
- @cache = FSSM::Tree::Cache.new
9
- end
10
-
11
- def refresh(base=nil, skip_callbacks=false)
12
- base_path = FSSM::Pathname.for(base || @path.to_pathname).expand_path
13
- previous, current = recache(base_path)
14
-
15
- unless skip_callbacks
16
- deleted(previous, current)
17
- created(previous, current)
18
- modified(previous, current)
19
- end
20
- end
21
-
22
- private
23
-
24
- def created(previous, current)
25
- (current.keys - previous.keys).sort.each do |file|
26
- @path.create(file, current[file][1])
27
- end
28
- end
29
-
30
- def deleted(previous, current)
31
- (previous.keys - current.keys).sort.reverse.each do |file|
32
- @path.delete(file, previous[file][1])
33
- end
34
- end
35
-
36
- def modified(previous, current)
37
- (current.keys & previous.keys).each do |file|
38
- current_data = current[file]
39
- @path.update(file, current_data[1]) if (current_data[0] <=> previous[file][0]) != 0
40
- end
41
- end
42
-
43
- def recache(base)
44
- base = FSSM::Pathname.for(base)
45
- previous = cache_entries
46
- snapshot(base)
47
- current = cache_entries
48
- [previous, current]
49
- end
50
-
51
- def snapshot(base)
52
- base = FSSM::Pathname.for(base)
53
- @cache.unset(base)
54
- @path.glob.each { |glob| add_glob(base, glob) }
55
- end
56
-
57
- def add_glob(base, glob)
58
- FSSM::Pathname.glob(base.join(glob).to_s).each do |fn|
59
- @cache.set(fn)
60
- end
61
- end
62
-
63
- def cache_entries
64
- entries = tag_entries(@cache.files, :file)
65
- entries.merge! tag_entries(@cache.directories, :directory) if @options[:directories]
66
- entries
67
- end
68
-
69
- def tag_entries(entries, tag)
70
- tagged_entries = {}
71
- entries.each_pair { |fname, mtime| tagged_entries[fname] = [mtime, tag] }
72
- tagged_entries
73
- end
74
- end
75
- end
@@ -1,24 +0,0 @@
1
- module FSSM::State
2
- class File
3
- attr_reader :path
4
-
5
- def initialize(path)
6
- @path = path
7
- end
8
-
9
- def refresh(base=nil, skip_callbacks=false)
10
- base ||= @path.to_pathname
11
- used_to_exist, @exists = @exists, base.exist?
12
- # this handles bad symlinks without failing. why handle bad symlinks at
13
- # all? well, we could still be interested in their creation and deletion.
14
- old_mtime, @mtime = @mtime, base.symlink? ? Time.at(0) : base.mtime if @exists
15
-
16
- unless skip_callbacks
17
- @path.delete(@path.to_s) if used_to_exist && !@exists
18
- @path.create(@path.to_s) if !used_to_exist && @exists
19
- @path.update(@path.to_s) if used_to_exist && @exists && old_mtime != @mtime
20
- end
21
- end
22
-
23
- end
24
- end
@@ -1,87 +0,0 @@
1
- require 'rbconfig'
2
-
3
- module FSSM::Support
4
- class << self
5
- def usable_backend
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]
23
- end
24
- end
25
-
26
- def backend
27
- @@backend ||= usable_backend
28
- end
29
-
30
- def jruby?
31
- defined?(JRUBY_VERSION)
32
- end
33
-
34
- def mac?
35
- RbConfig::CONFIG['target_os'] =~ /darwin/i
36
- end
37
-
38
- def lion?
39
- RbConfig::CONFIG['target_os'] =~ /darwin11/i
40
- end
41
-
42
- def linux?
43
- RbConfig::CONFIG['target_os'] =~ /linux/i
44
- end
45
-
46
- def carbon_core?
47
- begin
48
- require 'osx/foundation'
49
- OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework'
50
- true
51
- rescue LoadError
52
- false
53
- end
54
- end
55
-
56
- def rb_fsevent?
57
- begin
58
- require 'rb-fsevent'
59
- defined?(FSEvent::VERSION) ? FSEvent::VERSION.to_f >= 0.4 : false
60
- rescue LoadError
61
- false
62
- end
63
- end
64
-
65
- def rb_inotify?
66
- begin
67
- require 'rb-inotify'
68
- if defined?(INotify::VERSION)
69
- version = INotify::VERSION
70
- version[0] > 0 || version[1] >= 6
71
- end
72
- rescue LoadError
73
- false
74
- end
75
- end
76
-
77
- def use_block(context, block)
78
- return if block.nil?
79
- if block.arity == 1
80
- block.call(context)
81
- else
82
- context.instance_eval(&block)
83
- end
84
- end
85
-
86
- end
87
- end
@@ -1,176 +0,0 @@
1
- module FSSM::Tree
2
- module NodeBase
3
- def initialize
4
- @children = {}
5
- end
6
-
7
- protected
8
-
9
- def child(segment)
10
- @children["#{segment}"]
11
- end
12
-
13
- def child!(segment)
14
- (@children["#{segment}"] ||= Node.new)
15
- end
16
-
17
- def has_child?(segment)
18
- @children.has_key?("#{segment}")
19
- end
20
-
21
- def remove_child(segment)
22
- @children.delete("#{segment}")
23
- end
24
-
25
- def remove_children
26
- @children.clear
27
- end
28
- end
29
-
30
- module NodeEnumerable
31
- include NodeBase
32
- include Enumerable
33
-
34
- def each(prefix=nil, &block)
35
- @children.each do |segment, node|
36
- cprefix = prefix ?
37
- FSSM::Pathname.for(prefix).join(segment) :
38
- FSSM::Pathname.for(segment)
39
- block.call([cprefix, node])
40
- node.each(cprefix, &block)
41
- end
42
- end
43
- end
44
-
45
- module NodeInsertion
46
- include NodeBase
47
-
48
- def unset(path)
49
- key = key_segments(path)
50
-
51
- if key.empty?
52
- remove_children
53
- return nil
54
- end
55
-
56
- segment = key.pop
57
- node = descendant(key)
58
-
59
- return unless node
60
-
61
- node.remove_child(segment)
62
-
63
- nil
64
- end
65
-
66
- def set(path)
67
- node = descendant!(path)
68
- node.from_path(path).mtime
69
- end
70
-
71
- protected
72
-
73
- def key_segments(key)
74
- return key if key.is_a?(Array)
75
- FSSM::Pathname.for(key).segments
76
- end
77
-
78
- def descendant(path)
79
- recurse(path, false)
80
- end
81
-
82
- def descendant!(path)
83
- recurse(path, true)
84
- end
85
-
86
- def recurse(key, create=false)
87
- key = key_segments(key)
88
- node = self
89
-
90
- until key.empty?
91
- segment = key.shift
92
- node = create ? node.child!(segment) : node.child(segment)
93
- return nil unless node
94
- end
95
-
96
- node
97
- end
98
- end
99
-
100
- module CacheDebug
101
- def set(path)
102
- FSSM.dbg("Cache#set(#{path})")
103
- super
104
- end
105
-
106
- def unset(path)
107
- FSSM.dbg("Cache#unset(#{path})")
108
- super
109
- end
110
-
111
- def ftype(ft)
112
- FSSM.dbg("Cache#ftype(#{ft})")
113
- super
114
- end
115
- end
116
-
117
- class Node
118
- include NodeBase
119
- include NodeEnumerable
120
-
121
- attr_accessor :mtime
122
- attr_accessor :ftype
123
-
124
- def <=>(other)
125
- return unless other.is_a?(::FSSM::Tree::Node)
126
- self.mtime <=> other.mtime
127
- end
128
-
129
- def from_path(path)
130
- path = FSSM::Pathname.for(path)
131
- @ftype = path.ftype
132
- # this handles bad symlinks without failing. why handle bad symlinks at
133
- # all? well, we could still be interested in their creation and deletion.
134
- @mtime = path.symlink? ? Time.at(0) : path.mtime
135
- self
136
- end
137
- end
138
-
139
- class Cache
140
- include NodeBase
141
- include NodeEnumerable
142
- include NodeInsertion
143
- include CacheDebug if $DEBUG
144
-
145
- def set(path)
146
- # all paths set from this level need to be absolute
147
- # realpath will fail on broken links
148
- path = FSSM::Pathname.for(path).expand_path
149
- super(path)
150
- end
151
-
152
- def files
153
- ftype('file')
154
- end
155
-
156
- def directories
157
- ftype('directory')
158
- end
159
-
160
- def links
161
- ftype('link')
162
- end
163
-
164
- alias symlinks links
165
-
166
- private
167
-
168
- def ftype(ft)
169
- inject({}) do |hash, (path, node)|
170
- hash["#{path}"] = node.mtime if node.ftype == ft
171
- hash
172
- end
173
- end
174
- end
175
-
176
- end
@@ -1,3 +0,0 @@
1
- module FSSM
2
- VERSION = "0.2.8.1"
3
- end
@@ -1,40 +0,0 @@
1
- $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
-
3
- require 'fssm'
4
-
5
- require 'rubygems'
6
- require 'ruby-prof'
7
-
8
- $test_path = FSSM::Pathname.new('..').expand_path
9
- $test_files = FSSM::Pathname.glob(File.join($test_path, '**', '*'))
10
-
11
- RubyProf.start
12
- RubyProf.pause
13
-
14
- cache = FSSM::Tree::Cache.new
15
-
16
- 5000.times do |num|
17
- iteration = "%-5d" % (num + 1)
18
- print "iteration #{iteration}"
19
-
20
- print '!'
21
- RubyProf.resume
22
- cache.unset($test_path)
23
- RubyProf.pause
24
- print '!'
25
-
26
- $test_files.each do |fn|
27
- print '.'
28
- RubyProf.resume
29
- cache.set(fn)
30
- RubyProf.pause
31
- end
32
-
33
- print "\n\n"
34
- end
35
-
36
- result = RubyProf.stop
37
- output = File.new('prof.html', 'w+')
38
-
39
- printer = RubyProf::GraphHtmlPrinter.new(result)
40
- printer.print(output, :min_percent => 1)