compass 0.10.0.pre3 → 0.10.0.pre4
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.
- data/CHANGELOG.markdown +5 -0
- data/REVISION +1 -1
- data/VERSION.yml +1 -1
- data/lib/compass/compiler.rb +5 -4
- data/lib/compass/sass_extensions/monkey_patches/stylesheet_updating.rb +32 -15
- data/lib/vendor/fssm.rb +28 -164
- metadata +2 -2
data/CHANGELOG.markdown
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
COMPASS CHANGELOG
|
2
2
|
=================
|
3
3
|
|
4
|
+
0.10.0.pre4 (January 04, 2010)
|
5
|
+
------------------------------
|
6
|
+
* Fixed an FSSM loading issue that broke the compass watcher.
|
7
|
+
* Fixed some compatibility issues with edge versions of Sass.
|
8
|
+
|
4
9
|
0.10.0.pre3 (January 02, 2010)
|
5
10
|
------------------------------
|
6
11
|
|
data/REVISION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
08894dc6ab17c4d79297868e177cbed3d338b93b
|
data/VERSION.yml
CHANGED
data/lib/compass/compiler.rb
CHANGED
@@ -42,7 +42,7 @@ module Compass
|
|
42
42
|
def out_of_date?
|
43
43
|
Compass.configure_sass_plugin! unless Compass.sass_plugin_configured?
|
44
44
|
sass_files.zip(css_files).each do |sass_filename, css_filename|
|
45
|
-
return sass_filename if Sass::Plugin.exact_stylesheet_needs_update
|
45
|
+
return sass_filename if Sass::Plugin.send(:exact_stylesheet_needs_update?, css_filename, sass_filename)
|
46
46
|
end
|
47
47
|
false
|
48
48
|
end
|
@@ -99,7 +99,7 @@ module Compass
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def should_compile?(sass_filename, css_filename)
|
102
|
-
options[:force] || Sass::Plugin.exact_stylesheet_needs_update
|
102
|
+
options[:force] || Sass::Plugin.send(:exact_stylesheet_needs_update?, css_filename, sass_filename)
|
103
103
|
end
|
104
104
|
|
105
105
|
# A sass engine for compiling a single file.
|
@@ -114,12 +114,13 @@ module Compass
|
|
114
114
|
# if there's an error.
|
115
115
|
def handle_exception(sass_filename, css_filename, e)
|
116
116
|
logger.record :error, basename(sass_filename), "(Line #{e.sass_line}: #{e.message})"
|
117
|
-
write_file css_filename, error_contents(e), options.merge(:force => true)
|
117
|
+
write_file css_filename, error_contents(e, sass_filename), options.merge(:force => true)
|
118
118
|
end
|
119
119
|
|
120
120
|
# Haml refactored this logic in 2.3, this is backwards compatibility for either one
|
121
|
-
def error_contents(e)
|
121
|
+
def error_contents(e, sass_filename)
|
122
122
|
if Sass::SyntaxError.respond_to?(:exception_to_css)
|
123
|
+
e.sass_template = sass_filename
|
123
124
|
Sass::SyntaxError.exception_to_css(e, :full_exception => show_full_exception?)
|
124
125
|
else
|
125
126
|
Sass::Plugin.options[:full_exception] ||= show_full_exception?
|
@@ -2,22 +2,39 @@ require 'sass/plugin'
|
|
2
2
|
|
3
3
|
# XXX: We can remove this monkeypatch once Sass 2.2 is released.
|
4
4
|
module Sass::Plugin
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
|
6
|
+
# splits the stylesheet_needs_update? method into two pieces so I can use the exact_stylesheet_needs_update? piece
|
7
|
+
module StylesheetNeedsUpdate
|
8
|
+
def stylesheet_needs_update?(name, template_path, css_path)
|
9
|
+
css_file = css_filename(name, css_path)
|
10
|
+
template_file = template_filename(name, template_path)
|
11
|
+
exact_stylesheet_needs_update?(css_file, template_file)
|
12
|
+
end
|
13
|
+
def exact_stylesheet_needs_update?(css_file, template_file)
|
14
|
+
if !File.exists?(css_file)
|
15
|
+
return true
|
16
|
+
else
|
17
|
+
css_mtime = File.mtime(css_file)
|
18
|
+
File.mtime(template_file) > css_mtime ||
|
19
|
+
dependencies(template_file).any?(&dependency_updated?(css_mtime))
|
11
20
|
end
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# At some point Sass::Plugin changed from using the metaclass to extend self.
|
25
|
+
metaclass = class << self; self; end
|
26
|
+
if metaclass.included_modules.include?(Sass::Plugin)
|
27
|
+
if method(:stylesheet_needs_update?).arity == 2
|
28
|
+
alias exact_stylesheet_needs_update? stylesheet_needs_update?
|
29
|
+
elsif !method_defined?(:exact_stylesheet_needs_update?)
|
30
|
+
include StylesheetNeedsUpdate
|
31
|
+
end
|
32
|
+
else
|
33
|
+
class << self
|
34
|
+
unless method_defined?(:exact_stylesheet_needs_update?)
|
35
|
+
include StylesheetNeedsUpdate
|
20
36
|
end
|
21
37
|
end
|
22
38
|
end
|
23
|
-
|
39
|
+
|
40
|
+
end
|
data/lib/vendor/fssm.rb
CHANGED
@@ -1,176 +1,40 @@
|
|
1
|
-
|
2
|
-
|
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
|
1
|
+
dir = File.dirname(__FILE__)
|
2
|
+
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
77
3
|
|
78
|
-
|
79
|
-
|
80
|
-
|
4
|
+
module FSSM
|
5
|
+
FileNotFoundError = Class.new(StandardError)
|
6
|
+
CallbackError = Class.new(StandardError)
|
81
7
|
|
82
|
-
|
83
|
-
|
8
|
+
class << self
|
9
|
+
def dbg(msg=nil)
|
10
|
+
STDERR.puts(msg)
|
84
11
|
end
|
85
12
|
|
86
|
-
def
|
87
|
-
|
88
|
-
|
13
|
+
def monitor(*args, &block)
|
14
|
+
monitor = FSSM::Monitor.new
|
15
|
+
context = args.empty? ? monitor : monitor.path(*args)
|
89
16
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
17
|
+
if block_given?
|
18
|
+
if block.arity == 1
|
19
|
+
block.call(context)
|
20
|
+
else
|
21
|
+
context.instance_eval(&block)
|
22
|
+
end
|
94
23
|
end
|
95
24
|
|
96
|
-
|
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
|
25
|
+
monitor.run
|
136
26
|
end
|
137
27
|
end
|
28
|
+
end
|
138
29
|
|
139
|
-
|
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
|
30
|
+
require 'thread'
|
165
31
|
|
166
|
-
|
32
|
+
require 'fssm/pathname'
|
33
|
+
require 'fssm/support'
|
34
|
+
require 'fssm/tree'
|
35
|
+
require 'fssm/path'
|
36
|
+
require 'fssm/state'
|
37
|
+
require 'fssm/monitor'
|
167
38
|
|
168
|
-
|
169
|
-
|
170
|
-
hash["#{path}"] = node.mtime if node.ftype == ft
|
171
|
-
hash
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
end
|
39
|
+
require "fssm/backends/#{FSSM::Support.backend.downcase}"
|
40
|
+
FSSM::Backends::Default = FSSM::Backends.const_get(FSSM::Support.backend)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.0.
|
4
|
+
version: 0.10.0.pre4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Eppstein
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-04 00:00:00 -08:00
|
13
13
|
default_executable: compass
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|