You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/07/09 01:14:21 UTC

svn commit: r961978 [13/13] - in /incubator/deltacloud/trunk/framework: ./ app/ app/controllers/ app/helpers/ app/models/ app/views/ app/views/accounts/ app/views/credentials/ app/views/images/ app/views/instances/ app/views/layouts/ app/views/root/ co...

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/script_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/script_test.rb?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/script_test.rb (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/script_test.rb Thu Jul  8 23:14:13 2010
@@ -0,0 +1,261 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../test_helper'
+require 'sass/engine'
+
+class SassScriptTest < Test::Unit::TestCase
+  include Sass::Script
+
+  def test_color_checks_input
+    assert_raise(Sass::SyntaxError, "Color values must be between 0 and 255") {Color.new([1, 2, -1])}
+    assert_raise(Sass::SyntaxError, "Color values must be between 0 and 255") {Color.new([256, 2, 3])}
+  end
+
+  def test_string_escapes
+    assert_equal '"', resolve("\"\\\"\"")
+    assert_equal "\\", resolve("\"\\\\\"")
+    assert_equal "\\02fa", resolve("\"\\02fa\"")
+  end
+
+  def test_color_names
+    assert_equal "white", resolve("white")
+    assert_equal "white", resolve("#ffffff")
+    assert_equal "#fffffe", resolve("white - #000001")
+  end
+
+  def test_implicit_strings
+    silence_warnings do
+      assert_equal Sass::Script::String.new("foo"), eval("foo")
+      assert_equal Sass::Script::String.new("foo bar"), eval("foo bar")
+      assert_equal Sass::Script::String.new("foo/bar"), eval("foo/bar")
+    end
+  end
+
+  def test_interpolation
+    assert_equal "foo bar, baz bang", resolve('"foo #{"bar"}, #{"baz"} bang"')
+    assert_equal "foo bar baz bang", resolve('"foo #{"#{"ba" + "r"} baz"} bang"')
+    assert_equal 'foo #{bar baz} bang', resolve('"foo \#{#{"ba" + "r"} baz} bang"')
+    assert_equal 'foo #{baz bang', resolve('"foo #{"\#{" + "baz"} bang"')
+  end
+
+  def test_rule_interpolation
+    assert_equal(<<CSS, render(<<SASS))
+foo bar baz bang {
+  a: b; }
+CSS
+foo \#{"\#{"ba" + "r"} baz"} bang
+  a: b
+SASS
+    assert_equal(<<CSS, render(<<SASS))
+foo \#{bar baz} bang {
+  a: b; }
+CSS
+foo \\\#{\#{"ba" + "r"} baz} bang
+  a: b
+SASS
+    assert_equal(<<CSS, render(<<SASS))
+foo \#{baz bang {
+  a: b; }
+CSS
+foo \#{"\\\#{" + "baz"} bang
+  a: b
+SASS
+  end
+
+  def test_implicit_string_warning
+    assert_warning(<<WARN) {eval("foo")}
+DEPRECATION WARNING:
+On line 1, character 1 of 'test_implicit_string_warning_inline.sass'
+Implicit strings have been deprecated and will be removed in version 2.4.
+'foo' was not quoted. Please add double quotes (e.g. "foo").
+WARN
+    assert_warning(<<WARN) {eval("1 + foo")}
+DEPRECATION WARNING:
+On line 1, character 5 of 'test_implicit_string_warning_inline.sass'
+Implicit strings have been deprecated and will be removed in version 2.4.
+'foo' was not quoted. Please add double quotes (e.g. "foo").
+WARN
+    assert_warning(<<WARN) {render("@if 1 + foo")}
+DEPRECATION WARNING:
+On line 1, character 9 of 'test_implicit_string_warning_inline.sass'
+Implicit strings have been deprecated and will be removed in version 2.4.
+'foo' was not quoted. Please add double quotes (e.g. "foo").
+WARN
+
+    # Regression
+    assert_warning(<<WARN) {render("@if if")}
+DEPRECATION WARNING:
+On line 1, character 5 of 'test_implicit_string_warning_inline.sass'
+Implicit strings have been deprecated and will be removed in version 2.4.
+'if' was not quoted. Please add double quotes (e.g. "if").
+WARN
+  end
+
+  def test_inaccessible_functions
+    assert_warning <<WARN do
+DEPRECATION WARNING:
+On line 2, character 6 of 'test_inaccessible_functions_inline.sass'
+Implicit strings have been deprecated and will be removed in version 2.4.
+'to_s' was not quoted. Please add double quotes (e.g. "to_s").
+WARN
+      assert_equal "send(to_s)", resolve("send(to_s)", :line => 2)
+    end
+    assert_equal "public_instance_methods()", resolve("public_instance_methods()")
+  end
+
+  def test_hyphen_warning
+    a = Sass::Script::String.new("a")
+    b = Sass::Script::String.new("b")
+    assert_warning(<<WARN) {eval("!a-!b", {}, env("a" => a, "b" => b))}
+DEPRECATION WARNING:
+On line 1, character 3 of 'test_hyphen_warning_inline.sass'
+- will be allowed as part of variable names in version 2.4.
+Please add whitespace to separate it from the previous token.
+WARN
+
+    assert_warning(<<WARN) {eval("true-false")}
+DEPRECATION WARNING:
+On line 1, character 5 of 'test_hyphen_warning_inline.sass'
+- will be allowed as part of variable names in version 2.4.
+Please add whitespace to separate it from the previous token.
+WARN
+  end
+
+  def test_ruby_equality
+    assert_equal eval('"foo"'), eval('"foo"')
+    assert_equal eval('1'), eval('1.0')
+    assert_not_equal eval('1'), eval('"1"')
+  end
+
+  def test_booleans
+    assert_equal "true", resolve("true")
+    assert_equal "false", resolve("false")
+  end
+
+  def test_boolean_ops
+    assert_equal "true", resolve("true and true")
+    assert_equal "true", resolve("false or true")
+    assert_equal "true", resolve("true or false")
+    assert_equal "true", resolve("true or true")
+    assert_equal "false", resolve("false or false")
+    assert_equal "false", resolve("false and true")
+    assert_equal "false", resolve("true and false")
+    assert_equal "false", resolve("false and false")
+
+    assert_equal "true", resolve("not false")
+    assert_equal "false", resolve("not true")
+    assert_equal "true", resolve("not not true")
+
+    assert_equal "1", resolve("false or 1")
+    assert_equal "false", resolve("false and 1")
+    assert_equal "2", resolve("2 or 3")
+    assert_equal "3", resolve("2 and 3")
+  end
+
+  def test_arithmetic_ops
+    assert_equal "2", resolve("1 + 1")
+    assert_equal "0", resolve("1 - 1")
+    assert_equal "8", resolve("2 * 4")
+    assert_equal "0.5", resolve("2 / 4")
+    assert_equal "2", resolve("4 / 2")
+
+    assert_equal "-1", resolve("-1")
+  end
+
+  def test_string_ops
+    assert_equal "foo bar", resolve('"foo" "bar"')
+    assert_equal "true 1", resolve('true 1')
+    assert_equal "foo, bar", resolve('"foo" , "bar"')
+    assert_equal "true, 1", resolve('true , 1')
+    assert_equal "foobar", resolve('"foo" + "bar"')
+    assert_equal "true1", resolve('true + 1')
+    assert_equal "foo-bar", resolve('"foo" - "bar"')
+    assert_equal "true-1", resolve('true - 1')
+    assert_equal "foo/bar", resolve('"foo" / "bar"')
+    assert_equal "true/1", resolve('true / 1')
+
+    assert_equal "-bar", resolve('- "bar"')
+    assert_equal "-true", resolve('- true')
+    assert_equal "/bar", resolve('/ "bar"')
+    assert_equal "/true", resolve('/ true')
+  end
+
+  def test_relational_ops
+    assert_equal "false", resolve("1 > 2")
+    assert_equal "false", resolve("2 > 2")
+    assert_equal "true", resolve("3 > 2")
+    assert_equal "false", resolve("1 >= 2")
+    assert_equal "true", resolve("2 >= 2")
+    assert_equal "true", resolve("3 >= 2")
+    assert_equal "true", resolve("1 < 2")
+    assert_equal "false", resolve("2 < 2")
+    assert_equal "false", resolve("3 < 2")
+    assert_equal "true", resolve("1 <= 2")
+    assert_equal "true", resolve("2 <= 2")
+    assert_equal "false", resolve("3 <= 2")
+  end
+
+  def test_equals
+    assert_equal("true", resolve('"foo" == !foo', {},
+        env("foo" => Sass::Script::String.new("foo"))))
+    assert_equal "true", resolve("1 == 1.0")
+    assert_equal "true", resolve("false != true")
+    assert_equal "false", resolve("1em == 1px")
+    assert_equal "false", resolve("12 != 12")
+  end
+
+  def test_operation_precedence
+    assert_equal "false true", resolve("true and false false or true")
+    assert_equal "true", resolve("false and true or true and true")
+    assert_equal "true", resolve("1 == 2 or 3 == 3")
+    assert_equal "true", resolve("1 < 2 == 3 >= 3")
+    assert_equal "true", resolve("1 + 3 > 4 - 2")
+    assert_equal "11", resolve("1 + 2 * 3 + 4")
+  end
+
+  def test_functions
+    assert_equal "#80ff80", resolve("hsl(120, 100%, 75%)")
+    assert_equal "#81ff81", resolve("hsl(120, 100%, 75%) + #010001")
+  end
+
+  def test_operator_unit_conversion
+    assert_equal "1.1cm", resolve("1cm + 1mm")
+    assert_equal "true", resolve("2mm < 1cm")
+    assert_equal "true", resolve("10mm == 1cm")
+    assert_equal "true", resolve("1 == 1cm")
+    assert_equal "true", resolve("1.1cm == 11mm")
+  end
+
+  private
+
+  def resolve(str, opts = {}, environment = env)
+    munge_filename opts
+    eval(str, opts, environment).to_s
+  end
+
+  def eval(str, opts = {}, environment = env)
+    munge_filename opts
+    Sass::Script.parse(str, opts[:line] || 1,
+      opts[:offset] || 0, opts[:filename]).perform(environment)
+  end
+
+  def render(sass, options = {})
+    munge_filename options
+    Sass::Engine.new(sass, options).render
+  end
+
+  def env(hash = {})
+    env = Sass::Environment.new
+    hash.each {|k, v| env.set_var(k, v)}
+    env
+  end
+
+  def test_number_printing
+    assert_equal "1", eval("1")
+    assert_equal "1", eval("1.0")
+    assert_equal "1.121", eval("1.1214")
+    assert_equal "1.122", eval("1.1215")
+    assert_equal "Infinity", eval("1.0/0.0")
+    assert_equal "-Infinity", eval("-1.0/0.0")
+    assert_equal "NaN", eval("0.0/0.0")
+  end
+end

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/_partial.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/_partial.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/_partial.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/_partial.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,2 @@
+#foo
+  :background-color #baf

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/alt.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/alt.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/alt.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/alt.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,16 @@
+h1
+  :float  left
+  :width  274px
+  height: 75px
+  margin: 0
+  background:
+    repeat: no-repeat
+    :image none
+  a:hover, a:visited
+    color: green
+  b:hover
+    color: red
+    :background-color green
+  const
+    nosp= 1 + 2
+    sp = 1 + 2

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/basic.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/basic.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/basic.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/basic.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,23 @@
+
+
+body  
+  :font Arial
+  :background blue
+
+#page
+  :width 700px
+  :height 100
+  #header
+    :height 300px
+    h1
+      :font-size 50px
+      :color     blue
+
+#content.user.show
+  #container.top
+    #column.left
+      :width 100px
+    #column.right
+      :width 600px
+  #container.bottom
+    :background brown
\ No newline at end of file

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,2 @@
+bork
+  :bork= !bork

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork2.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork2.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork2.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/bork2.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,2 @@
+bork
+  :bork: bork;

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compact.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compact.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compact.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compact.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,17 @@
+#main
+  :width 15em
+  :color #0000ff
+  p
+    :border
+      :style dotted
+      /* Nested comment
+        More nested stuff
+      :width 2px
+  .cool
+    :width 100px
+
+#left
+  :font
+    :size 2em
+    :weight bold
+  :float left

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/complex.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/complex.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/complex.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/complex.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,307 @@
+body
+  :margin 0
+  :font   0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-serif
+  :color #fff
+  :background url(/images/global_bg.gif)
+
+#page
+  :width      900px
+  :margin     0 auto
+  :background #440008
+  :border-top
+    :width 5px
+    :style solid
+    :color #ff8500
+
+#header
+  :height  75px
+  :padding 0
+  h1
+    :float  left
+    :width  274px
+    :height 75px
+    :margin 0
+    :background
+      :image url(/images/global_logo.gif)
+      /* Crazy nested comment
+      :repeat no-repeat
+    :text-indent -9999px
+  .status
+    :float   right
+    :padding
+      :top .5em
+      :left .5em
+      :right .5em
+      :bottom 0
+    p
+      :float  left
+      :margin
+        :top 0
+        :right 0.5em
+        :bottom 0
+        :left 0
+    ul
+      :float   left
+      :margin  0
+      :padding 0
+    li
+      :list-style-type none
+      :display inline
+      :margin 0 5px
+    a:link, a:visited
+      :color #ff8500
+      :text-decoration none
+    a:hover
+      :text-decoration underline
+  .search
+    :float  right
+    :clear  right
+    :margin 12px 0 0 0
+    form
+      :margin 0
+    input
+      :margin 0 3px 0 0
+      :padding 2px
+      :border none
+
+#menu 
+  :clear both
+  :text-align right
+  :height 20px
+  :border-bottom 5px solid #006b95
+  :background #00a4e4
+  .contests
+    ul
+      :margin 0 5px 0 0
+      :padding 0
+      li 
+        :list-style-type none
+        :margin 0 5px
+        :padding 5px 5px 0 5px
+        :display inline
+        :font-size 1.1em
+        // This comment is properly indented
+        :color #fff
+        :background #00a4e4
+        / This rule isn't a comment!
+          :red green
+    a:link, a:visited
+      :color #fff
+      :text-decoration none
+      :font-weight bold
+    a:hover
+      :text-decoration underline
+
+//General content information
+#content
+  :clear both
+  .container
+    :clear both
+    .column
+      :float left
+      .right
+        :float right
+  a:link, a:visited
+    :color #93d700
+    :text-decoration none
+  a:hover
+    :text-decoration underline
+
+// A hard tab:
+	
+
+#content
+  p, div
+    :width 40em
+    li, dt, dd
+      :color #ddffdd
+      :background-color #4792bb
+  .container.video
+    .column.left
+      :width 200px
+      .box
+        :margin-top 10px
+        p 
+          :margin 0 1em auto 1em
+      .box.participants 
+        img
+          :float  left
+          :margin 0 1em auto 1em
+          :border 1px solid #6e000d
+            :style solid
+        h2
+          :margin 0 0 10px 0
+          :padding 0.5em
+          /* The background image is a gif!
+          :background #6e000d url(/images/hdr_participant.gif) 2px 2px no-repeat
+          /* Okay check this out
+            Multiline comments
+            Wow dude
+            I mean seriously, WOW
+          :text-indent -9999px
+          // And also...
+            Multiline comments that don't output!
+            Snazzy, no?
+          :border
+            :top
+              :width 5px
+              :style solid
+              :color #a20013
+            :right
+              :width 1px
+              :style dotted
+    .column.middle
+      :width 500px
+    .column.right
+      :width 200px
+      .box
+        :margin-top 0
+        p
+          :margin 0 1em auto 1em
+    .column
+      p
+        :margin-top 0
+
+#content.contests
+  .container.information 
+    .column.right 
+      .box
+        :margin 1em 0
+      .box.videos
+        .thumbnail img 
+          :width         200px
+          :height        150px
+          :margin-bottom 5px
+        a:link, a:visited
+          :color #93d700
+          :text-decoration none
+        a:hover
+          :text-decoration underline
+      .box.votes 
+        a
+          :display block
+          :width  200px
+          :height 60px
+          :margin 15px 0
+          :background url(/images/btn_votenow.gif) no-repeat
+          :text-indent -9999px
+          :outline none
+          :border  none
+        h2
+          :margin  52px 0 10px 0
+          :padding 0.5em
+          :background #6e000d url(/images/hdr_videostats.gif) 2px 2px no-repeat
+          :text-indent -9999px
+          :border-top 5px solid #a20013
+
+#content.contests 
+  .container.video
+    .box.videos
+      h2
+        :margin  0
+        :padding 0.5em
+        :background #6e000d url(/images/hdr_newestclips.gif) 2px 2px no-repeat
+        :text-indent -9999px
+        :border-top 5px solid #a20013
+      table
+        :width 100
+        td 
+          :padding 1em
+          :width 25
+          :vertical-align top
+          p
+            :margin 0 0 5px 0
+          a:link, a:visited    
+            :color #93d700
+            :text-decoration none
+          a:hover
+            :text-decoration underline
+      .thumbnail
+        :float left
+        img
+          :width  80px
+          :height 60px
+          :margin 0 10px 0 0
+          :border 1px solid #6e000d
+
+#content 
+  .container.comments 
+    .column
+      :margin-top 15px
+    .column.left
+      :width 600px
+      .box 
+        ol
+          :margin  0
+          :padding 0
+        li
+          :list-style-type none
+          :padding 10px
+          :margin 0 0 1em 0
+          :background #6e000d
+          :border-top 5px solid #a20013
+          div
+            :margin-bottom 1em
+          ul
+            :text-align right
+            li
+              :display inline
+              :border none
+              :padding 0
+    .column.right
+      :width        290px
+      :padding-left 10px
+      h2
+        :margin 0
+        :padding 0.5em
+        :background #6e000d url(/images/hdr_addcomment.gif) 2px 2px no-repeat
+        :text-indent -9999px
+        :border-top 5px solid #a20013
+      .box
+        textarea
+          :width  290px
+          :height 100px
+          :border none
+
+#footer
+  :margin-top 10px
+  :padding    1.2em 1.5em
+  :background #ff8500
+  ul
+    :margin 0
+    :padding 0
+    :list-style-type none
+    li
+      :display inline
+      :margin  0 0.5em
+      :color   #440008
+  ul.links
+    :float left
+    a:link, a:visited
+      :color #440008
+      :text-decoration none
+    a:hover
+      :text-decoration underline
+  ul.copyright
+    :float right
+
+
+.clear 
+  :clear both
+
+.centered 
+  :text-align center
+
+img
+  :border none
+
+button.short 
+  :width   60px
+  :height  22px
+  :padding 0 0 2px 0
+  :color   #fff
+  :border  none
+  :background url(/images/btn_short.gif) no-repeat
+
+table
+  :border-collapse collapse

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compressed.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compressed.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compressed.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/compressed.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,15 @@
+#main
+  :width 15em
+  :color #0000ff
+  p
+    :border
+      :style dotted
+      :width 2px
+  .cool
+    :width 100px
+
+#left
+  :font
+    :size 2em
+    :weight bold
+  :float left

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/expanded.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/expanded.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/expanded.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/expanded.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,17 @@
+#main
+  :width 15em
+  :color #0000ff
+  p
+    :border
+      :style dotted
+      /* Nested comment
+        More nested stuff
+      :width 2px
+  .cool
+    :width 100px
+
+#left
+  :font
+    :size 2em
+    :weight bold
+  :float left

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/import.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/import.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/import.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/import.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,11 @@
+!preconst = "hello"
+
+=premixin
+  pre-mixin: here
+
+@import importee.sass, basic.sass, basic.css, ../results/complex.css, partial.sass
+
+nonimported
+  :myconst = !preconst
+  :otherconst = !postconst
+  +postmixin

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/importee.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/importee.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/importee.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/importee.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,19 @@
+!postconst = "goodbye"
+
+=postmixin
+  post-mixin: here
+
+imported
+  :otherconst = !preconst
+  :myconst = !postconst
+  +premixin
+
+@import basic
+
+midrule
+  :inthe middle
+
+=crazymixin
+  foo: bar
+  baz
+    blat: bang

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/line_numbers.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/line_numbers.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/line_numbers.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/line_numbers.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,13 @@
+foo
+  bar: baz
+
+=premixin
+  squggle
+    blat: bang
+
+!preconst = 12
+
+@import importee
+
+umph
+  +crazymixin
\ No newline at end of file

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/mixins.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/mixins.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/mixins.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/mixins.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,76 @@
+!yellow = #fc0
+
+=bordered
+  :border
+    :top
+      :width 2px
+      :color = !yellow
+    :left
+      :width 1px
+      :color #000
+  -moz-border-radius: 10px
+
+=header-font
+  :color #f00
+  :font
+    :size 20px
+
+=compound
+  +header-font
+  +bordered
+
+=complex
+  +header-font
+  text:
+    decoration: none
+  &:after
+    content: "."
+    display: block
+    height: 0
+    clear: both
+    visibility: hidden
+  * html &
+    height: 1px
+    +header-font
+=deep
+  a:hover
+    :text-decoration underline
+    +compound
+
+
+#main
+  :width 15em
+  :color #0000ff
+  p
+    +bordered
+    :border
+      :style dotted
+      :width 2px
+  .cool
+    :width 100px
+
+#left
+  +bordered
+  :font
+    :size 2em
+    :weight bold
+  :float left
+
+#right
+  +bordered
+  +header-font
+  :float right
+
+.bordered
+  +bordered
+
+.complex
+  +complex
+
+.more-complex
+  +complex
+  +deep
+  display: inline
+  -webkit-nonsense:
+    top-right: 1px
+    bottom-left: 1px

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/multiline.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/multiline.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/multiline.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/multiline.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,20 @@
+#main,
+#header
+  height: 50px
+  div
+    width: 100px
+    a,
+    em
+      span
+        color: pink
+
+#one,
+#two,
+#three
+  div.nested,
+  span.nested,
+  p.nested
+    :font
+      :weight bold
+    :border-color red
+    :display block
\ No newline at end of file

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/nested.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/nested.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/nested.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/nested.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,25 @@
+#main
+  :width 15em
+  :color #0000ff
+  p
+    :border
+      :style dotted
+      /* Nested comment
+        More nested stuff
+      :width 2px
+  .cool
+    :width 100px
+
+#left
+  :font
+    :size 2em
+    :weight bold
+  :float left
+
+#right
+  .header
+    :border-style solid
+  .body
+    :border-style dotted
+  .footer
+    :border-style dashed

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/parent_ref.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/parent_ref.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/parent_ref.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/parent_ref.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,25 @@
+a
+  :color #000
+  &:hover
+    :color #f00
+
+p, div
+  :width 100em
+  & foo
+    :width 10em
+  &:hover, bar
+    :height 20em
+
+#cool
+  :border
+    :style solid
+    :width 2em
+  .ie7 &, .ie6 &
+    :content string(Totally not cool.)
+  .firefox &
+    :content string(Quite cool.)
+
+.wow, .snazzy
+  :font-family fantasy
+  &:hover, &:visited
+    :font-weight bold

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/script.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/script.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/script.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/script.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,101 @@
+!width = 10em + 20
+!color = #00ff98
+!main_text = #ffa
+!num = 10
+!dec = 10.2
+!dec_0 = 99.0
+!neg = -10
+!esc= 10"+12"
+!str= "Hello!"
+!qstr= "Quo\"ted\"!"
+!hstr= "Hyph-en!"
+!concat = "#{5 + 4} hi there"
+!percent= 11%
+!complex = 1px/1em
+
+#main
+  :content = !str
+  :qstr = !qstr
+  :hstr = !hstr
+  :width = !width
+  :background-color #000
+  :color= !main_text
+  :short-color= #123
+  :named-color= olive
+  :con= "foo" bar (!concat "boom")
+  :con2= "noquo" "quo"
+  #sidebar
+    :background-color= !color
+    :num
+      :normal= !num
+      :dec= !dec
+      :dec0= !dec_0
+      :neg= !neg
+    :esc= !esc
+    :many= 1 + 2 + 3
+    :order= 1 + 2 * 3
+    :complex= ((1 + 2) + 15)+#3a8b9f + ("hi"+(1 +1+ 2)*   4)
+
+#plus
+  :num
+    :num= 5+2
+    :num-un= 10em + 15em
+    :num-un2= 10 + 13em
+    :num-neg= 10 + -.13
+    :str= 100 * 1px
+    :col= 13 + #aaa
+    :perc = !percent + 20%
+  :str
+    :str= "hi" + "\ there"
+    :str2= "hi" + " there"
+    :col= "14em solid " + #123
+    :num= "times: " + 13
+  :col
+    :num= #f02 + 123.5
+    :col= #12A + #405162
+
+#minus
+  :num
+    :num= 912 - 12
+  :col
+    :num= #fffffa - 5.2
+    :col= #abcdef - #fedcba
+  :unary
+    :num= -1
+    :const= -!neg
+    :paren= -(5 + 6)
+    :two= --12
+    :many= --------12
+    :crazy= -----(5 + ---!neg)
+
+#times
+  :num
+    :num= 2 * 3.5
+    :col= 2 * #3a4b5c
+  :col
+    :num= #12468a * 0.5
+    :col= #121212 * #020304
+    
+#div
+  :num
+    :num= 10 / 3.0
+    :num2= 10 / 3
+  :col
+    :num= #12468a / 2
+    :col= #abcdef / #0f0f0f
+  :comp = !complex * 1em
+
+#mod
+  :num
+    :num= 17 % 3
+  :col
+    :col= #5f6e7d % #10200a
+    :num= #aaabac % 3
+
+#const
+  :escaped
+    :quote = "!foo"
+  :default = !str !important
+
+#regression
+  :a= (3 + 2) - 1

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/_nested_partial.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/_nested_partial.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/_nested_partial.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/_nested_partial.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,2 @@
+#nested
+  :relative true

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/nested_subdir/nested_subdir.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,3 @@
+#pi
+  :width 314px
+    
\ No newline at end of file

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/subdir/subdir.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,6 @@
+@import nested_subdir/nested_partial.sass
+
+#subdir
+  :font
+    :size 20px
+    :weight bold

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/units.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/units.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/units.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/sass/templates/units.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,11 @@
+b
+  :foo= 0.5 * 10px
+  :bar= 10zzz * 12px / 5zzz
+  :baz= percentage(12.0px / 18px)
+  :many-units= 10.0zzz / 3yyy * 12px / 5zzz * 3yyy / 3px * 4em
+  :mm= 5mm + 1cm
+  :pc= 1pc + 12pt
+  :pt= 72pt - 2in
+  :inches= 1in + 2.54cm
+  :more-inches= 1in + ((72pt * 2in) + (36pt * 1in)) / 2.54cm
+  :mixed= (1 + (1em * 6px / 3in)) * 4in / 2em

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/test_helper.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/test_helper.rb?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/test_helper.rb (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/test/test_helper.rb Thu Jul  8 23:14:13 2010
@@ -0,0 +1,44 @@
+lib_dir = File.dirname(__FILE__) + '/../lib'
+require File.dirname(__FILE__) + '/linked_rails'
+
+require 'test/unit'
+require 'fileutils'
+$:.unshift lib_dir unless $:.include?(lib_dir)
+require 'haml'
+require 'sass'
+
+Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)
+
+# required because of Sass::Plugin
+unless defined? RAILS_ROOT
+  RAILS_ROOT = '.'
+  MERB_ENV = RAILS_ENV  = 'testing'
+end
+
+class Test::Unit::TestCase
+  def munge_filename(opts)
+    return if opts[:filename]
+    test_name = caller[1].gsub(/^.*`(?:\w+ )*(\w+)'.*$/, '\1')
+    opts[:filename] = "#{test_name}_inline.sass"
+  end
+
+  def clean_up_sassc
+    path = File.dirname(__FILE__) + "/../.sass-cache"
+    FileUtils.rm_r(path) if File.exist?(path)
+  end
+
+  def assert_warning(message)
+    the_real_stderr, $stderr = $stderr, StringIO.new
+    yield
+    assert_equal message.strip, $stderr.string.strip
+  ensure
+    $stderr = the_real_stderr
+  end
+
+  def silence_warnings
+    the_real_stderr, $stderr = $stderr, StringIO.new
+    yield
+  ensure
+    $stderr = the_real_stderr
+  end
+end

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/full_doc_mods.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/full_doc_mods.rb?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/full_doc_mods.rb (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/full_doc_mods.rb Thu Jul  8 23:14:13 2010
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + "/../lib/sass"
+
+class YARD::Generators::FullDocGenerator
+  protected
+
+  def generate_assets_with_haml
+    generate_assets_without_haml
+
+    if format == :html && serializer
+      template_file = find_template template_path(css_file)
+      haml_style = Sass::Engine.new(File.read(
+          File.dirname(__FILE__) + "/haml-style.sass")).render
+      serializer.serialize(css_file, File.read(template_file) + haml_style)
+    end
+
+    true
+  end
+  alias_method :generate_assets_without_haml, :generate_assets
+  alias_method :generate_assets, :generate_assets_with_haml
+end

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/haml-style.sass
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/haml-style.sass?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/haml-style.sass (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/haml-style.sass Thu Jul  8 23:14:13 2010
@@ -0,0 +1,22 @@
+.maruku_toc
+  background: #ddd
+  border: 1px solid #ccc
+  margin-right: 2em
+  float: left
+  ul
+    padding: 0 1em
+  #frequently_asked_questions + &
+    float: none
+    margin: 0 2em
+
+.section.readme
+  *:target, dt:target + dd
+    background-color: #ccf
+    border: 1px solid #88b
+  dd
+    margin-left: 0
+    padding-left: 3em
+  dt:target
+    border-bottom-style: none
+    & + dd
+      border-top-style: none

Added: incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/inherited_hash.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/inherited_hash.rb?rev=961978&view=auto
==============================================================================
--- incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/inherited_hash.rb (added)
+++ incubator/deltacloud/trunk/framework/vendor/plugins/haml/yard/inherited_hash.rb Thu Jul  8 23:14:13 2010
@@ -0,0 +1,44 @@
+class InheritedHashHandler < YARD::Handlers::Base
+  handles /\Ainherited_hash(\s|\()/
+
+  def process
+    hash_name = tokval(statement.tokens[2])
+    name = statement.comments.first.strip
+    type = statement.comments[1].strip
+
+    register(MethodObject.new(namespace, hash_name, scope)) do |o|
+      o.docstring = [
+        "Gets a #{name} from this {Environment} or one of its \\{#parent}s.",
+        "@param name [String] The name of the #{name}",
+        "@return [#{type}] The #{name} value",
+      ]
+      o.signature = true
+      o.parameters = ["name"]
+    end
+
+    register(MethodObject.new(namespace, "set_#{hash_name}", scope)) do |o|
+      o.docstring = [
+        "Sets a #{name} in this {Environment} or one of its \\{#parent}s.",
+        "If the #{name} is already defined in some environment,",
+        "that one is set; otherwise, a new one is created in this environment.",
+        "@param name [String] The name of the #{name}",
+        "@param value [#{type}] The value of the #{name}",
+        "@return [#{type}] `value`",
+      ]
+      o.signature = true
+      o.parameters = ["name", "value"]
+    end
+
+    register(MethodObject.new(namespace, "set_local_#{hash_name}", scope)) do |o|
+      o.docstring = [
+        "Sets a #{name} in this {Environment}.",
+        "Ignores any parent environments.",
+        "@param name [String] The name of the #{name}",
+        "@param value [#{type}] The value of the #{name}",
+        "@return [#{type}] `value`",
+      ]
+      o.signature = true
+      o.parameters = ["name", "value"]
+    end
+  end
+end