compass-edge 0.9.1

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.
Files changed (312) hide show
  1. data/CHANGELOG.markdown +528 -0
  2. data/LICENSE.markdown +29 -0
  3. data/README.markdown +46 -0
  4. data/REVISION +1 -0
  5. data/Rakefile +131 -0
  6. data/VERSION.yml +4 -0
  7. data/bin/compass +26 -0
  8. data/deps.rip +1 -0
  9. data/examples/README.markdown +4 -0
  10. data/examples/blueprint_default/config.rb +7 -0
  11. data/examples/blueprint_default/images/grid.png +0 -0
  12. data/examples/blueprint_default/index.html.haml +85 -0
  13. data/examples/blueprint_default/parts/elements.html.haml +282 -0
  14. data/examples/blueprint_default/parts/forms.html.haml +190 -0
  15. data/examples/blueprint_default/parts/grid.html.haml +274 -0
  16. data/examples/blueprint_default/parts/test-small.jpg +0 -0
  17. data/examples/blueprint_default/parts/test.jpg +0 -0
  18. data/examples/blueprint_default/parts/valid.png +0 -0
  19. data/examples/blueprint_default/src/ie.sass +3 -0
  20. data/examples/blueprint_default/src/images/grid.png +0 -0
  21. data/examples/blueprint_default/src/print.sass +3 -0
  22. data/examples/blueprint_default/src/screen.sass +8 -0
  23. data/examples/blueprint_plugins/config.rb +8 -0
  24. data/examples/blueprint_plugins/images/buttons/cross.png +0 -0
  25. data/examples/blueprint_plugins/images/buttons/key.png +0 -0
  26. data/examples/blueprint_plugins/images/buttons/tick.png +0 -0
  27. data/examples/blueprint_plugins/images/grid.png +0 -0
  28. data/examples/blueprint_plugins/images/link_icons/doc.png +0 -0
  29. data/examples/blueprint_plugins/images/link_icons/email.png +0 -0
  30. data/examples/blueprint_plugins/images/link_icons/external.png +0 -0
  31. data/examples/blueprint_plugins/images/link_icons/feed.png +0 -0
  32. data/examples/blueprint_plugins/images/link_icons/im.png +0 -0
  33. data/examples/blueprint_plugins/images/link_icons/pdf.png +0 -0
  34. data/examples/blueprint_plugins/images/link_icons/visited.png +0 -0
  35. data/examples/blueprint_plugins/images/link_icons/xls.png +0 -0
  36. data/examples/blueprint_plugins/images/test-small.jpg +0 -0
  37. data/examples/blueprint_plugins/images/test.jpg +0 -0
  38. data/examples/blueprint_plugins/images/valid.png +0 -0
  39. data/examples/blueprint_plugins/index.html.haml +96 -0
  40. data/examples/blueprint_plugins/plugins/buttons.html.haml +67 -0
  41. data/examples/blueprint_plugins/plugins/fancy_type.html.haml +100 -0
  42. data/examples/blueprint_plugins/plugins/link_icons.html.haml +61 -0
  43. data/examples/blueprint_plugins/plugins/rtl.html.haml +100 -0
  44. data/examples/blueprint_plugins/src/buttons.sass +49 -0
  45. data/examples/blueprint_plugins/src/ie.sass +3 -0
  46. data/examples/blueprint_plugins/src/images/grid.png +0 -0
  47. data/examples/blueprint_plugins/src/link_icons.sass +13 -0
  48. data/examples/blueprint_plugins/src/print.sass +3 -0
  49. data/examples/blueprint_plugins/src/rtl_screen.sass +13 -0
  50. data/examples/blueprint_plugins/src/screen.sass +11 -0
  51. data/examples/blueprint_scoped/images/grid.png +0 -0
  52. data/examples/blueprint_scoped/src/ie.sass +4 -0
  53. data/examples/blueprint_scoped/src/print.sass +4 -0
  54. data/examples/blueprint_scoped/src/screen.sass +5 -0
  55. data/examples/blueprint_scoped_form/images/grid.png +0 -0
  56. data/examples/blueprint_scoped_form/src/ie.sass +3 -0
  57. data/examples/blueprint_scoped_form/src/print.sass +3 -0
  58. data/examples/blueprint_scoped_form/src/screen.sass +10 -0
  59. data/examples/blueprint_semantic/config.rb +7 -0
  60. data/examples/blueprint_semantic/images/grid.png +0 -0
  61. data/examples/blueprint_semantic/index.html.haml +86 -0
  62. data/examples/blueprint_semantic/parts/fancy_type.html.haml +100 -0
  63. data/examples/blueprint_semantic/parts/liquid.html.haml +100 -0
  64. data/examples/blueprint_semantic/parts/test-small.jpg +0 -0
  65. data/examples/blueprint_semantic/parts/test.jpg +0 -0
  66. data/examples/blueprint_semantic/parts/valid.png +0 -0
  67. data/examples/blueprint_semantic/src/ie.sass +3 -0
  68. data/examples/blueprint_semantic/src/images/grid.png +0 -0
  69. data/examples/blueprint_semantic/src/liquid.sass +69 -0
  70. data/examples/blueprint_semantic/src/print.sass +3 -0
  71. data/examples/blueprint_semantic/src/screen.sass +70 -0
  72. data/examples/compass/compass.html.haml +39 -0
  73. data/examples/compass/config.rb +7 -0
  74. data/examples/compass/images/blue_arrow.gif +0 -0
  75. data/examples/compass/src/compass.sass +47 -0
  76. data/examples/compass/src/images/blue_arrow.gif +0 -0
  77. data/examples/compass/src/sticky_footer.sass +11 -0
  78. data/examples/compass/src/utilities.sass +108 -0
  79. data/examples/compass/sticky_footer.html.haml +14 -0
  80. data/examples/compass/utilities.html.haml +189 -0
  81. data/examples/downloader.rb +57 -0
  82. data/examples/logo/logo.html.haml +40 -0
  83. data/examples/logo/src/ie.sass +6 -0
  84. data/examples/logo/src/print.sass +6 -0
  85. data/examples/logo/src/screen.sass +29 -0
  86. data/examples/ninesixty/bootstrap.rb +4 -0
  87. data/examples/ninesixty/config.rb +9 -0
  88. data/examples/ninesixty/extensions/ninesixty/README.mkdn +56 -0
  89. data/examples/ninesixty/extensions/ninesixty/compass-960-plugin.gemspec +36 -0
  90. data/examples/ninesixty/extensions/ninesixty/lib/ninesixty.rb +1 -0
  91. data/examples/ninesixty/extensions/ninesixty/lib/ninesixty/compass_plugin.rb +5 -0
  92. data/examples/ninesixty/extensions/ninesixty/sass/960/_grid.sass +64 -0
  93. data/examples/ninesixty/extensions/ninesixty/sass/960/_text.sass +59 -0
  94. data/examples/ninesixty/extensions/ninesixty/templates/project/grid.sass +34 -0
  95. data/examples/ninesixty/extensions/ninesixty/templates/project/manifest.rb +2 -0
  96. data/examples/ninesixty/extensions/ninesixty/templates/project/text.sass +10 -0
  97. data/examples/ninesixty/src/grid.sass +16 -0
  98. data/examples/ninesixty/src/text.sass +10 -0
  99. data/examples/yui/bootstrap.rb +3 -0
  100. data/examples/yui/divisions.html.haml +179 -0
  101. data/examples/yui/extensions/yui/stylesheets/_yui.sass +7 -0
  102. data/examples/yui/extensions/yui/stylesheets/yui/modules/_base.sass +70 -0
  103. data/examples/yui/extensions/yui/stylesheets/yui/modules/_fonts.sass +45 -0
  104. data/examples/yui/extensions/yui/stylesheets/yui/modules/_grids.sass +385 -0
  105. data/examples/yui/extensions/yui/stylesheets/yui/modules/_reset.sass +61 -0
  106. data/examples/yui/extensions/yui/templates/project/manifest.rb +1 -0
  107. data/examples/yui/extensions/yui/templates/project/screen.sass +4 -0
  108. data/examples/yui/index.html.haml +19 -0
  109. data/examples/yui/src/screen.sass +13 -0
  110. data/examples/yui/sub_divisions.html.haml +169 -0
  111. data/examples/yui/templates.html.haml +54 -0
  112. data/examples/yui/test.jpg +0 -0
  113. data/examples/yui/typography.html.haml +132 -0
  114. data/lib/compass.rb +22 -0
  115. data/lib/compass/actions.rb +116 -0
  116. data/lib/compass/app_integration.rb +3 -0
  117. data/lib/compass/app_integration/merb.rb +1 -0
  118. data/lib/compass/app_integration/merb/runtime.rb +63 -0
  119. data/lib/compass/app_integration/rails.rb +8 -0
  120. data/lib/compass/app_integration/rails/action_controller.rb +15 -0
  121. data/lib/compass/app_integration/rails/configuration_defaults.rb +29 -0
  122. data/lib/compass/app_integration/rails/installer.rb +127 -0
  123. data/lib/compass/app_integration/rails/runtime.rb +14 -0
  124. data/lib/compass/app_integration/rails/sass_plugin.rb +5 -0
  125. data/lib/compass/app_integration/rails/templates/compass-install-rails.rb +80 -0
  126. data/lib/compass/app_integration/rails/urls.rb +14 -0
  127. data/lib/compass/app_integration/stand_alone.rb +3 -0
  128. data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +24 -0
  129. data/lib/compass/app_integration/stand_alone/installer.rb +71 -0
  130. data/lib/compass/commands.rb +11 -0
  131. data/lib/compass/commands/base.rb +36 -0
  132. data/lib/compass/commands/create_project.rb +113 -0
  133. data/lib/compass/commands/generate_grid_background.rb +91 -0
  134. data/lib/compass/commands/help.rb +62 -0
  135. data/lib/compass/commands/installer_command.rb +34 -0
  136. data/lib/compass/commands/list_frameworks.rb +16 -0
  137. data/lib/compass/commands/print_version.rb +91 -0
  138. data/lib/compass/commands/project_base.rb +92 -0
  139. data/lib/compass/commands/registry.rb +22 -0
  140. data/lib/compass/commands/stamp_pattern.rb +86 -0
  141. data/lib/compass/commands/update_project.rb +38 -0
  142. data/lib/compass/commands/validate_project.rb +21 -0
  143. data/lib/compass/commands/watch_project.rb +69 -0
  144. data/lib/compass/commands/write_configuration.rb +32 -0
  145. data/lib/compass/compiler.rb +54 -0
  146. data/lib/compass/configuration.rb +38 -0
  147. data/lib/compass/configuration/adapters.rb +59 -0
  148. data/lib/compass/configuration/comments.rb +22 -0
  149. data/lib/compass/configuration/data.rb +103 -0
  150. data/lib/compass/configuration/defaults.rb +107 -0
  151. data/lib/compass/configuration/helpers.rb +83 -0
  152. data/lib/compass/configuration/inheritance.rb +170 -0
  153. data/lib/compass/configuration/serialization.rb +86 -0
  154. data/lib/compass/core_ext.rb +14 -0
  155. data/lib/compass/dependencies.rb +6 -0
  156. data/lib/compass/errors.rb +7 -0
  157. data/lib/compass/exec.rb +15 -0
  158. data/lib/compass/exec/command_option_parser.rb +23 -0
  159. data/lib/compass/exec/global_options_parser.rb +37 -0
  160. data/lib/compass/exec/helpers.rb +28 -0
  161. data/lib/compass/exec/project_options_parser.rb +42 -0
  162. data/lib/compass/exec/sub_command_ui.rb +45 -0
  163. data/lib/compass/exec/switch_ui.rb +166 -0
  164. data/lib/compass/frameworks.rb +53 -0
  165. data/lib/compass/frameworks/blueprint/stylesheets/_blueprint.sass +3 -0
  166. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_ie.sass +99 -0
  167. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_print.sass +90 -0
  168. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_reset.sass +3 -0
  169. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/_screen.sass +29 -0
  170. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_buttons.sass +84 -0
  171. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass +33 -0
  172. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass +9 -0
  173. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass +82 -0
  174. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass +55 -0
  175. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +178 -0
  176. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass +58 -0
  177. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_link_icons.sass +44 -0
  178. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +141 -0
  179. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_reset.sass +56 -0
  180. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_rtl.sass +122 -0
  181. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass +47 -0
  182. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +160 -0
  183. data/lib/compass/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +37 -0
  184. data/lib/compass/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
  185. data/lib/compass/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
  186. data/lib/compass/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
  187. data/lib/compass/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
  188. data/lib/compass/frameworks/blueprint/templates/buttons/manifest.rb +5 -0
  189. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +13 -0
  190. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
  191. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
  192. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
  193. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
  194. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
  195. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
  196. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
  197. data/lib/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
  198. data/lib/compass/frameworks/blueprint/templates/link_icons/manifest.rb +10 -0
  199. data/lib/compass/frameworks/blueprint/templates/project/grid.png +0 -0
  200. data/lib/compass/frameworks/blueprint/templates/project/ie.sass +16 -0
  201. data/lib/compass/frameworks/blueprint/templates/project/manifest.rb +8 -0
  202. data/lib/compass/frameworks/blueprint/templates/project/partials/_base.sass +11 -0
  203. data/lib/compass/frameworks/blueprint/templates/project/print.sass +8 -0
  204. data/lib/compass/frameworks/blueprint/templates/project/screen.sass +47 -0
  205. data/lib/compass/frameworks/blueprint/templates/project/welcome.html.haml +13 -0
  206. data/lib/compass/frameworks/compass/stylesheets/_compass.sass +1 -0
  207. data/lib/compass/frameworks/compass/stylesheets/compass/_layout.sass +1 -0
  208. data/lib/compass/frameworks/compass/stylesheets/compass/_misc.sass +24 -0
  209. data/lib/compass/frameworks/compass/stylesheets/compass/_reset.sass +3 -0
  210. data/lib/compass/frameworks/compass/stylesheets/compass/_utilities.sass +7 -0
  211. data/lib/compass/frameworks/compass/stylesheets/compass/layout/_sticky_footer.sass +19 -0
  212. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_css3.sass +6 -0
  213. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_general.sass +5 -0
  214. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_links.sass +3 -0
  215. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_lists.sass +3 -0
  216. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_print.sass +18 -0
  217. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.sass +1 -0
  218. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_tables.sass +3 -0
  219. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/_text.sass +2 -0
  220. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_border_radius.sass +47 -0
  221. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_shadow.sass +12 -0
  222. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_box_sizing.sass +13 -0
  223. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_columns.sass +37 -0
  224. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_inline_block.sass +7 -0
  225. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/css3/_opacity.sass +18 -0
  226. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass +24 -0
  227. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.sass +17 -0
  228. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.sass +6 -0
  229. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.sass +134 -0
  230. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.sass +0 -0
  231. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag_cloud.sass +19 -0
  232. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover_link.sass +5 -0
  233. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_link_colors.sass +24 -0
  234. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass +7 -0
  235. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.sass +21 -0
  236. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +52 -0
  237. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline_list.sass +29 -0
  238. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite_img.sass +52 -0
  239. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass +20 -0
  240. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.sass +27 -0
  241. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.sass +9 -0
  242. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass +13 -0
  243. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.sass +3 -0
  244. data/lib/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass +17 -0
  245. data/lib/compass/frameworks/compass/templates/ellipsis/ellipsis.sass +6 -0
  246. data/lib/compass/frameworks/compass/templates/ellipsis/manifest.rb +2 -0
  247. data/lib/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml +14 -0
  248. data/lib/compass/frameworks/compass/templates/extension/manifest.rb +6 -0
  249. data/lib/compass/frameworks/compass/templates/extension/stylesheets/main.sass +1 -0
  250. data/lib/compass/frameworks/compass/templates/extension/templates/project/manifest.rb +2 -0
  251. data/lib/compass/frameworks/compass/templates/extension/templates/project/screen.sass +2 -0
  252. data/lib/compass/frameworks/compass/templates/project/ie.sass +6 -0
  253. data/lib/compass/frameworks/compass/templates/project/manifest.rb +3 -0
  254. data/lib/compass/frameworks/compass/templates/project/print.sass +6 -0
  255. data/lib/compass/frameworks/compass/templates/project/screen.sass +13 -0
  256. data/lib/compass/grid_builder.rb +76 -0
  257. data/lib/compass/installers.rb +3 -0
  258. data/lib/compass/installers/base.rb +186 -0
  259. data/lib/compass/installers/manifest.rb +79 -0
  260. data/lib/compass/installers/template_context.rb +44 -0
  261. data/lib/compass/logger.rb +42 -0
  262. data/lib/compass/sass_extensions.rb +5 -0
  263. data/lib/compass/sass_extensions/functions.rb +19 -0
  264. data/lib/compass/sass_extensions/functions/display.rb +22 -0
  265. data/lib/compass/sass_extensions/functions/enumerate.rb +6 -0
  266. data/lib/compass/sass_extensions/functions/inline_image.rb +35 -0
  267. data/lib/compass/sass_extensions/functions/selectors.rb +42 -0
  268. data/lib/compass/sass_extensions/functions/urls.rb +105 -0
  269. data/lib/compass/sass_extensions/monkey_patches.rb +3 -0
  270. data/lib/compass/sass_extensions/monkey_patches/stylesheet_updating.rb +23 -0
  271. data/lib/compass/test_case.rb +38 -0
  272. data/lib/compass/validator.rb +10 -0
  273. data/lib/compass/version.rb +57 -0
  274. data/lib/vendor/fssm.rb +28 -0
  275. data/lib/vendor/fssm/backends/fsevents.rb +78 -0
  276. data/lib/vendor/fssm/backends/polling.rb +24 -0
  277. data/lib/vendor/fssm/ext.rb +7 -0
  278. data/lib/vendor/fssm/monitor.rb +21 -0
  279. data/lib/vendor/fssm/path.rb +88 -0
  280. data/lib/vendor/fssm/state.rb +46 -0
  281. data/lib/vendor/fssm/support.rb +26 -0
  282. data/test/command_line_helper.rb +97 -0
  283. data/test/command_line_test.rb +67 -0
  284. data/test/compass_test.rb +132 -0
  285. data/test/configuration_test.rb +123 -0
  286. data/test/fixtures/stylesheets/blueprint/config.rb +9 -0
  287. data/test/fixtures/stylesheets/blueprint/css/typography.css +158 -0
  288. data/test/fixtures/stylesheets/blueprint/images/grid.png +0 -0
  289. data/test/fixtures/stylesheets/blueprint/sass/ie.sass +3 -0
  290. data/test/fixtures/stylesheets/blueprint/sass/print.sass +3 -0
  291. data/test/fixtures/stylesheets/blueprint/sass/screen.sass +17 -0
  292. data/test/fixtures/stylesheets/blueprint/sass/typography.sass +3 -0
  293. data/test/fixtures/stylesheets/compass/config.rb +9 -0
  294. data/test/fixtures/stylesheets/compass/css/layout.css +15 -0
  295. data/test/fixtures/stylesheets/compass/css/print.css +18 -0
  296. data/test/fixtures/stylesheets/compass/css/reset.css +60 -0
  297. data/test/fixtures/stylesheets/compass/css/utilities.css +17 -0
  298. data/test/fixtures/stylesheets/compass/sass/layout.sass +3 -0
  299. data/test/fixtures/stylesheets/compass/sass/print.sass +5 -0
  300. data/test/fixtures/stylesheets/compass/sass/reset.sass +10 -0
  301. data/test/fixtures/stylesheets/compass/sass/utilities.sass +6 -0
  302. data/test/fixtures/stylesheets/image_urls/config.rb +17 -0
  303. data/test/fixtures/stylesheets/image_urls/css/screen.css +3 -0
  304. data/test/fixtures/stylesheets/image_urls/images/grid.png +0 -0
  305. data/test/fixtures/stylesheets/image_urls/sass/screen.sass +6 -0
  306. data/test/io_helper.rb +19 -0
  307. data/test/rails_integration_test.rb +84 -0
  308. data/test/sass_extensions_test.rb +31 -0
  309. data/test/test_case_helper.rb +13 -0
  310. data/test/test_helper.rb +27 -0
  311. data/test/test_rails_helper.rb +20 -0
  312. metadata +404 -0
@@ -0,0 +1,67 @@
1
+ require File.dirname(__FILE__)+'/test_helper'
2
+ require 'fileutils'
3
+ require 'compass'
4
+ require 'compass/exec'
5
+ require 'timeout'
6
+
7
+ class CommandLineTest < Test::Unit::TestCase
8
+ include Compass::TestCaseHelper
9
+ include Compass::CommandLineHelper
10
+ include Compass::IoHelper
11
+
12
+ def teardown
13
+ Compass.reset_configuration!
14
+ end
15
+
16
+ def test_print_version
17
+ compass "-vq"
18
+ assert_match /\d+\.\d+\.\d+( [0-9a-f]+)?/, @last_result
19
+ end
20
+
21
+ def test_list_frameworks
22
+ compass "--list-frameworks"
23
+ assert_equal(%w(blueprint compass), @last_result.split.sort)
24
+ end
25
+
26
+ def test_basic_install
27
+ within_tmp_directory do
28
+ compass "basic"
29
+ assert File.exists?("basic/src/screen.sass")
30
+ assert File.exists?("basic/stylesheets/screen.css")
31
+ assert_action_performed :directory, "basic/"
32
+ assert_action_performed :create, "basic/src/screen.sass"
33
+ assert_action_performed :compile, "basic/src/screen.sass"
34
+ assert_action_performed :create, "basic/stylesheets/screen.css"
35
+ end
36
+ end
37
+
38
+ def test_framework_installs
39
+ Compass::Frameworks::ALL.each do |framework|
40
+ within_tmp_directory do
41
+ compass *%W(--framework #{framework.name} #{framework.name}_project)
42
+ assert File.exists?("#{framework.name}_project/src/screen.sass")
43
+ assert File.exists?("#{framework.name}_project/stylesheets/screen.css")
44
+ assert_action_performed :directory, "#{framework.name}_project/"
45
+ assert_action_performed :create, "#{framework.name}_project/src/screen.sass"
46
+ assert_action_performed :compile, "#{framework.name}_project/src/screen.sass"
47
+ assert_action_performed :create, "#{framework.name}_project/stylesheets/screen.css"
48
+ end
49
+ end
50
+ end
51
+
52
+ def test_basic_update
53
+ within_tmp_directory do
54
+ compass "basic"
55
+ Dir.chdir "basic" do
56
+ # basic update with timestamp caching
57
+ compass
58
+ assert_action_performed :unchanged, "src/screen.sass"
59
+ # basic update with force option set
60
+ compass "--force"
61
+ assert_action_performed :compile, "src/screen.sass"
62
+ assert_action_performed :identical, "stylesheets/screen.css"
63
+ end
64
+ end
65
+ end
66
+
67
+ end
@@ -0,0 +1,132 @@
1
+ require File.dirname(__FILE__)+'/test_helper'
2
+ require 'fileutils'
3
+ require 'compass'
4
+
5
+ class CompassTest < Test::Unit::TestCase
6
+ include Compass::TestCaseHelper
7
+ def setup
8
+ Compass.reset_configuration!
9
+ end
10
+
11
+ def teardown
12
+ teardown_fixtures :blueprint, :empty, :compass, :image_urls
13
+ end
14
+
15
+ def teardown_fixtures(*project_names)
16
+ project_names.each do |project_name|
17
+ FileUtils.rm_rf tempfile_path(project_name)
18
+ end
19
+ end
20
+
21
+ def test_empty_project
22
+ # With no sass files, we should have no css files.
23
+ within_project(:empty) do |proj|
24
+ return unless proj.css_path && File.exists?(proj.css_path)
25
+ Dir.new(proj.css_path).each do |f|
26
+ fail "This file should not have been generated: #{f}" unless f == "." || f == ".."
27
+ end
28
+ end
29
+ end
30
+
31
+ def test_blueprint
32
+ within_project(:blueprint) do |proj|
33
+ each_css_file(proj.css_path) do |css_file|
34
+ assert_no_errors css_file, :blueprint
35
+ end
36
+ assert_renders_correctly :typography
37
+ end
38
+ end
39
+
40
+ def test_compass
41
+ within_project('compass') do |proj|
42
+ each_css_file(proj.css_path) do |css_file|
43
+ assert_no_errors css_file, 'compass'
44
+ end
45
+ assert_renders_correctly :reset, :layout, :utilities
46
+ end
47
+ end
48
+
49
+ def test_image_urls
50
+ within_project('image_urls') do |proj|
51
+ each_css_file(proj.css_path) do |css_file|
52
+ assert_no_errors css_file, 'image_urls'
53
+ end
54
+ assert_renders_correctly :screen
55
+ end
56
+ end
57
+
58
+ private
59
+ def assert_no_errors(css_file, project_name)
60
+ file = css_file[(tempfile_path(project_name).size+1)..-1]
61
+ msg = "Syntax Error found in #{file}. Results saved into #{save_path(project_name)}/#{file}"
62
+ assert_equal 0, open(css_file).readlines.grep(/Sass::SyntaxError/).size, msg
63
+ end
64
+
65
+ def assert_renders_correctly(*arguments)
66
+ options = arguments.last.is_a?(Hash) ? arguments.pop : {}
67
+ for name in arguments
68
+ actual_result_file = "#{tempfile_path(@current_project)}/#{name}.css"
69
+ expected_result_file = "#{result_path(@current_project)}/#{name}.css"
70
+ actual_lines = File.read(actual_result_file).split("\n")
71
+ expected_lines = File.read(expected_result_file).split("\n")
72
+ expected_lines.zip(actual_lines).each_with_index do |pair, line|
73
+ message = "template: #{name}\nline: #{line + 1}"
74
+ assert_equal(pair.first, pair.last, message)
75
+ end
76
+ if expected_lines.size < actual_lines.size
77
+ assert(false, "#{actual_lines.size - expected_lines.size} Trailing lines found in #{actual_result_file}.css: #{actual_lines[expected_lines.size..-1].join('\n')}")
78
+ end
79
+ end
80
+ end
81
+
82
+ def within_project(project_name)
83
+ @current_project = project_name
84
+ Compass.add_configuration(configuration_file(project_name)) if File.exists?(configuration_file(project_name))
85
+ Compass.configuration.project_path = project_path(project_name)
86
+ args = Compass.configuration.to_compiler_arguments(:logger => Compass::NullLogger.new)
87
+ if Compass.configuration.sass_path && File.exists?(Compass.configuration.sass_path)
88
+ compiler = Compass::Compiler.new *args
89
+ compiler.run
90
+ end
91
+ yield Compass.configuration
92
+ rescue
93
+ save_output(project_name)
94
+ raise
95
+ end
96
+
97
+ def each_css_file(dir)
98
+ Dir.glob("#{dir}/**/*.css").each do |css_file|
99
+ yield css_file
100
+ end
101
+ end
102
+
103
+ def save_output(dir)
104
+ FileUtils.rm_rf(save_path(dir))
105
+ FileUtils.cp_r(tempfile_path(dir), save_path(dir)) if File.exists?(tempfile_path(dir))
106
+ end
107
+
108
+ def project_path(project_name)
109
+ absolutize("fixtures/stylesheets/#{project_name}")
110
+ end
111
+
112
+ def configuration_file(project_name)
113
+ File.join(project_path(project_name), "config.rb")
114
+ end
115
+
116
+ def tempfile_path(project_name)
117
+ File.join(project_path(project_name), "tmp")
118
+ end
119
+
120
+ def template_path(project_name)
121
+ File.join(project_path(project_name), "sass")
122
+ end
123
+
124
+ def result_path(project_name)
125
+ File.join(project_path(project_name), "css")
126
+ end
127
+
128
+ def save_path(project_name)
129
+ File.join(project_path(project_name), "saved")
130
+ end
131
+
132
+ end
@@ -0,0 +1,123 @@
1
+ require File.dirname(__FILE__)+'/test_helper'
2
+ require 'compass'
3
+ require 'stringio'
4
+
5
+ class ConfigurationTest < Test::Unit::TestCase
6
+ include Compass::IoHelper
7
+
8
+ def setup
9
+ Compass.reset_configuration!
10
+ end
11
+
12
+ def test_parse_and_serialize
13
+ contents = StringIO.new(<<-CONFIG)
14
+ require 'compass'
15
+ # Require any additional compass plugins here.
16
+
17
+ project_type = :stand_alone
18
+ css_dir = "css"
19
+ sass_dir = "sass"
20
+ images_dir = "img"
21
+ javascripts_dir = "js"
22
+ # Set this to the root of your project when deployed:
23
+ http_path = "/"
24
+ output_style = :nested
25
+ # To enable relative paths to assets via compass helper functions. Uncomment:
26
+ # relative_assets = true
27
+ CONFIG
28
+
29
+ Compass.add_configuration(contents, "test_parse")
30
+
31
+ assert_equal 'sass', Compass.configuration.sass_dir
32
+ assert_equal 'css', Compass.configuration.css_dir
33
+ assert_equal 'img', Compass.configuration.images_dir
34
+ assert_equal 'js', Compass.configuration.javascripts_dir
35
+
36
+ expected_lines = contents.string.split("\n").map{|l|l.strip}
37
+ actual_lines = Compass.configuration.serialize.split("\n").map{|l|l.strip}
38
+ assert_equal expected_lines, actual_lines
39
+ end
40
+
41
+ def test_serialization_warns_with_asset_host_set
42
+ contents = StringIO.new(<<-CONFIG)
43
+ asset_host do |path|
44
+ "http://example.com"
45
+ end
46
+ CONFIG
47
+
48
+ Compass.add_configuration(contents, "test_serialization_warns_with_asset_host_set")
49
+
50
+ warning = capture_warning do
51
+ Compass.configuration.serialize
52
+ end
53
+ assert_equal "WARNING: asset_host is code and cannot be written to a file. You'll need to copy it yourself.\n", warning
54
+ end
55
+
56
+ def test_serialization_warns_with_asset_cache_buster_set
57
+ contents = StringIO.new(<<-CONFIG)
58
+ asset_cache_buster do |path|
59
+ "http://example.com"
60
+ end
61
+ CONFIG
62
+
63
+ Compass.add_configuration(contents, "test_serialization_warns_with_asset_cache_buster_set")
64
+
65
+ warning = capture_warning do
66
+ Compass.configuration.serialize
67
+ end
68
+ assert_equal "WARNING: asset_cache_buster is code and cannot be written to a file. You'll need to copy it yourself.\n", warning
69
+ end
70
+
71
+ def test_additional_import_paths
72
+ contents = StringIO.new(<<-CONFIG)
73
+ http_path = "/"
74
+ project_path = "/home/chris/my_compass_project"
75
+ css_dir = "css"
76
+ additional_import_paths = ["../foo"]
77
+ add_import_path "/path/to/my/framework"
78
+ CONFIG
79
+
80
+ Compass.add_configuration(contents, "test_additional_import_paths")
81
+
82
+ assert Compass.configuration.to_sass_engine_options[:load_paths].include?("/home/chris/my_compass_project/../foo")
83
+ assert Compass.configuration.to_sass_engine_options[:load_paths].include?("/path/to/my/framework"), Compass.configuration.to_sass_engine_options[:load_paths].inspect
84
+ assert_equal "/home/chris/my_compass_project/css/framework", Compass.configuration.to_sass_plugin_options[:template_location]["/path/to/my/framework"]
85
+ assert_equal "/home/chris/my_compass_project/css/foo", Compass.configuration.to_sass_plugin_options[:template_location]["/home/chris/my_compass_project/../foo"]
86
+
87
+ expected_serialization = <<EXPECTED
88
+ # Require any additional compass plugins here.
89
+ project_path = "/home/chris/my_compass_project"
90
+ css_dir = "css"
91
+ # Set this to the root of your project when deployed:
92
+ http_path = "/"
93
+ # To enable relative paths to assets via compass helper functions. Uncomment:
94
+ # relative_assets = true
95
+ additional_import_paths = ["../foo", "/path/to/my/framework"]
96
+ EXPECTED
97
+ assert_equal "/", Compass.configuration.http_path
98
+ assert_equal expected_serialization.split("\n"), Compass.configuration.serialize.split("\n")
99
+ end
100
+
101
+ def test_sass_options
102
+ contents = StringIO.new(<<-CONFIG)
103
+ sass_options = {:foo => 'bar'}
104
+ CONFIG
105
+
106
+ Compass.add_configuration(contents, "test_sass_options")
107
+
108
+ assert_equal 'bar', Compass.configuration.to_sass_engine_options[:foo]
109
+ assert_equal 'bar', Compass.configuration.to_sass_plugin_options[:foo]
110
+
111
+ expected_serialization = <<EXPECTED
112
+ # Require any additional compass plugins here.
113
+ # Set this to the root of your project when deployed:
114
+ http_path = "/"
115
+ # To enable relative paths to assets via compass helper functions. Uncomment:
116
+ # relative_assets = true
117
+ sass_options = {:foo=>"bar"}
118
+ EXPECTED
119
+
120
+ assert_equal expected_serialization, Compass.configuration.serialize
121
+ end
122
+
123
+ end
@@ -0,0 +1,9 @@
1
+ # Require any additional compass plugins here.
2
+ project_type = :stand_alone
3
+ css_dir = "tmp"
4
+ sass_dir = "sass"
5
+ images_dir = "images"
6
+ output_style = :nested
7
+ # To enable relative image paths using the images_url() function:
8
+ # http_images_path = :relative
9
+ http_images_path = "/images"
@@ -0,0 +1,158 @@
1
+ body {
2
+ line-height: 1.5;
3
+ font-family: Helvetica Neue, Arial, Helvetica, sans-serif;
4
+ color: #333333;
5
+ font-size: 75%; }
6
+
7
+ h1 {
8
+ font-weight: normal;
9
+ color: #222222;
10
+ font-size: 3em;
11
+ line-height: 1;
12
+ margin-bottom: 0.5em; }
13
+ h1 img {
14
+ margin: 0; }
15
+
16
+ h2 {
17
+ font-weight: normal;
18
+ color: #222222;
19
+ font-size: 2em;
20
+ margin-bottom: 0.75em; }
21
+
22
+ h3 {
23
+ font-weight: normal;
24
+ color: #222222;
25
+ font-size: 1.5em;
26
+ line-height: 1;
27
+ margin-bottom: 1em; }
28
+
29
+ h4 {
30
+ font-weight: normal;
31
+ color: #222222;
32
+ font-size: 1.2em;
33
+ line-height: 1.25;
34
+ margin-bottom: 1.25em; }
35
+
36
+ h5 {
37
+ font-weight: normal;
38
+ color: #222222;
39
+ font-size: 1em;
40
+ font-weight: bold;
41
+ margin-bottom: 1.5em; }
42
+
43
+ h6 {
44
+ font-weight: normal;
45
+ color: #222222;
46
+ font-size: 1em;
47
+ font-weight: bold; }
48
+
49
+ h2 img, h3 img, h4 img, h5 img, h6 img {
50
+ margin: 0; }
51
+
52
+ p {
53
+ margin: 0 0 1.5em; }
54
+ p img.left {
55
+ display: inline;
56
+ float: left;
57
+ margin: 1.5em 1.5em 1.5em 0;
58
+ padding: 0; }
59
+ p img.right {
60
+ display: inline;
61
+ float: right;
62
+ margin: 1.5em 0 1.5em 1.5em;
63
+ padding: 0; }
64
+
65
+ a {
66
+ text-decoration: underline;
67
+ color: #000099; }
68
+ a:visited {
69
+ color: #000066; }
70
+ a:focus {
71
+ color: black; }
72
+ a:hover {
73
+ color: black; }
74
+ a:active {
75
+ color: #cc0099; }
76
+
77
+ blockquote {
78
+ margin: 1.5em;
79
+ color: #666;
80
+ font-style: italic; }
81
+
82
+ strong {
83
+ font-weight: bold; }
84
+
85
+ em {
86
+ font-style: italic; }
87
+
88
+ dfn {
89
+ font-style: italic;
90
+ font-weight: bold; }
91
+
92
+ sup, sub {
93
+ line-height: 0; }
94
+
95
+ abbr, acronym {
96
+ border-bottom: 1px dotted #666; }
97
+
98
+ address {
99
+ margin: 0 0 1.5em;
100
+ font-style: italic; }
101
+
102
+ del {
103
+ color: #666; }
104
+
105
+ pre {
106
+ margin: 1.5em 0;
107
+ white-space: pre; }
108
+
109
+ pre, code, tt {
110
+ font: 1em 'andale mono', 'lucida console', monospace;
111
+ line-height: 1.5; }
112
+
113
+ li ul, li ol {
114
+ margin: 0 1.5em; }
115
+
116
+ ul {
117
+ margin: 0 1.5em 1.5em 1.5em;
118
+ list-style-type: disc; }
119
+
120
+ ol {
121
+ margin: 0 1.5em 1.5em 1.5em;
122
+ list-style-type: decimal; }
123
+
124
+ dl {
125
+ margin: 0 0 1.5em 0; }
126
+ dl dt {
127
+ font-weight: bold; }
128
+
129
+ dd {
130
+ margin-left: 1.5em; }
131
+
132
+ table {
133
+ margin-bottom: 1.4em;
134
+ width: 100%; }
135
+
136
+ th {
137
+ font-weight: bold; }
138
+
139
+ thead th {
140
+ background: #c3d9ff; }
141
+
142
+ th, td, caption {
143
+ padding: 4px 10px 4px 5px; }
144
+
145
+ tr.even td {
146
+ background: #e5ecf9; }
147
+
148
+ tfoot {
149
+ font-style: italic; }
150
+
151
+ caption {
152
+ background: #eee; }
153
+
154
+ .quiet {
155
+ color: #666666; }
156
+
157
+ .loud {
158
+ color: #111111; }