compass 0.11.beta.7 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/VERSION.yml +2 -2
  2. data/frameworks/compass/stylesheets/compass/layout/_grid-background.scss +40 -22
  3. data/frameworks/compass/stylesheets/compass/utilities/sprites/_base.scss +6 -1
  4. data/frameworks/compass/templates/extension/manifest.rb +8 -2
  5. data/lib/compass/commands/print_version.rb +3 -0
  6. data/lib/compass/commands/update_project.rb +23 -9
  7. data/lib/compass/commands/watch_project.rb +41 -8
  8. data/lib/compass/compiler.rb +2 -3
  9. data/lib/compass/configuration.rb +34 -0
  10. data/lib/compass/configuration/adapters.rb +6 -2
  11. data/lib/compass/configuration/data.rb +1 -0
  12. data/lib/compass/configuration/defaults.rb +1 -1
  13. data/lib/compass/configuration/serialization.rb +1 -0
  14. data/lib/compass/exec/project_options_parser.rb +3 -3
  15. data/lib/compass/sass_extensions/functions/gradient_support.rb +81 -65
  16. data/lib/compass/sass_extensions/sprites/sprites.rb +9 -0
  17. data/lib/compass/version.rb +1 -1
  18. data/test/configuration_test.rb +67 -6
  19. data/test/fixtures/stylesheets/blueprint/css/screen.css +1 -1
  20. data/test/fixtures/stylesheets/blueprint/css/single-imports/debug.css +1 -1
  21. data/test/fixtures/stylesheets/compass/css/gradients.css +46 -24
  22. data/test/fixtures/stylesheets/compass/css/grid_background.css +8 -0
  23. data/test/fixtures/stylesheets/compass/sass/gradients.sass +8 -2
  24. data/test/fixtures/stylesheets/compass/sass/grid_background.scss +4 -0
  25. metadata +18 -19
  26. data/lib/vendor/fssm/fssm.rb +0 -33
  27. data/lib/vendor/fssm/fssm/backends/fsevents.rb +0 -36
  28. data/lib/vendor/fssm/fssm/backends/inotify.rb +0 -26
  29. data/lib/vendor/fssm/fssm/backends/polling.rb +0 -25
  30. data/lib/vendor/fssm/fssm/backends/rubycocoa/fsevents.rb +0 -131
  31. data/lib/vendor/fssm/fssm/monitor.rb +0 -26
  32. data/lib/vendor/fssm/fssm/path.rb +0 -91
  33. data/lib/vendor/fssm/fssm/pathname.rb +0 -502
  34. data/lib/vendor/fssm/fssm/state/directory.rb +0 -57
  35. data/lib/vendor/fssm/fssm/state/file.rb +0 -24
  36. data/lib/vendor/fssm/fssm/support.rb +0 -63
  37. data/lib/vendor/fssm/fssm/tree.rb +0 -176
@@ -1,57 +0,0 @@
1
- module FSSM::State
2
- class Directory
3
- attr_reader :path
4
-
5
- def initialize(path)
6
- @path = path
7
- @cache = FSSM::Tree::Cache.new
8
- end
9
-
10
- def refresh(base=nil, skip_callbacks=false)
11
- previous, current = recache(base || @path.to_pathname)
12
-
13
- unless skip_callbacks
14
- deleted(previous, current)
15
- created(previous, current)
16
- modified(previous, current)
17
- end
18
- end
19
-
20
- private
21
-
22
- def created(previous, current)
23
- (current.keys - previous.keys).each {|created| @path.create(created)}
24
- end
25
-
26
- def deleted(previous, current)
27
- (previous.keys - current.keys).each {|deleted| @path.delete(deleted)}
28
- end
29
-
30
- def modified(previous, current)
31
- (current.keys & previous.keys).each do |file|
32
- @path.update(file) if (current[file] <=> previous[file]) != 0
33
- end
34
- end
35
-
36
- def recache(base)
37
- base = FSSM::Pathname.for(base)
38
- previous = @cache.files
39
- snapshot(base)
40
- current = @cache.files
41
- [previous, current]
42
- end
43
-
44
- def snapshot(base)
45
- base = FSSM::Pathname.for(base)
46
- @cache.unset(base)
47
- @path.glob.each {|glob| add_glob(base, glob)}
48
- end
49
-
50
- def add_glob(base, glob)
51
- FSSM::Pathname.glob(base.join(glob).to_s).each do |fn|
52
- @cache.set(fn)
53
- end
54
- end
55
-
56
- end
57
- 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.exists?
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,63 +0,0 @@
1
- require 'rbconfig'
2
-
3
- module FSSM::Support
4
- class << self
5
- def backend
6
- @@backend ||= case
7
- when mac? && !jruby? && carbon_core?
8
- 'FSEvents'
9
- when linux? && rb_inotify?
10
- 'Inotify'
11
- else
12
- 'Polling'
13
- end
14
- end
15
-
16
- def jruby?
17
- defined?(JRUBY_VERSION)
18
- end
19
-
20
- def mac?
21
- Config::CONFIG['target_os'] =~ /darwin/i
22
- end
23
-
24
- def linux?
25
- Config::CONFIG['target_os'] =~ /linux/i
26
- end
27
-
28
- def carbon_core?
29
- begin
30
- require 'osx/foundation'
31
- OSX.require_framework '/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework'
32
- true
33
- rescue LoadError
34
- STDERR.puts("Warning: Unable to load CarbonCore. FSEvents will be unavailable.")
35
- false
36
- end
37
- end
38
-
39
- def rb_inotify?
40
- found = begin
41
- require 'rb-inotify'
42
- if defined?(INotify::VERSION)
43
- version = INotify::VERSION
44
- version[0] > 0 || version[1] >= 6
45
- end
46
- rescue LoadError
47
- false
48
- end
49
- STDERR.puts("Warning: Unable to load rb-inotify >= 0.5.1. Inotify will be unavailable.") unless found
50
- found
51
- end
52
-
53
- def use_block(context, block)
54
- return if block.nil?
55
- if block.arity == 1
56
- block.call(context)
57
- else
58
- context.instance_eval(&block)
59
- end
60
- end
61
-
62
- end
63
- 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