From f209a01e93e7ebf7f0f75e232de762a3a5fc424f Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 25 Jun 2009 01:09:42 -0700 Subject: [PATCH 1/5] Regenerate sites whenever either Haml or Sass are updated. --- Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rakefile b/Rakefile index 7c7194f2..3f7c28d6 100644 --- a/Rakefile +++ b/Rakefile @@ -261,6 +261,8 @@ task :handle_update do begin if ENV["REF"] == "refs/heads/master" sh %{rake release_edge --trace} + sh %{rake pages --trace PROJ=haml} + sh %{rake pages --trace PROJ=sass} elsif ENV["REF"] =~ %r{^refs/heads/(haml|sass)-pages$} sh %{rake pages --trace PROJ=#{$1}} end From bd7f81dd23e4164148fbae5283bf396831f28290 Mon Sep 17 00:00:00 2001 From: Shingo Noguchi Date: Sat, 27 Jun 2009 14:41:41 +0900 Subject: [PATCH 2/5] [Haml] Don't use File.expand_path in Util.scope. This dies when there are symbolic links involved. --- lib/haml/util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/haml/util.rb b/lib/haml/util.rb index 244bb08f..7ac1bbd6 100644 --- a/lib/haml/util.rb +++ b/lib/haml/util.rb @@ -15,7 +15,7 @@ module Haml # @param file [String] The filename relative to the Haml root # @return [String] The filename relative to the the working directory def scope(file) - File.expand_path File.join(File.dirname(__FILE__), '..', '..', file) + File.join(File.dirname(__FILE__), '..', '..', file) end # Converts an array of `[key, value]` pairs to a hash. From 1895f35f7b371772d4cf1f6c3f3bf91ea01039ae Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Sat, 27 Jun 2009 21:58:20 -0700 Subject: [PATCH 3/5] [Sass] Make css2sass work with comments in selectors. Closes gh-14 --- lib/sass/css.rb | 14 +++++++++++++- test/sass/css2sass_test.rb | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/lib/sass/css.rb b/lib/sass/css.rb index aed6f12e..30427f6a 100644 --- a/lib/sass/css.rb +++ b/lib/sass/css.rb @@ -118,7 +118,19 @@ module Sass # # @return [Tree::Node] The parsed rule def rule - return unless rule = @template.scan(/[^\{\};]+/) + rule = "" + loop do + token = @template.scan(/(?:[^\{\};\/\s]|\/[^*])+/) + if token.nil? + return if rule.empty? + break + end + rule << token + break unless @template.match?(/\s|\/\*/) + whitespace + rule << " " + end + rule.strip! directive = rule[0] == ?@ diff --git a/test/sass/css2sass_test.rb b/test/sass/css2sass_test.rb index 4669412f..e288a8ae 100644 --- a/test/sass/css2sass_test.rb +++ b/test/sass/css2sass_test.rb @@ -207,6 +207,29 @@ down_here { yeah: true; } CSS end + def test_comments_in_selectors + assert_equal(< Date: Sun, 28 Jun 2009 00:15:37 -0700 Subject: [PATCH 4/5] Update TODO. --- TODO | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TODO b/TODO index 0a80fd15..2497007d 100644 --- a/TODO +++ b/TODO @@ -11,6 +11,12 @@ ** Haml Figure out alternate attribute syntax [2.4] Allow "!!! HTML5" to set :format => :html5 ? + How do we deal with partials? + [2.4] :ugly + :html improvements + Ignore closing tags where we can + http://code.google.com/speed/articles/optimizing-html.html + Requires Haml parsing refactor + Don't quote attributes that don't require it ** Sass [2.4] CSS superset [2.4] Classes are mixins From 01a3c1b94d4629c3972a4c0b65d987447dd4c9aa Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Sun, 28 Jun 2009 00:17:46 -0700 Subject: [PATCH 5/5] Add references to TODO. --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 2497007d..9ff8859d 100644 --- a/TODO +++ b/TODO @@ -17,6 +17,8 @@ http://code.google.com/speed/articles/optimizing-html.html Requires Haml parsing refactor Don't quote attributes that don't require it + http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2 + http://www.w3.org/TR/html5/syntax.html#attributes ** Sass [2.4] CSS superset [2.4] Classes are mixins