haml-edge 2.3.84 → 2.3.85

Sign up to get free protection for your applications and to get access to all the features.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.84
1
+ 2.3.85
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.84
1
+ 2.3.85
@@ -744,7 +744,7 @@ END
744
744
  raise SyntaxError.new("There's no Ruby code for #{action} to evaluate.", last_line - 1) if parse && value.empty?
745
745
  raise SyntaxError.new("Self-closing tags can't have content.", last_line - 1) if self_closing && !value.empty?
746
746
 
747
- self_closing ||= !!( !block_opened? && value.empty? && @options[:autoclose].include?(tag_name) )
747
+ self_closing ||= !!(!block_opened? && value.empty? && @options[:autoclose].any? {|t| t === tag_name})
748
748
  value = nil if value.empty? && (block_opened? || self_closing)
749
749
 
750
750
  dont_indent_next_line =
@@ -7,9 +7,14 @@ unless defined?(Sass::RAILS_LOADED)
7
7
  :always_check => RAILS_ENV != "production",
8
8
  :full_exception => RAILS_ENV != "production")
9
9
 
10
- if defined?(ActionDispatch::Callbacks.to_prepare)
11
- # Rails >= 3.0.0
12
- ActionDispatch::Callbacks.to_prepare(:sass_process) {Sass::Plugin.check_for_updates}
10
+ if defined?(Rails.configuration.middleware)
11
+ # Rails >= 3.0
12
+ require 'sass/plugin/rack'
13
+ Rails.configuration.middleware.use(Sass::Plugin::Rack)
14
+ elsif defined?(ActionController::Dispatcher.middleware)
15
+ # Rails >= 2.3
16
+ require 'sass/plugin/rack'
17
+ ActionController::Dispatcher.middleware.use(Sass::Plugin::Rack)
13
18
  else
14
19
  module ActionController
15
20
  class Base
@@ -764,13 +764,26 @@ HAML
764
764
  assert_equal("<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n", render("!!! XML", :attr_wrapper => '"'))
765
765
  end
766
766
 
767
+ def test_autoclose_option
768
+ assert_equal("<flaz foo='bar' />\n", render("%flaz{:foo => 'bar'}", :autoclose => ["flaz"]))
769
+ assert_equal(<<HTML, render(<<HAML, :autoclose => [/^flaz/]))
770
+ <flaz />
771
+ <flaznicate />
772
+ <flan></flan>
773
+ HTML
774
+ %flaz
775
+ %flaznicate
776
+ %flan
777
+ HAML
778
+ end
779
+
767
780
  def test_attrs_parsed_correctly
768
781
  assert_equal("<p boom=>biddly='bar =&gt; baz'></p>\n", render("%p{'boom=>biddly' => 'bar => baz'}"))
769
782
  assert_equal("<p foo,bar='baz, qux'></p>\n", render("%p{'foo,bar' => 'baz, qux'}"))
770
783
  assert_equal("<p escaped='quo&#x000A;te'></p>\n", render("%p{ :escaped => \"quo\\nte\"}"))
771
784
  assert_equal("<p escaped='quo4te'></p>\n", render("%p{ :escaped => \"quo\#{2 + 2}te\"}"))
772
785
  end
773
-
786
+
774
787
  def test_correct_parsing_with_brackets
775
788
  assert_equal("<p class='foo'>{tada} foo</p>\n", render("%p{:class => 'foo'} {tada} foo"))
776
789
  assert_equal("<p class='foo'>deep {nested { things }}</p>\n", render("%p{:class => 'foo'} deep {nested { things }}"))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.84
4
+ version: 2.3.85
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-13 00:00:00 -05:00
13
+ date: 2009-11-14 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency