haml-edge 3.1.66 → 3.1.67

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.
data/EDGE_GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.66
1
+ 3.1.67
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.66
1
+ 3.1.67
data/lib/haml/exec.rb CHANGED
@@ -294,6 +294,10 @@ END
294
294
  'Locations are set like --watch.') do
295
295
  @options[:update] = true
296
296
  end
297
+ opts.on('--stop-on-error', 'If a file fails to compile, exit immediately.',
298
+ 'Only meaningful for --watch and --update.') do
299
+ @options[:stop_on_error] = true
300
+ end
297
301
  opts.on('-t', '--style NAME',
298
302
  'Output style. Can be nested (default), compact, compressed, or expanded.') do |name|
299
303
  @options[:for_engine][:style] = name.to_sym
@@ -426,7 +430,7 @@ MSG
426
430
  ::Sass::Plugin.on_creating_directory {|dirname| puts_action :directory, :green, dirname}
427
431
  ::Sass::Plugin.on_deleting_css {|filename| puts_action :delete, :yellow, filename}
428
432
  ::Sass::Plugin.on_compilation_error do |error, _, _|
429
- raise error unless error.is_a?(::Sass::SyntaxError)
433
+ raise error unless error.is_a?(::Sass::SyntaxError) && !@options[:stop_on_error]
430
434
  had_error = true
431
435
  puts_action :error, :red, "#{error.sass_filename} (Line #{error.sass_line}: #{error.message})"
432
436
  end
data/lib/haml/helpers.rb CHANGED
@@ -442,7 +442,8 @@ MESSAGE
442
442
  text = rest.shift.to_s unless [Symbol, Hash, NilClass].any? {|t| rest.first.is_a? t}
443
443
  flags = []
444
444
  flags << rest.shift while rest.first.is_a? Symbol
445
- name, attrs = merge_name_and_attributes(name.to_s, rest.shift || {})
445
+ attrs = Haml::Util.map_keys(rest.shift || {}) {|key| key.to_s}
446
+ name, attrs = merge_name_and_attributes(name.to_s, attrs)
446
447
 
447
448
  attributes = Haml::Precompiler.build_attributes(haml_buffer.html?,
448
449
  haml_buffer.options[:attr_wrapper],
@@ -551,8 +552,7 @@ MESSAGE
551
552
  return name, attributes_hash unless name =~ /^(.+?)?([\.#].*)$/
552
553
 
553
554
  return $1 || "div", Buffer.merge_attrs(
554
- Precompiler.parse_class_and_id($2),
555
- Haml::Util.map_keys(attributes_hash) {|key| key.to_s})
555
+ Precompiler.parse_class_and_id($2), attributes_hash)
556
556
  end
557
557
 
558
558
  # Runs a block of code with the given buffer as the currently active buffer.
@@ -259,6 +259,11 @@ HAML
259
259
  assert_equal("<p id='c_a_b'>foo</p>\n", render("- haml_tag 'p#c', 'foo', :id => %w[a b]"))
260
260
  end
261
261
 
262
+ def test_haml_tag_with_data_hash
263
+ assert_equal("<p data-baz='data-baz' data-foo='bar'>foo</p>\n",
264
+ render("- haml_tag :p, 'foo', :data => {:foo => 'bar', :baz => true}"))
265
+ end
266
+
262
267
  def test_haml_tag_non_autoclosed_tags_arent_closed
263
268
  assert_equal("<p></p>\n", render("- haml_tag :p"))
264
269
  end
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: 3.1.66
4
+ version: 3.1.67
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Weizenbaum
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2010-08-16 00:00:00 -04:00
14
+ date: 2010-08-22 00:00:00 -04:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency