arnebrasseur-compass 0.3.5

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 (161) hide show
  1. data/Manifest +160 -0
  2. data/README.markdown +18 -0
  3. data/Rakefile +112 -0
  4. data/VERSION +1 -0
  5. data/bin/compass +8 -0
  6. data/compass.gemspec +37 -0
  7. data/examples/blueprint_default/index.html +73 -0
  8. data/examples/blueprint_default/parts/elements.html +246 -0
  9. data/examples/blueprint_default/parts/forms.html +100 -0
  10. data/examples/blueprint_default/parts/grid.html +206 -0
  11. data/examples/blueprint_default/parts/test-small.jpg +0 -0
  12. data/examples/blueprint_default/parts/test.jpg +0 -0
  13. data/examples/blueprint_default/parts/valid.png +0 -0
  14. data/examples/blueprint_default/stylesheets/ie.sass +3 -0
  15. data/examples/blueprint_default/stylesheets/images/grid.png +0 -0
  16. data/examples/blueprint_default/stylesheets/print.sass +3 -0
  17. data/examples/blueprint_default/stylesheets/screen.sass +8 -0
  18. data/examples/blueprint_plugins/index.html +60 -0
  19. data/examples/blueprint_plugins/parts/fancy_type.html +84 -0
  20. data/examples/blueprint_plugins/parts/test-small.jpg +0 -0
  21. data/examples/blueprint_plugins/parts/test.jpg +0 -0
  22. data/examples/blueprint_plugins/parts/valid.png +0 -0
  23. data/examples/blueprint_plugins/stylesheets/ie.sass +3 -0
  24. data/examples/blueprint_plugins/stylesheets/images/grid.png +0 -0
  25. data/examples/blueprint_plugins/stylesheets/print.sass +3 -0
  26. data/examples/blueprint_plugins/stylesheets/screen.sass +11 -0
  27. data/examples/blueprint_scoped/stylesheets/ie.sass +3 -0
  28. data/examples/blueprint_scoped/stylesheets/print.sass +3 -0
  29. data/examples/blueprint_scoped/stylesheets/screen.sass +4 -0
  30. data/examples/blueprint_scoped_form/stylesheets/ie.sass +3 -0
  31. data/examples/blueprint_scoped_form/stylesheets/print.sass +3 -0
  32. data/examples/blueprint_scoped_form/stylesheets/screen.sass +10 -0
  33. data/examples/blueprint_semantic/index.html +68 -0
  34. data/examples/blueprint_semantic/parts/fancy_type.html +84 -0
  35. data/examples/blueprint_semantic/parts/liquid.html +84 -0
  36. data/examples/blueprint_semantic/parts/test-small.jpg +0 -0
  37. data/examples/blueprint_semantic/parts/test.jpg +0 -0
  38. data/examples/blueprint_semantic/parts/valid.png +0 -0
  39. data/examples/blueprint_semantic/stylesheets/ie.sass +3 -0
  40. data/examples/blueprint_semantic/stylesheets/images/grid.png +0 -0
  41. data/examples/blueprint_semantic/stylesheets/liquid.sass +70 -0
  42. data/examples/blueprint_semantic/stylesheets/print.sass +3 -0
  43. data/examples/blueprint_semantic/stylesheets/screen.sass +69 -0
  44. data/examples/compass/compass.html +19 -0
  45. data/examples/compass/sticky_footer.html.haml +14 -0
  46. data/examples/compass/stylesheets/compass.sass +47 -0
  47. data/examples/compass/stylesheets/images/blue_arrow.gif +0 -0
  48. data/examples/compass/stylesheets/sticky_footer.sass +11 -0
  49. data/examples/compass/stylesheets/utilities.sass +65 -0
  50. data/examples/compass/utilities.html.haml +136 -0
  51. data/examples/yui/divisions.html.haml +179 -0
  52. data/examples/yui/index.html.haml +19 -0
  53. data/examples/yui/stylesheets/screen.sass +13 -0
  54. data/examples/yui/sub_divisions.html.haml +169 -0
  55. data/examples/yui/templates.html.haml +54 -0
  56. data/examples/yui/test.jpg +0 -0
  57. data/examples/yui/typography.html.haml +132 -0
  58. data/frameworks/blueprint/lib/blueprint/constants.rb +17 -0
  59. data/frameworks/blueprint/lib/blueprint/grid_builder.rb +54 -0
  60. data/frameworks/blueprint/stylesheets/_blueprint.sass +3 -0
  61. data/frameworks/blueprint/stylesheets/blueprint/_ie.sass +49 -0
  62. data/frameworks/blueprint/stylesheets/blueprint/_print.sass +82 -0
  63. data/frameworks/blueprint/stylesheets/blueprint/_screen.sass +15 -0
  64. data/frameworks/blueprint/stylesheets/blueprint/modules/_colors.sass +30 -0
  65. data/frameworks/blueprint/stylesheets/blueprint/modules/_debug.sass +9 -0
  66. data/frameworks/blueprint/stylesheets/blueprint/modules/_fancy_type.sass +81 -0
  67. data/frameworks/blueprint/stylesheets/blueprint/modules/_form.sass +43 -0
  68. data/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass +141 -0
  69. data/frameworks/blueprint/stylesheets/blueprint/modules/_interaction.sass +58 -0
  70. data/frameworks/blueprint/stylesheets/blueprint/modules/_liquid.sass +137 -0
  71. data/frameworks/blueprint/stylesheets/blueprint/modules/_scaffolding.sass +46 -0
  72. data/frameworks/blueprint/stylesheets/blueprint/modules/_typography.sass +153 -0
  73. data/frameworks/blueprint/stylesheets/blueprint/modules/_utilities.sass +37 -0
  74. data/frameworks/blueprint/templates/project/grid.png +0 -0
  75. data/frameworks/blueprint/templates/project/ie.sass +3 -0
  76. data/frameworks/blueprint/templates/project/print.sass +3 -0
  77. data/frameworks/blueprint/templates/project/screen.sass +8 -0
  78. data/frameworks/compass/stylesheets/_compass.sass +1 -0
  79. data/frameworks/compass/stylesheets/compass/_layout.sass +1 -0
  80. data/frameworks/compass/stylesheets/compass/_reset.sass +3 -0
  81. data/frameworks/compass/stylesheets/compass/_utilities.sass +5 -0
  82. data/frameworks/compass/stylesheets/compass/layout/_sticky_footer.sass +17 -0
  83. data/frameworks/compass/stylesheets/compass/utilities/_general.sass +4 -0
  84. data/frameworks/compass/stylesheets/compass/utilities/_links.sass +3 -0
  85. data/frameworks/compass/stylesheets/compass/utilities/_lists.sass +3 -0
  86. data/frameworks/compass/stylesheets/compass/utilities/_print.sass +24 -0
  87. data/frameworks/compass/stylesheets/compass/utilities/_tables.sass +1 -0
  88. data/frameworks/compass/stylesheets/compass/utilities/_text.sass +2 -0
  89. data/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.sass +11 -0
  90. data/frameworks/compass/stylesheets/compass/utilities/general/_inline_block.sass +6 -0
  91. data/frameworks/compass/stylesheets/compass/utilities/general/_reset.sass +58 -0
  92. data/frameworks/compass/stylesheets/compass/utilities/general/_tabs.sass +0 -0
  93. data/frameworks/compass/stylesheets/compass/utilities/general/_tag_cloud.sass +19 -0
  94. data/frameworks/compass/stylesheets/compass/utilities/links/_hover_link.sass +5 -0
  95. data/frameworks/compass/stylesheets/compass/utilities/links/_link_colors.sass +24 -0
  96. data/frameworks/compass/stylesheets/compass/utilities/links/_unstyled_link.sass +5 -0
  97. data/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.sass +21 -0
  98. data/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass +20 -0
  99. data/frameworks/compass/stylesheets/compass/utilities/lists/_inline_list.sass +29 -0
  100. data/frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass +25 -0
  101. data/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.sass +3 -0
  102. data/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass +10 -0
  103. data/frameworks/compass/templates/project/grid.png +0 -0
  104. data/frameworks/compass/templates/project/ie.sass +3 -0
  105. data/frameworks/compass/templates/project/print.sass +4 -0
  106. data/frameworks/compass/templates/project/screen.sass +4 -0
  107. data/frameworks/yui/COPYRIGHT +15 -0
  108. data/frameworks/yui/stylesheets/_yui.sass +7 -0
  109. data/frameworks/yui/stylesheets/yui/modules/_base.sass +60 -0
  110. data/frameworks/yui/stylesheets/yui/modules/_fonts.sass +38 -0
  111. data/frameworks/yui/stylesheets/yui/modules/_grids.sass +341 -0
  112. data/frameworks/yui/templates/project/screen.sass +4 -0
  113. data/lib/compass/commands/base.rb +94 -0
  114. data/lib/compass/commands/create_project.rb +32 -0
  115. data/lib/compass/commands/install_rails.rb +115 -0
  116. data/lib/compass/commands/print_version.rb +23 -0
  117. data/lib/compass/commands/update_project.rb +101 -0
  118. data/lib/compass/commands/watch_project.rb +42 -0
  119. data/lib/compass/core_ext.rb +39 -0
  120. data/lib/compass/exec.rb +164 -0
  121. data/lib/compass/frameworks/blueprint.rb +2 -0
  122. data/lib/compass/frameworks/compass.rb +2 -0
  123. data/lib/compass/frameworks/yui.rb +2 -0
  124. data/lib/compass/frameworks.rb +27 -0
  125. data/lib/compass/merb.rb +43 -0
  126. data/lib/compass/test_case.rb +37 -0
  127. data/lib/compass/validate/COPYRIGHT.html +93 -0
  128. data/lib/compass/validate/JIGSAW_COPYRIGHT +64 -0
  129. data/lib/compass/validate/README.html +83 -0
  130. data/lib/compass/validate/XERCES_COPYING.txt +56 -0
  131. data/lib/compass/validate/css-validator-javadoc.jar +0 -0
  132. data/lib/compass/validate/css-validator.jar +0 -0
  133. data/lib/compass/validate/jigsaw.jar +0 -0
  134. data/lib/compass/validate/xerces.jar +0 -0
  135. data/lib/compass/validate.rb +13 -0
  136. data/lib/compass/validator.rb +59 -0
  137. data/lib/compass/version.rb +48 -0
  138. data/lib/compass.rb +20 -0
  139. data/lib/sass_extensions.rb +13 -0
  140. data/test/compass_test.rb +152 -0
  141. data/test/fixtures/stylesheets/blueprint/css/typography.css +158 -0
  142. data/test/fixtures/stylesheets/blueprint/sass/ie.sass +3 -0
  143. data/test/fixtures/stylesheets/blueprint/sass/print.sass +3 -0
  144. data/test/fixtures/stylesheets/blueprint/sass/screen.sass +17 -0
  145. data/test/fixtures/stylesheets/blueprint/sass/typography.sass +3 -0
  146. data/test/fixtures/stylesheets/compass/css/layout.css +14 -0
  147. data/test/fixtures/stylesheets/compass/css/print.css +19 -0
  148. data/test/fixtures/stylesheets/compass/css/reset.css +69 -0
  149. data/test/fixtures/stylesheets/compass/css/utilities.css +21 -0
  150. data/test/fixtures/stylesheets/compass/sass/layout.sass +3 -0
  151. data/test/fixtures/stylesheets/compass/sass/print.sass +5 -0
  152. data/test/fixtures/stylesheets/compass/sass/reset.sass +1 -0
  153. data/test/fixtures/stylesheets/compass/sass/utilities.sass +5 -0
  154. data/test/fixtures/stylesheets/yui/css/mixins.css +16 -0
  155. data/test/fixtures/stylesheets/yui/sass/base.sass +3 -0
  156. data/test/fixtures/stylesheets/yui/sass/fonts.sass +3 -0
  157. data/test/fixtures/stylesheets/yui/sass/grids.sass +3 -0
  158. data/test/fixtures/stylesheets/yui/sass/mixins.sass +16 -0
  159. data/test/sass_extensions_test.rb +26 -0
  160. data/test/test_helper.rb +37 -0
  161. metadata +264 -0
@@ -0,0 +1,83 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>CSS Validator Binary Distribution - Illumit</title>
5
+ <link title="RSS Feed" type="application/rss+xml" rel="alternate" href="http://www.illumit.com/site.rss" />
6
+ </head>
7
+ <body>
8
+ <h1>CSS Validator Binary Distribution</h1>
9
+ <p>This a binary distribution of <a href="http://jigsaw.w3.org/css-validator">W3C CSS Validator</a>.
10
+ It was built from the <a href="http://dev.w3.org/cvsweb/2002/css-validator">source</a> on June 25, 2006.
11
+ No modifications were made.</p>
12
+
13
+ <p>This distribution is provided <a href="#asis">as is</a> to make testing a large number of CSS files easier.</p>
14
+
15
+
16
+ <h2>Requirements</h2>
17
+ <p>A Java 2 Virtual Machine is required to use the validator.
18
+ You can download one from <a href="http://java.sun.com/">Sun</a> if you do not have one installed.</p>
19
+
20
+ <h2>Usage</h2>
21
+ <h2>Summary</h2>
22
+ <p><code>java -jar <samp>~/css-validator/</samp>css-validator.jar [-options] files URLs</code></p>
23
+ <h2>Sample</h2>
24
+ <pre>
25
+ java -jar ~/css-validator/css-validator.jar f1.css http://illumit.com/
26
+ </pre>
27
+ <h2>Options</h2>
28
+ <dl>
29
+ <dt>-e</dt><dd>Show errors only.</dd>
30
+ <dt>-html</dt><dd>Output HTML.</dd>
31
+ <dt>-css1 | -css2 | -css21 | -css3 | -svg | -svgbasic | -svgtiny</dt>
32
+ <dd>Specify CSS version. CSS2 is the default.</dd>
33
+ </dl>
34
+
35
+ <h2>Support</h2>
36
+
37
+ <p>If you have questions about how this distribution is built or packaged,
38
+ <a href="mailto:contact@illumit.com">mailto:contact@illumit.com</a>.</p>
39
+
40
+ <p>Use the CSS Validator <a href="http://jigsaw.w3.org/css-validator/Email">Feedback</a>
41
+ page if you have any questions or problems with the validator itself.</p>
42
+
43
+ <p class="Footnote">Updates are announced on via
44
+ <a class="RSSLink" rel="alternate" type="application/rss+xml" href="http://www.illumit.com/site.rss">RSS</a></p>
45
+
46
+ <!--
47
+ <h2>Contents</h2>
48
+ <ul>
49
+ <li><a href="css-validator.jar">css-validator.jar</a> Executable JAR package</li>
50
+ <li><a href="COPYRIGHT.html">COPYRIGHT.html</a> CSS Validator Copyright Notice</li>
51
+ <li><a href="css-validator-javadoc.jar">css-validator-javadoc.jar</a> CSS Validator API Docs</li>
52
+ <li>Required libraries:<ul>
53
+ <li><a href="jigsaw.jar">jigsaw.jar</a> and <a href="JIGSAW_COPYRIGHT">JIGSAW_COPYRIGHT</a></li>
54
+ <li><a href="xerces.jar">xerces.jar</a> and <a href="XERCES_COPYING.txt">XERCES_COPYING.txt</a></li>
55
+ </ul>
56
+ </li>
57
+ </ul>
58
+ -->
59
+
60
+ <h2>Download</h2>
61
+
62
+ <p>Download the css validator binary distribution <a href="css-validator.zip">css-validator.zip</a>. Extract the files (OS X and *ix users can use unzip).</p>
63
+
64
+
65
+ <h2><a name="asis">License Agreement</a></h2>
66
+
67
+ <p>This is a binary distribution of <a href="http://jigsaw.w3.org/css-validator">W3C CSS Validator</a> Version 2.0
68
+ It was built from the <a href="http://dev.w3.org/cvsweb/2002/css-validator">source</a> on June 25, 2006.
69
+ No modifications were made to the source.</p>
70
+
71
+ <p>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND
72
+ ILLUMIT L.L.C AND THE COPYRIGHT HOLDERS (W3C) MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
73
+ IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF
74
+ MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
75
+ USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD
76
+ PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</p>
77
+
78
+ <p>ILLUMIT L.L.C AND THE COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT,
79
+ SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE
80
+ SOFTWARE OR DOCUMENTATION.</p>
81
+
82
+ </body>
83
+ </html>
@@ -0,0 +1,56 @@
1
+ /*
2
+ * The Apache Software License, Version 1.1
3
+ *
4
+ *
5
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
6
+ * reserved.
7
+ *
8
+ * Redistribution and use in source and binary forms, with or without
9
+ * modification, are permitted provided that the following conditions
10
+ * are met:
11
+ *
12
+ * 1. Redistributions of source code must retain the above copyright
13
+ * notice, this list of conditions and the following disclaimer.
14
+ *
15
+ * 2. Redistributions in binary form must reproduce the above copyright
16
+ * notice, this list of conditions and the following disclaimer in
17
+ * the documentation and/or other materials provided with the
18
+ * distribution.
19
+ *
20
+ * 3. The end-user documentation included with the redistribution,
21
+ * if any, must include the following acknowledgment:
22
+ * "This product includes software developed by the
23
+ * Apache Software Foundation (http://www.apache.org/)."
24
+ * Alternately, this acknowledgment may appear in the software itself,
25
+ * if and wherever such third-party acknowledgments normally appear.
26
+ *
27
+ * 4. The names "Xerces" and "Apache Software Foundation" must
28
+ * not be used to endorse or promote products derived from this
29
+ * software without prior written permission. For written
30
+ * permission, please contact apache@apache.org.
31
+ *
32
+ * 5. Products derived from this software may not be called "Apache",
33
+ * nor may "Apache" appear in their name, without prior written
34
+ * permission of the Apache Software Foundation.
35
+ *
36
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47
+ * SUCH DAMAGE.
48
+ * ====================================================================
49
+ *
50
+ * This software consists of voluntary contributions made by many
51
+ * individuals on behalf of the Apache Software Foundation and was
52
+ * originally based on software copyright (c) 1999, International
53
+ * Business Machines, Inc., http://www.ibm.com. For more
54
+ * information on the Apache Software Foundation, please see
55
+ * <http://www.apache.org/>.
56
+ */
Binary file
Binary file
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ require File.join(File.dirname(__FILE__), 'compass', 'validator')
3
+
4
+ # This script will validate the core Compass files.
5
+ #
6
+ # The files are not completely valid. This has to do
7
+ # with a small number of CSS hacks needed to ensure
8
+ # consistent rendering across browsers.
9
+ #
10
+ # To add your own CSS files for validation, see
11
+ # /lib/compass/validator.rb
12
+
13
+ Compass::Validator.new.validate
@@ -0,0 +1,59 @@
1
+ require File.join(File.dirname(__FILE__), 'core_ext')
2
+ require File.join(File.dirname(__FILE__), 'constants')
3
+
4
+ module Compass
5
+ # Validates generated CSS against the W3 using Java
6
+ class Validator
7
+ VALIDATOR_FILE = File.join(File.dirname(__FILE__), 'validate', 'css-validator.jar')
8
+ attr_reader :error_count
9
+
10
+ def initialize
11
+ @error_count = 0
12
+ end
13
+
14
+ # Validates all three CSS files
15
+ def validate
16
+ java_path = `which java`.rstrip
17
+ raise "You do not have a Java installed, but it is required." if java_path.blank?
18
+
19
+ output_header
20
+
21
+ Dir.new(Compass::Constants::BLUEPRINT_ROOT_PATH).each do |file_name|
22
+ puts "#{file_name}"
23
+ if file_name =~ /\.css$/
24
+ css_file = File.join(Compass::Constants::BLUEPRINT_ROOT_PATH, file_name)
25
+ @error_count += 1 if !validate_css_file(java_path, css_file)
26
+ end
27
+ end
28
+
29
+ output_footer
30
+ end
31
+
32
+ private
33
+ def validate_css_file(java_path, css_file)
34
+ puts "\n\n Testing #{css_file}"
35
+ puts " Output ============================================================\n\n"
36
+ system("#{java_path} -jar '#{VALIDATOR_FILE}' -e '#{css_file}'")
37
+ end
38
+
39
+ def output_header
40
+ puts "\n\n"
41
+ puts " ************************************************************"
42
+ puts " **"
43
+ puts " ** Compass CSS Validator"
44
+ puts " ** Validates output CSS files"
45
+ puts " **"
46
+ puts " ************************************************************"
47
+ end
48
+
49
+ def output_footer
50
+ puts "\n\n"
51
+ puts " ************************************************************"
52
+ puts " **"
53
+ puts " ** Done!"
54
+ puts " ** Your CSS files are#{" not" if error_count > 0} valid.#{" You had #{error_count} error(s) within your files" if error_count > 0}"
55
+ puts " **"
56
+ puts " ************************************************************"
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,48 @@
1
+ module Compass
2
+ module Version
3
+ # Returns a hash representing the version.
4
+ # The :major, :minor, and :teeny keys have their respective numbers.
5
+ # The :string key contains a human-readable string representation of the version.
6
+ # If checked out from Git,
7
+ # the :rev key will have the revision hash.
8
+ #
9
+ # This method swiped from Haml and then modified, some credit goes to Nathan Weizenbaum
10
+ attr_writer :version
11
+ def version
12
+ return @version if defined?(@version)
13
+
14
+ @version = {
15
+ :string => File.read(scope('VERSION')).strip
16
+ }
17
+ dotted_string, label = @version[:string].split(/-/, 2)
18
+ numbers = dotted_string.split('.').map { |n| n.to_i }
19
+ @version[:major] = numbers[0]
20
+ @version[:minor] = numbers[1]
21
+ @version[:teeny] = numbers[2]
22
+ @version[:label] = label
23
+
24
+ if File.exists?(scope('REVISION'))
25
+ rev = File.read(scope('REVISION')).strip
26
+ rev = nil if rev !~ /[a-f0-9]+/
27
+ end
28
+
29
+ if rev.nil? && File.exists?(scope('.git/HEAD'))
30
+ rev = File.read(scope('.git/HEAD')).strip
31
+ if rev =~ /^ref: (.*)$/
32
+ rev = File.read(scope(".git/#{$1}")).strip
33
+ end
34
+ end
35
+
36
+ if rev
37
+ @version[:rev] = rev
38
+ @version[:string] << " [#{rev[0...7]}]"
39
+ end
40
+
41
+ @version
42
+ end
43
+
44
+ def scope(file) # :nodoc:
45
+ File.join(File.dirname(__FILE__), '..', '..', file)
46
+ end
47
+ end
48
+ end
data/lib/compass.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'rubygems'
2
+ require 'sass'
3
+ require File.join(File.dirname(__FILE__), 'sass_extensions')
4
+
5
+ ['core_ext', 'version'].each do |file|
6
+ require File.join(File.dirname(__FILE__), 'compass', file)
7
+ end
8
+
9
+ module Compass
10
+ extend Compass::Version
11
+ def base_directory
12
+ File.expand_path(File.join(File.dirname(__FILE__), '..'))
13
+ end
14
+ module_function :base_directory
15
+ end
16
+
17
+ require File.join(File.dirname(__FILE__), 'compass', 'frameworks')
18
+ # make sure we're running inside Merb
19
+ require File.join(File.dirname(__FILE__), 'compass', 'merb') if defined?(Merb::Plugins)
20
+
@@ -0,0 +1,13 @@
1
+ require 'sass'
2
+
3
+ module Sass::Script::Functions
4
+ COMMA_SEPARATOR = /\s*,\s*/
5
+ def nest(*arguments)
6
+ nested = arguments.map{|a| a.value}.inject do |memo,arg|
7
+ ancestors = memo.split(COMMA_SEPARATOR)
8
+ descendants = arg.split(COMMA_SEPARATOR)
9
+ ancestors.map{|a| descendants.map{|d| "#{a} #{d}"}.join(", ")}.join(", ")
10
+ end
11
+ Sass::Script::String.new(nested)
12
+ end
13
+ end
@@ -0,0 +1,152 @@
1
+ require File.dirname(__FILE__)+'/test_helper'
2
+ require 'fileutils'
3
+ require 'compass'
4
+
5
+ class CompassTest < Test::Unit::TestCase
6
+ def setup
7
+ setup_fixtures :blueprint, :yui, :empty
8
+ @original_options = Sass::Plugin.options
9
+ end
10
+
11
+ def setup_fixtures(*folders)
12
+ folders.each do |folder|
13
+ FileUtils.mkdir_p stylesheet_fixtures(folder)
14
+ mkdir_clean tempfile_loc(folder)
15
+ end
16
+ end
17
+
18
+ def teardown
19
+ teardown_fixtures :blueprint, :yui, :empty
20
+ Sass::Plugin.options = @original_options
21
+ end
22
+
23
+ def teardown_fixtures(*folders)
24
+ folders.each do |folder|
25
+ FileUtils.rm_rf tempfile_loc(folder)
26
+ end
27
+ end
28
+
29
+ def test_blueprint_generates_no_files
30
+ with_templates(:empty) do
31
+ Dir.new(tempfile_loc(:empty)).each do |f|
32
+ fail "This file should not have been generated: #{f}" unless f == "." || f == ".."
33
+ end
34
+ end
35
+ end
36
+
37
+ def test_blueprint
38
+ with_templates(:blueprint) do
39
+ each_css_file(tempfile_loc(:blueprint)) do |css_file|
40
+ assert_no_errors css_file, :blueprint
41
+ end
42
+ assert_renders_correctly :typography
43
+ end
44
+ end
45
+ def test_yui
46
+ with_templates('yui') do
47
+ each_css_file(tempfile_loc('yui')) do |css_file|
48
+ assert_no_errors css_file, 'yui'
49
+ end
50
+ assert_renders_correctly :mixins
51
+ end
52
+ end
53
+ def test_compass
54
+ with_templates('compass') do
55
+ each_css_file(tempfile_loc('compass')) do |css_file|
56
+ assert_no_errors css_file, 'compass'
57
+ end
58
+ assert_renders_correctly :reset, :layout, :utilities
59
+ end
60
+ end
61
+ private
62
+ def assert_no_errors(css_file, folder)
63
+ file = css_file[(tempfile_loc(folder).size+1)..-1]
64
+ msg = "Syntax Error found in #{file}. Results saved into #{save_loc(folder)}/#{file}"
65
+ assert_equal 0, open(css_file).readlines.grep(/Sass::SyntaxError/).size, msg
66
+ end
67
+ def assert_renders_correctly(*arguments)
68
+ options = arguments.last.is_a?(Hash) ? arguments.pop : {}
69
+ for name in arguments
70
+ actual_result_file = "#{tempfile_loc(@current_template_folder)}/#{name}.css"
71
+ expected_result_file = "#{result_loc(@current_template_folder)}/#{name}.css"
72
+ actual_lines = File.read(actual_result_file).split("\n")
73
+ expected_lines = File.read(expected_result_file).split("\n")
74
+ expected_lines.zip(actual_lines).each_with_index do |pair, line|
75
+ message = "template: #{name}\nline: #{line + 1}"
76
+ assert_equal(pair.first, pair.last, message)
77
+ end
78
+ if expected_lines.size < actual_lines.size
79
+ assert(false, "#{actual_lines.size - expected_lines.size} Trailing lines found in #{actual_result_file}.css: #{actual_lines[expected_lines.size..-1].join('\n')}")
80
+ end
81
+ end
82
+ end
83
+ def with_templates(folder)
84
+ old_template_loc = Sass::Plugin.options[:template_location]
85
+ Sass::Plugin.options[:template_location] = old_template_loc.dup
86
+ @current_template_folder = folder
87
+ begin
88
+ Sass::Plugin.options[:template_location][template_loc(folder)] = tempfile_loc(folder)
89
+ Compass::Frameworks::ALL.each do |framework|
90
+ Sass::Plugin.options[:template_location][framework.stylesheets_directory] = tempfile_loc(folder)
91
+ end
92
+ Sass::Plugin.update_stylesheets
93
+ yield
94
+ ensure
95
+ @current_template_folder = nil
96
+ Sass::Plugin.options[:template_location] = old_template_loc
97
+ end
98
+ rescue
99
+ save_output(folder)
100
+ raise
101
+ end
102
+
103
+ def each_css_file(dir)
104
+ Dir.glob("#{dir}/**/*.css").each do |css_file|
105
+ yield css_file
106
+ end
107
+ end
108
+
109
+ def save_output(dir)
110
+ FileUtils.rm_rf(save_loc(dir))
111
+ FileUtils.cp_r(tempfile_loc(dir), save_loc(dir))
112
+ end
113
+
114
+ def mkdir_clean(dir)
115
+ begin
116
+ FileUtils.mkdir dir
117
+ rescue Errno::EEXIST
118
+ FileUtils.rm_r dir
119
+ FileUtils.mkdir dir
120
+ end
121
+ end
122
+
123
+ def stylesheet_fixtures(folder)
124
+ absolutize("fixtures/stylesheets/#{folder}")
125
+ end
126
+
127
+ def tempfile_loc(folder)
128
+ "#{stylesheet_fixtures(folder)}/tmp"
129
+ end
130
+
131
+ def template_loc(folder)
132
+ "#{stylesheet_fixtures(folder)}/sass"
133
+ end
134
+
135
+ def result_loc(folder)
136
+ "#{stylesheet_fixtures(folder)}/css"
137
+ end
138
+
139
+ def save_loc(folder)
140
+ "#{stylesheet_fixtures(folder)}/saved"
141
+ end
142
+
143
+ def absolutize(path)
144
+ if path.blank?
145
+ File.dirname(__FILE__)
146
+ elsif path[0] == ?/
147
+ "#{File.dirname(__FILE__)}#{path}"
148
+ else
149
+ "#{File.dirname(__FILE__)}/#{path}"
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,158 @@
1
+
2
+
3
+ body {
4
+ font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
5
+ color: #333333;
6
+ font-size: 75%; }
7
+
8
+ h1 {
9
+ font-weight: normal;
10
+ color: #222222;
11
+ font-size: 3em;
12
+ line-height: 1;
13
+ margin-bottom: 0.5em; }
14
+ h1 img {
15
+ margin: 0; }
16
+
17
+ h2 {
18
+ font-weight: normal;
19
+ color: #222222;
20
+ font-size: 2em;
21
+ margin-bottom: 0.75em; }
22
+
23
+ h3 {
24
+ font-weight: normal;
25
+ color: #222222;
26
+ font-size: 1.5em;
27
+ line-height: 1;
28
+ margin-bottom: 1em; }
29
+
30
+ h4 {
31
+ font-weight: normal;
32
+ color: #222222;
33
+ font-size: 1.2em;
34
+ line-height: 1.25;
35
+ margin-bottom: 1.25em;
36
+ height: 1.25em; }
37
+
38
+ h5 {
39
+ font-weight: normal;
40
+ color: #222222;
41
+ font-size: 1em;
42
+ font-weight: bold;
43
+ margin-bottom: 1.5em; }
44
+
45
+ h6 {
46
+ font-weight: normal;
47
+ color: #222222;
48
+ font-size: 1em;
49
+ font-weight: bold; }
50
+
51
+ h2 img, h3 img, h4 img, h5 img, h6 img {
52
+ margin: 0; }
53
+
54
+ p {
55
+ margin: 0 0 1.5em; }
56
+ p img {
57
+ float: left;
58
+ margin: 1.5em 1.5em 1.5em 0;
59
+ padding: 0; }
60
+ p img.right {
61
+ float: right;
62
+ margin: 1.5em 0 1.5em 1.5em; }
63
+
64
+ a {
65
+ text-decoration: underline;
66
+ color: #000099; }
67
+ a:visited {
68
+ color: #000066; }
69
+ a:focus {
70
+ color: black; }
71
+ a:hover {
72
+ color: black; }
73
+ a:active {
74
+ color: #cc0099; }
75
+
76
+ blockquote {
77
+ margin: 1.5em;
78
+ color: #666;
79
+ font-style: italic; }
80
+
81
+ strong {
82
+ font-weight: bold; }
83
+
84
+ em {
85
+ font-style: italic; }
86
+
87
+ dfn {
88
+ font-style: italic;
89
+ font-weight: bold; }
90
+
91
+ sup, sub {
92
+ line-height: 0; }
93
+
94
+ abbr, acronym {
95
+ border-bottom: 1px dotted #666; }
96
+
97
+ address {
98
+ margin: 0 0 1.5em;
99
+ font-style: italic; }
100
+
101
+ del {
102
+ color: #666; }
103
+
104
+ pre, code {
105
+ margin: 1.5em 0;
106
+ white-space: pre;
107
+ font: 1em 'andale mono', 'lucida console', monospace;
108
+ line-height: 1.5; }
109
+
110
+ tt {
111
+ font: 1em 'andale mono', 'lucida console', monospace;
112
+ line-height: 1.5; }
113
+
114
+ li ul, li ol {
115
+ margin: 0 1.5em; }
116
+
117
+ ul {
118
+ margin: 0 1.5em 1.5em 1.5em;
119
+ list-style-type: disc; }
120
+
121
+ ol {
122
+ margin: 0 1.5em 1.5em 1.5em;
123
+ list-style-type: decimal; }
124
+
125
+ dl {
126
+ margin: 0 0 1.5em 0; }
127
+ dl dt {
128
+ font-weight: bold; }
129
+
130
+ dd {
131
+ margin-left: 1.5em; }
132
+
133
+ table {
134
+ margin-bottom: 1.4em;
135
+ width: 100%; }
136
+
137
+ th {
138
+ font-weight: bold;
139
+ background: #C3D9FF;
140
+ padding: 4px 10px 4px 5px; }
141
+
142
+ td {
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; }
@@ -0,0 +1,3 @@
1
+ @import blueprint/ie
2
+
3
+ +blueprint-ie
@@ -0,0 +1,3 @@
1
+ @import blueprint/print
2
+
3
+ +blueprint-print
@@ -0,0 +1,17 @@
1
+ @import blueprint/screen
2
+ @import compass/reset
3
+
4
+ +blueprint
5
+ #main.container
6
+ #top
7
+ +column(24, true)
8
+ #middle
9
+ +column(24, true)
10
+ #left
11
+ +column(6)
12
+ #content
13
+ +column(12)
14
+ #right
15
+ +column(6, true)
16
+ #bottom
17
+ +column(24, true)
@@ -0,0 +1,3 @@
1
+ @import blueprint/modules/typography.sass
2
+
3
+ +blueprint-typography
@@ -0,0 +1,14 @@
1
+
2
+ html, body {
3
+ height: 100%; }
4
+
5
+ #layout {
6
+ min-height: 100%;
7
+ margin-bottom: -72px; }
8
+ #layout #layout_footer {
9
+ height: 72px; }
10
+
11
+ #footer {
12
+ clear: both;
13
+ position: relative;
14
+ height: 72px; }
@@ -0,0 +1,19 @@
1
+
2
+ .noprint,
3
+ .no-print {
4
+ display: none; }
5
+
6
+ address.print-only, blockquote.print-only, center.print-only, dir.print-only, div.print-only, dd.print-only, dl.print-only, dt.print-only,
7
+ fieldset.print-only, form.print-only, frameset.print-only, h1.print-only, h2.print-only, h3.print-only, h4.print-only, h5.print-only, h6.print-only, hr.print-only,
8
+ isindex.print-only, li.print-only, menu.print-only, noframes.print-only, noscript.print-only, ol.print-only, p.print-only, pre.print-only,
9
+ table.print-only, tbody.print-only, td.print-only, tfoot.print-only, th.print-only, thead.print-only, tr.print-only, ul.print-only {
10
+ display: block; }
11
+
12
+ a.print-only, abbr.print-only, acronym.print-only, b.print-only, basefont.print-only, bdo.print-only, big.print-only, br.print-only, cite.print-only,
13
+ code.print-only, dfn.print-only, em.print-only, font.print-only, i.print-only, img.print-only, input.print-only, kbd.print-only, label.print-only, q.print-only, s.print-only,
14
+ samp.print-only, select.print-only, small.print-only, span.print-only, strike.print-only, strong.print-only, sub.print-only, sup.print-only,
15
+ textarea.print-only, tt.print-only, u.print-only, var.print-only {
16
+ display: inline; }
17
+
18
+ .print-only {
19
+ display: none; }