compass 0.10.0.pre4 → 0.10.0.pre5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. data/CHANGELOG.markdown +16 -0
  2. data/REVISION +1 -1
  3. data/Rakefile +1 -0
  4. data/VERSION.yml +1 -1
  5. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/_blueprint.sass +0 -0
  6. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_buttons.sass +0 -0
  7. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_colors.sass +0 -0
  8. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_debug.sass +0 -0
  9. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_fancy_type.sass +0 -0
  10. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_form.sass +0 -0
  11. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_grid.sass +0 -0
  12. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_ie.sass +0 -0
  13. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_interaction.sass +0 -0
  14. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_link_icons.sass +0 -0
  15. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_liquid.sass +0 -0
  16. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_print.sass +0 -0
  17. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_reset.sass +0 -0
  18. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_rtl.sass +0 -0
  19. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_scaffolding.sass +0 -0
  20. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_screen.sass +0 -0
  21. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_typography.sass +0 -0
  22. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/_utilities.sass +0 -0
  23. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_buttons.sass.html +0 -0
  24. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_colors.sass.html +0 -0
  25. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_debug.sass.html +0 -0
  26. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_fancy_type.sass.html +0 -0
  27. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_form.sass.html +0 -0
  28. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_grid.sass.html +0 -0
  29. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_ie.sass.html +0 -0
  30. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_interaction.sass.html +0 -0
  31. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_link_icons.sass.html +0 -0
  32. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_liquid.sass.html +0 -0
  33. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_print.sass.html +0 -0
  34. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_reset.sass.html +0 -0
  35. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_rtl.sass.html +0 -0
  36. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_scaffolding.sass.html +0 -0
  37. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_screen.sass.html +0 -0
  38. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_typography.sass.html +0 -0
  39. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/_utilities.sass.html +0 -0
  40. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/index.html +0 -0
  41. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_buttons.sass.html +0 -0
  42. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_colors.sass.html +0 -0
  43. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_debug.sass.html +0 -0
  44. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_fancy_type.sass.html +0 -0
  45. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_form.sass.html +0 -0
  46. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_grid.sass.html +0 -0
  47. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_interaction.sass.html +0 -0
  48. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_link_icons.sass.html +0 -0
  49. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_liquid.sass.html +0 -0
  50. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_reset.sass.html +0 -0
  51. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_rtl.sass.html +0 -0
  52. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_scaffolding.sass.html +0 -0
  53. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_typography.sass.html +0 -0
  54. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/docs/modules/_utilities.sass.html +0 -0
  55. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_buttons.sass +0 -0
  56. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_colors.sass +0 -0
  57. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_debug.sass +0 -0
  58. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_fancy_type.sass +0 -0
  59. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_form.sass +0 -0
  60. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_grid.sass +0 -0
  61. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_interaction.sass +0 -0
  62. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_link_icons.sass +0 -0
  63. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_liquid.sass +0 -0
  64. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_reset.sass +0 -0
  65. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_rtl.sass +0 -0
  66. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_scaffolding.sass +0 -0
  67. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_typography.sass +0 -0
  68. data/{lib/compass/frameworks → frameworks}/blueprint/stylesheets/blueprint/modules/_utilities.sass +0 -0
  69. data/{lib/compass/frameworks → frameworks}/blueprint/templates/buttons/buttons.sass +0 -0
  70. data/{lib/compass/frameworks → frameworks}/blueprint/templates/buttons/buttons/cross.png +0 -0
  71. data/{lib/compass/frameworks → frameworks}/blueprint/templates/buttons/buttons/key.png +0 -0
  72. data/{lib/compass/frameworks → frameworks}/blueprint/templates/buttons/buttons/tick.png +0 -0
  73. data/{lib/compass/frameworks → frameworks}/blueprint/templates/buttons/manifest.rb +0 -0
  74. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons.sass +0 -0
  75. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/doc.png +0 -0
  76. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/email.png +0 -0
  77. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/external.png +0 -0
  78. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/feed.png +0 -0
  79. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/im.png +0 -0
  80. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
  81. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/visited.png +0 -0
  82. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/link_icons/xls.png +0 -0
  83. data/{lib/compass/frameworks → frameworks}/blueprint/templates/link_icons/manifest.rb +0 -0
  84. data/{lib/compass/frameworks → frameworks}/blueprint/templates/project/grid.png +0 -0
  85. data/{lib/compass/frameworks → frameworks}/blueprint/templates/project/ie.sass +0 -0
  86. data/{lib/compass/frameworks → frameworks}/blueprint/templates/project/manifest.rb +0 -2
  87. data/{lib/compass/frameworks → frameworks}/blueprint/templates/project/partials/_base.sass +0 -0
  88. data/{lib/compass/frameworks → frameworks}/blueprint/templates/project/print.sass +0 -0
  89. data/{lib/compass/frameworks → frameworks}/blueprint/templates/project/screen.sass +0 -0
  90. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/_compass.sass +0 -0
  91. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/_css3.sass +0 -0
  92. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/_layout.sass +0 -0
  93. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/_misc.sass +0 -0
  94. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/_reset.sass +0 -0
  95. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/_utilities.sass +0 -0
  96. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_background_clip.sass +0 -0
  97. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_background_origin.sass +0 -0
  98. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_background_size.sass +0 -0
  99. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_border_radius.sass +0 -0
  100. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_box_shadow.sass +0 -0
  101. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_box_sizing.sass +0 -0
  102. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_columns.sass +0 -0
  103. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_font_face.sass +0 -0
  104. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_gradient.sass +0 -0
  105. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_inline_block.sass +0 -0
  106. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_opacity.sass +0 -0
  107. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_text_shadow.sass +0 -0
  108. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_transform.sass +0 -0
  109. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/css3/_transition.sass +0 -0
  110. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/layout/_sticky_footer.sass +0 -0
  111. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/_general.sass +0 -0
  112. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/_links.sass +0 -0
  113. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/_lists.sass +0 -0
  114. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/_print.sass +0 -0
  115. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/_sprites.sass +0 -0
  116. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/_tables.sass +0 -0
  117. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/_text.sass +0 -0
  118. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/general/_clearfix.sass +0 -0
  119. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/general/_float.sass +0 -0
  120. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/general/_hacks.sass +0 -0
  121. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/general/_min.sass +0 -0
  122. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/general/_reset.sass +0 -0
  123. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/general/_tabs.sass +0 -0
  124. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/general/_tag_cloud.sass +0 -0
  125. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/links/_hover_link.sass +0 -0
  126. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/links/_link_colors.sass +0 -0
  127. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/links/_unstyled_link.sass +0 -0
  128. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/lists/_bullets.sass +0 -0
  129. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +0 -0
  130. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/lists/_inline_list.sass +0 -0
  131. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass +0 -0
  132. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass +0 -0
  133. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/tables/_borders.sass +0 -0
  134. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/tables/_scaffolding.sass +0 -0
  135. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/text/_ellipsis.sass +0 -0
  136. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/text/_nowrap.sass +0 -0
  137. data/{lib/compass/frameworks → frameworks}/compass/stylesheets/compass/utilities/text/_replacement.sass +0 -0
  138. data/{lib/compass/frameworks → frameworks}/compass/templates/ellipsis/ellipsis.sass +0 -0
  139. data/{lib/compass/frameworks → frameworks}/compass/templates/ellipsis/manifest.rb +0 -0
  140. data/{lib/compass/frameworks → frameworks}/compass/templates/ellipsis/xml/ellipsis.xml +0 -0
  141. data/{lib/compass/frameworks → frameworks}/compass/templates/extension/manifest.rb +0 -0
  142. data/{lib/compass/frameworks → frameworks}/compass/templates/extension/stylesheets/main.sass +0 -0
  143. data/{lib/compass/frameworks → frameworks}/compass/templates/extension/templates/project/manifest.rb +0 -0
  144. data/{lib/compass/frameworks → frameworks}/compass/templates/extension/templates/project/screen.sass +0 -0
  145. data/{lib/compass/frameworks → frameworks}/compass/templates/project/USAGE.markdown +0 -0
  146. data/{lib/compass/frameworks → frameworks}/compass/templates/project/ie.sass +0 -0
  147. data/{lib/compass/frameworks → frameworks}/compass/templates/project/manifest.rb +0 -0
  148. data/{lib/compass/frameworks → frameworks}/compass/templates/project/print.sass +0 -0
  149. data/{lib/compass/frameworks → frameworks}/compass/templates/project/screen.sass +0 -0
  150. data/lib/compass/app_integration/rails/installer.rb +4 -3
  151. data/lib/compass/app_integration/rails/templates/compass-install-rails.rb +18 -13
  152. data/lib/compass/commands/watch_project.rb +42 -4
  153. data/lib/compass/configuration.rb +1 -1
  154. data/lib/compass/configuration/data.rb +3 -0
  155. data/lib/compass/configuration/paths.rb +19 -0
  156. data/lib/compass/exec.rb +2 -0
  157. data/lib/compass/exec/global_options_parser.rb +4 -0
  158. data/lib/compass/exec/switch_ui.rb +4 -0
  159. data/lib/compass/frameworks.rb +1 -1
  160. data/lib/compass/grid_builder.rb +7 -4
  161. data/lib/compass/sass_extensions/functions/urls.rb +1 -1
  162. data/lib/vendor/{fssm.rb → fssm/fssm.rb} +3 -10
  163. data/lib/vendor/fssm/{backends → fssm/backends}/fsevents.rb +4 -5
  164. data/lib/vendor/fssm/{backends → fssm/backends}/inotify.rb +3 -5
  165. data/lib/vendor/fssm/{backends → fssm/backends}/polling.rb +2 -3
  166. data/lib/vendor/fssm/{backends → fssm/backends}/rubycocoa/fsevents.rb +0 -0
  167. data/lib/vendor/fssm/fssm/monitor.rb +26 -0
  168. data/lib/vendor/fssm/{path.rb → fssm/path.rb} +1 -1
  169. data/lib/vendor/fssm/{pathname.rb → fssm/pathname.rb} +0 -0
  170. data/lib/vendor/fssm/fssm/state/directory.rb +57 -0
  171. data/lib/vendor/fssm/fssm/state/file.rb +24 -0
  172. data/lib/vendor/fssm/{support.rb → fssm/support.rb} +14 -6
  173. data/lib/vendor/fssm/{tree.rb → fssm/tree.rb} +0 -0
  174. data/test/command_line_helper.rb +14 -4
  175. data/test/command_line_test.rb +8 -8
  176. data/test/configuration_test.rb +25 -0
  177. data/test/rails_integration_test.rb +9 -5
  178. metadata +160 -160
  179. data/deps.rip +0 -1
  180. data/lib/compass/frameworks/blueprint/templates/project/welcome.html.haml +0 -21
  181. data/lib/vendor/fssm/monitor.rb +0 -25
  182. data/lib/vendor/fssm/state.rb +0 -54
@@ -41,6 +41,6 @@ module Compass
41
41
  end
42
42
  end
43
43
 
44
- ['adapters', 'comments', 'defaults', 'helpers', 'inheritance', 'serialization', 'data'].each do |lib|
44
+ ['adapters', 'comments', 'defaults', 'helpers', 'inheritance', 'serialization', 'paths', 'data'].each do |lib|
45
45
  require "compass/configuration/#{lib}"
46
46
  end
@@ -22,10 +22,13 @@ module Compass
22
22
  include Compass::Configuration::Inheritance
23
23
  include Compass::Configuration::Serialization
24
24
  include Compass::Configuration::Adapters
25
+ extend Compass::Configuration::Paths
25
26
 
26
27
  inherited_accessor *ATTRIBUTES
27
28
  inherited_accessor :required_libraries #XXX we should make this array add up cumulatively.
28
29
 
30
+ strip_trailing_separator *ATTRIBUTES.select{|a| a.to_s =~ /dir|path/}
31
+
29
32
  def initialize(name, attr_hash = nil)
30
33
  raise "I need a name!" unless name
31
34
  @name = name
@@ -0,0 +1,19 @@
1
+ module Compass::Configuration::Paths
2
+
3
+ TRAILING_SEPARATOR = %r{.(/|#{Regexp.escape(File::SEPARATOR)})$}
4
+
5
+ def strip_trailing_separator(*attributes)
6
+ attributes.each do |attr|
7
+ alias_method "#{attr}_with_trailing_separator".to_sym, attr
8
+ class_eval %Q{
9
+ def #{attr} # def css_dir
10
+ path = #{attr}_with_trailing_separator # path = css_dir_with_trailing_separator
11
+ if path =~ TRAILING_SEPARATOR # if path =~ TRAILING_SEPARATOR
12
+ path = path[0..-($1.length+1)] # path = path[0..-($1.length+1)]
13
+ end # end
14
+ path # path
15
+ end # end
16
+ }
17
+ end
18
+ end
19
+ end
@@ -5,6 +5,8 @@ require 'compass/errors'
5
5
  require 'compass/actions'
6
6
  require 'compass/installers'
7
7
  require 'compass/commands'
8
+ require 'rbconfig'
9
+ require 'win32console' if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
8
10
 
9
11
  module Compass::Exec
10
12
  end
@@ -27,6 +27,10 @@ module Compass::Exec::GlobalOptionsParser
27
27
  self.options[:dry_run] = true
28
28
  end
29
29
 
30
+ opts.on('--boring', :NONE, 'Turn off colorized output.') do
31
+ self.options[:color_output] = false
32
+ end
33
+
30
34
  opts.on_tail("-?", "-h", "--help", "Show this message") do
31
35
  puts opts
32
36
  exit
@@ -154,6 +154,10 @@ END
154
154
  self.options[:command] = :print_version
155
155
  end
156
156
 
157
+ opts.on('--boring', :NONE, 'Turn off colorized output.') do
158
+ self.options[:color_output] = false
159
+ end
160
+
157
161
  end
158
162
 
159
163
  def do_command(command)
@@ -3,7 +3,7 @@ module Compass
3
3
  extend self
4
4
 
5
5
  ALL = []
6
- DEFAULT_FRAMEWORKS_PATH = File.join(Compass.lib_directory, 'compass', 'frameworks')
6
+ DEFAULT_FRAMEWORKS_PATH = File.join(Compass.base_directory, 'frameworks')
7
7
 
8
8
  class Framework
9
9
  attr_accessor :name
@@ -15,7 +15,7 @@ module Compass
15
15
 
16
16
  class << self
17
17
  def crc(chunkdata='')
18
- chunkdata.bytes.to_a.inject(0xffffffff){|crc, byte| CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8) } ^ 0xffffffff
18
+ chunkdata.unpack('C*').inject(0xffffffff){|crc, byte| CRC_TABLE[(crc ^ byte) & 0xff] ^ (crc >> 8) } ^ 0xffffffff
19
19
  end
20
20
 
21
21
  def chunk(type, data="")
@@ -64,14 +64,17 @@ module Compass
64
64
  # * <tt>:height</tt> -- Height (in pixels) of a row
65
65
  # * <tt>:filename</tt> -- Output path of grid.png file
66
66
  def initialize(options={})
67
- @column_width = options[:column_width]
68
- gutter_width = options[:gutter_width]
67
+ @column_width = options[:column_width] || 0
68
+ gutter_width = options[:gutter_width] || 0
69
69
 
70
70
  height = options[:height] || 20
71
+ width = @column_width + gutter_width
72
+ width = 10 if width == 0
73
+
71
74
  @filename = options[:filename]
72
75
  @options = options
73
76
 
74
- super(@column_width + gutter_width, height, [0xe9,0xe9,0xe9])
77
+ super(width, height, [0xe9,0xe9,0xe9])
75
78
  end
76
79
 
77
80
  def working_path
@@ -116,7 +116,7 @@ module Compass::SassExtensions::Functions::Urls
116
116
 
117
117
  def default_cache_buster(path, real_path)
118
118
  if File.readable?(real_path)
119
- File.mtime(real_path).strftime("%s")
119
+ File.mtime(real_path).to_i.to_s
120
120
  else
121
121
  $stderr.puts "WARNING: '#{File.basename(path)}' was not found (or cannot be read) in #{File.dirname(real_path)}"
122
122
  end
@@ -12,15 +12,7 @@ module FSSM
12
12
 
13
13
  def monitor(*args, &block)
14
14
  monitor = FSSM::Monitor.new
15
- context = args.empty? ? monitor : monitor.path(*args)
16
-
17
- if block_given?
18
- if block.arity == 1
19
- block.call(context)
20
- else
21
- context.instance_eval(&block)
22
- end
23
- end
15
+ FSSM::Support.use_block(args.empty? ? monitor : monitor.path(*args), block)
24
16
 
25
17
  monitor.run
26
18
  end
@@ -33,7 +25,8 @@ require 'fssm/pathname'
33
25
  require 'fssm/support'
34
26
  require 'fssm/tree'
35
27
  require 'fssm/path'
36
- require 'fssm/state'
28
+ require 'fssm/state/directory'
29
+ require 'fssm/state/file'
37
30
  require 'fssm/monitor'
38
31
 
39
32
  require "fssm/backends/#{FSSM::Support.backend.downcase}"
@@ -7,18 +7,17 @@ module FSSM::Backends
7
7
  @fsevents = []
8
8
  end
9
9
 
10
- def add_path(path, preload=true)
11
- handler = FSSM::State.new(path)
12
- @handlers["#{path}"] = handler
10
+ def add_handler(handler, preload=true)
11
+ @handlers[handler.path.to_s] = handler
13
12
 
14
- fsevent = Rucola::FSEvents.new("#{path}", {:latency => 0.5}) do |events|
13
+ fsevent = Rucola::FSEvents.new(handler.path.to_s, {:latency => 0.5}) do |events|
15
14
  events.each do |event|
16
15
  handler.refresh(event.path)
17
16
  end
18
17
  end
19
18
 
20
19
  fsevent.create_stream
21
- handler.refresh(path.to_pathname, true) if preload
20
+ handler.refresh(nil, true) if preload
22
21
  fsevent.start
23
22
  @fsevents << fsevent
24
23
  end
@@ -4,14 +4,12 @@ module FSSM::Backends
4
4
  @notifier = INotify::Notifier.new
5
5
  end
6
6
 
7
- def add_path(path, preload=true)
8
- handler = FSSM::State.new(path)
9
-
10
- @notifier.watch(path.to_s, :all_events) do |event|
7
+ def add_handler(handler, preload=true)
8
+ @notifier.watch(handler.path.to_s, :all_events) do |event|
11
9
  handler.refresh(event.name)
12
10
  end
13
11
 
14
- handler.refresh(path.to_pathname, true) if preload
12
+ handler.refresh(nil, true) if preload
15
13
  end
16
14
 
17
15
  def run
@@ -5,9 +5,8 @@ module FSSM::Backends
5
5
  @latency = options[:latency] || 1.5
6
6
  end
7
7
 
8
- def add_path(path, preload=true)
9
- handler = FSSM::State.new(path)
10
- handler.refresh(path.to_pathname, true) if preload
8
+ def add_handler(handler, preload=true)
9
+ handler.refresh(nil, true) if preload
11
10
  @handlers << handler
12
11
  end
13
12
 
@@ -0,0 +1,26 @@
1
+ class FSSM::Monitor
2
+ def initialize(options={})
3
+ @options = options
4
+ @backend = FSSM::Backends::Default.new
5
+ end
6
+
7
+ def path(*args, &block)
8
+ path = FSSM::Path.new(*args)
9
+ FSSM::Support.use_block(path, block)
10
+
11
+ @backend.add_handler(FSSM::State::Directory.new(path))
12
+ path
13
+ end
14
+
15
+ def file(*args, &block)
16
+ path = FSSM::Path.new(*args)
17
+ FSSM::Support.use_block(path, block)
18
+
19
+ @backend.add_handler(FSSM::State::File.new(path))
20
+ path
21
+ end
22
+
23
+ def run
24
+ @backend.run
25
+ end
26
+ end
@@ -81,7 +81,7 @@ class FSSM::Path
81
81
 
82
82
  def set_path(path)
83
83
  path = FSSM::Pathname.for(path)
84
- raise FSSM::FileNotFoundError, "#{path}" unless path.exist?
84
+ raise FSSM::FileNotFoundError, "No such file or directory - #{path}" unless path.exist?
85
85
  @path = path.expand_path
86
86
  end
87
87
 
@@ -0,0 +1,57 @@
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
@@ -0,0 +1,24 @@
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
@@ -37,15 +37,23 @@ module FSSM::Support
37
37
  end
38
38
 
39
39
  def rb_inotify?
40
- begin
41
- require 'rubygems'
42
- gem 'rb-inotify', '>= 0.3.0'
40
+ found = begin
43
41
  require 'rb-inotify'
44
- true
45
- rescue LoadError, Gem::LoadError
46
- STDERR.puts("Warning: Unable to load rb-inotify >= 0.3.0. Inotify will be unavailable.")
42
+ INotify::Notifier.ancestors.include?(IO)
43
+ rescue LoadError
47
44
  false
48
45
  end
46
+ STDERR.puts("Warning: Unable to load rb-inotify >= 0.3.0. Inotify will be unavailable.") unless found
47
+ found
48
+ end
49
+
50
+ def use_block(context, block)
51
+ return if block.nil?
52
+ if block.arity == 1
53
+ block.call(context)
54
+ else
55
+ context.instance_eval(&block)
56
+ end
49
57
  end
50
58
 
51
59
  end
@@ -7,7 +7,7 @@ module Compass::CommandLineHelper
7
7
  if block_given?
8
8
  responder = Responder.new
9
9
  yield responder
10
- IO.popen("-", "w+") do |io|
10
+ IO.popen("-", "r+") do |io|
11
11
  if io
12
12
  #parent process
13
13
  output = ""
@@ -26,6 +26,7 @@ module Compass::CommandLineHelper
26
26
  prompt = output.split("\n").last.strip
27
27
  if response = responder.response_for(prompt)
28
28
  io.puts response
29
+ io.flush
29
30
  end
30
31
  end
31
32
  end
@@ -60,7 +61,14 @@ module Compass::CommandLineHelper
60
61
  @responses << Response.new(prompt, options[:with], options[:required])
61
62
  end
62
63
  def response_for(prompt)
63
- response = @responses.detect{|r| r.prompt == prompt}
64
+ response = @responses.detect do |r|
65
+ case r.prompt
66
+ when Regexp
67
+ prompt =~ r.prompt
68
+ when String
69
+ r.prompt == prompt
70
+ end
71
+ end
64
72
  if response
65
73
  response.responded = true
66
74
  response.text
@@ -84,7 +92,7 @@ module Compass::CommandLineHelper
84
92
  end
85
93
  message = "Action #{action.inspect} was not performed on: #{path}."
86
94
  message += "The following actions were performed: #{actions_found.map{|a|a.inspect}.join(", ")}" if actions_found.any?
87
- puts @last_result
95
+ # puts @last_result
88
96
  fail message
89
97
  end
90
98
 
@@ -100,6 +108,8 @@ module Compass::CommandLineHelper
100
108
 
101
109
  def execute(*arguments)
102
110
  command_line_class = Compass::Exec::Helpers.select_appropriate_command_line_ui(arguments)
103
- command_line_class.new(arguments).run!
111
+ exit_code = command_line_class.new(arguments).run!
112
+ # fail "Command Failed with exit code: #{exit_code}" unless exit_code == 0
113
+ exit_code
104
114
  end
105
115
  end
@@ -25,7 +25,7 @@ class CommandLineTest < Test::Unit::TestCase
25
25
 
26
26
  def test_basic_install
27
27
  within_tmp_directory do
28
- compass "basic"
28
+ compass "--boring", "basic"
29
29
  assert File.exists?("basic/src/screen.sass")
30
30
  assert File.exists?("basic/stylesheets/screen.css")
31
31
  assert_action_performed :directory, "basic/"
@@ -35,11 +35,11 @@ class CommandLineTest < Test::Unit::TestCase
35
35
  end
36
36
  end
37
37
 
38
- def test_framework_installs
39
- Compass::Frameworks::ALL.each do |framework|
38
+ Compass::Frameworks::ALL.each do |framework|
39
+ define_method "test_#{framework.name}_installation" do
40
40
  within_tmp_directory do
41
- compass *%W(--framework #{framework.name} #{framework.name}_project)
42
- assert File.exists?("#{framework.name}_project/src/screen.sass")
41
+ compass *%W(--boring --framework #{framework.name} #{framework.name}_project)
42
+ assert File.exists?("#{framework.name}_project/src/screen.sass"), "src/screen.sass is missing. Found: #{Dir.glob("#{framework.name}_project/**/*").join(", ")}"
43
43
  assert File.exists?("#{framework.name}_project/stylesheets/screen.css")
44
44
  assert_action_performed :directory, "#{framework.name}_project/"
45
45
  assert_action_performed :create, "#{framework.name}_project/src/screen.sass"
@@ -51,13 +51,13 @@ class CommandLineTest < Test::Unit::TestCase
51
51
 
52
52
  def test_basic_update
53
53
  within_tmp_directory do
54
- compass "basic"
54
+ compass "--boring", "basic"
55
55
  Dir.chdir "basic" do
56
56
  # basic update with timestamp caching
57
- compass
57
+ compass "--boring"
58
58
  assert_action_performed :unchanged, "src/screen.sass"
59
59
  # basic update with force option set
60
- compass "--force"
60
+ compass "--force", "--boring"
61
61
  assert_action_performed :compile, "src/screen.sass"
62
62
  assert_action_performed :identical, "stylesheets/screen.css"
63
63
  end