haml 6.3.1 → 7.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fe81126a81cb26d93f23c930d55244ee89654bdfc188f8cf3e64b69475b5472
4
- data.tar.gz: 7862cc5427e62e96ec1851f6265522b619d5f2fdf15a55ca6aef8ee2f641b0ed
3
+ metadata.gz: 0e24d15b93f8a8d9f856080c6fd6dbb2183b07602b2e3bd9beb43a718b4cd021
4
+ data.tar.gz: 5cc2496f9fdeba6950f152ffb0be8ea690f6543736d178e98da276da28706b4c
5
5
  SHA512:
6
- metadata.gz: ccf3c62f1b319265ceaec6987888b17f0a2b1599d56e3f625d973ecc3c920b7efbd17e86a949c9081e82b084f554978e52c91d0452e8ef02c6e21d6d4a4e6d0e
7
- data.tar.gz: 01f7a62d43f8a9929bfc42dfb8677f0641650064565c4a2f0ea6fe53a3e11da819b6f9c5c6aa79f67102a0b0197cd282feebcb9116d6bf1f242efc241f7e37f3
6
+ metadata.gz: 379fe2253bfe6688e41fdd16a8b007635ca3a48c688d5ba3e90ccafe4f8414959c1e800481a95fd76995615bd9af66977e74f0d4a08916ab1ff257bd7b375fbd
7
+ data.tar.gz: bdcecfe1f128e52e719d0005abddeb4a5fb4b049722c5db267bf1862ce54ddb69db18a7114a1e37b8db880676b513cbd8dc4d9fa02da23d5de66d4bbaa282338
@@ -17,17 +17,12 @@ jobs:
17
17
  fail-fast: false
18
18
  matrix:
19
19
  ruby:
20
- - '2.5'
21
- - '2.6'
22
- - '2.7'
23
- - '3.0'
24
- - '3.1'
25
20
  - '3.2'
26
21
  - '3.3'
27
22
  - '3.4'
28
23
  - ruby-head
29
24
  - jruby
30
- - truffleruby-head
25
+ - truffleruby
31
26
  steps:
32
27
  - uses: actions/checkout@v4
33
28
  - run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Haml Changelog
2
2
 
3
+ ## 7.0.0
4
+
5
+ * Change the default `attr_quote` from `'` to `"` https://github.com/haml/haml/issues/1188
6
+ * Bump required Ruby version to 3.2 https://github.com/haml/haml/issues/1176
7
+
8
+ ## 6.4.0
9
+
10
+ * Authorize characters in attribute name for vuejs https://github.com/haml/haml/pull/1172
11
+ * Compile new-style attributes statically https://github.com/haml/haml/pull/1165
12
+ * Remove newlines from template annotation comments https://github.com/haml/haml/pull/1186
13
+ * Fix line numbers within a :ruby filter https://github.com/haml/haml/pull/1166
14
+ * Fix .class + nested class array bug https://github.com/haml/haml/pull/1191
15
+
3
16
  ## 6.3.1
4
17
 
5
18
  * Optimize string transformation using `String#tr` https://github.com/haml/haml/pull/1168
data/Gemfile CHANGED
@@ -10,7 +10,9 @@ gemspec
10
10
 
11
11
  gem 'benchmark-ips', '2.3.0'
12
12
  gem 'maxitest'
13
- gem 'pry'
13
+ gem 'base64'
14
+ gem 'bigdecimal'
15
+ gem 'mutex_m'
14
16
 
15
17
  if /java/ === RUBY_PLATFORM # JRuby
16
18
  gem 'pandoc-ruby'
data/REFERENCE.md CHANGED
@@ -360,13 +360,6 @@ will render as:
360
360
 
361
361
  <a data-author-id='123' data-category='7' href='/posts'>Posts By Author</a>
362
362
 
363
- Notice that the underscore in `author_id` was replaced with a hyphen. If you wish
364
- to suppress this behavior, you can set Haml's
365
- {Haml::Options#hyphenate_data_attrs `:hyphenate_data_attrs` option} to `false`,
366
- and the output will be rendered as:
367
-
368
- <a data-author_id='123' data-category='7' href='/posts'>Posts By Author</a>
369
-
370
363
  This expansion of hashes is recursive – any value of the child hash that is
371
364
  itself a hash will create an attribute for each entry, with the attribute name
372
365
  prefixed with all ancestor keys. For example:
data/bin/console CHANGED
@@ -1,11 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bundler/setup'
4
- require 'hamlit'
4
+ require 'haml'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- require 'pry'
11
- Pry.start
9
+ require 'irb'
10
+ IRB.start
data/haml.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.metadata["changelog_uri"] = spec.homepage + "/blob/main/CHANGELOG.md"
25
25
 
26
- spec.required_ruby_version = '>= 2.1.0'
26
+ spec.required_ruby_version = '>= 3.2.0'
27
27
 
28
28
  spec.add_dependency 'temple', '>= 0.8.2'
29
29
  spec.add_dependency 'thor'
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'bundler'
34
34
  spec.add_development_dependency 'coffee-script'
35
35
  spec.add_development_dependency 'erubi'
36
- spec.add_development_dependency 'haml', '>= 5'
37
36
  spec.add_development_dependency 'less'
38
37
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
39
38
  spec.add_development_dependency 'rails', '>= 4.0'
@@ -54,7 +54,7 @@ module Haml::AttributeBuilder
54
54
  when value.is_a?(String)
55
55
  classes += value.split(' ')
56
56
  when value.is_a?(Array)
57
- classes += value.select { |v| v }
57
+ classes += value.flatten.select { |v| v }
58
58
  when value
59
59
  classes << value.to_s
60
60
  end
@@ -98,7 +98,7 @@ module Haml
98
98
  def compile_boolean!(temple, key, values)
99
99
  exp = literal_for(values.last)
100
100
 
101
- if Temple::StaticAnalyzer.static?(exp)
101
+ if values.last.first == :static || Temple::StaticAnalyzer.static?(exp)
102
102
  value = eval(exp)
103
103
  case value
104
104
  when true then temple << [:html, :attr, key, @format == :xhtml ? [:static, key] : [:multi]]
data/lib/haml/engine.rb CHANGED
@@ -17,13 +17,13 @@ module Haml
17
17
  :buffer_class,
18
18
  generator: Temple::Generators::StringBuffer,
19
19
  format: :html,
20
- attr_quote: "'",
20
+ attr_quote: '"',
21
21
  escape_html: true,
22
22
  escape_attrs: true,
23
23
  autoclose: %w(area base basefont br col command embed frame
24
24
  hr img input isindex keygen link menuitem meta
25
25
  param source track wbr),
26
- filename: "",
26
+ filename: '',
27
27
  disable_capture: false,
28
28
  remove_whitespace: false,
29
29
  )
@@ -7,7 +7,7 @@ module Haml
7
7
  def compile(node)
8
8
  text = node.value[:text]
9
9
  text = text.rstrip unless ::Haml::Util.contains_interpolation?(text) # for compatibility
10
- [:multi, *compile_plain(text)]
10
+ [:multi, [:newline], *compile_plain(text)]
11
11
  end
12
12
 
13
13
  private
@@ -3,7 +3,7 @@ module Haml
3
3
  class Filters
4
4
  class Ruby < Base
5
5
  def compile(node)
6
- [:code, node.value[:text]]
6
+ [:multi, [:newline], [:code, node.value[:text]]]
7
7
  end
8
8
  end
9
9
  end
data/lib/haml/parser.rb CHANGED
@@ -749,7 +749,7 @@ module Haml
749
749
  end
750
750
 
751
751
  def parse_new_attribute(scanner)
752
- unless (name = scanner.scan(/[-:\w]+/))
752
+ unless (name = scanner.scan(/[-:@#\w\.]+/))
753
753
  return if scanner.scan(/\)/)
754
754
  return false
755
755
  end
@@ -40,8 +40,8 @@ module Haml
40
40
 
41
41
  if ActionView::Base.try(:annotate_rendered_view_with_filenames) && template.format == :html
42
42
  options = options.merge(
43
- preamble: "<!-- BEGIN #{template.short_identifier} -->\n",
44
- postamble: "<!-- END #{template.short_identifier} -->\n",
43
+ preamble: "<!-- BEGIN #{template.short_identifier} -->",
44
+ postamble: "<!-- END #{template.short_identifier} -->",
45
45
  )
46
46
  end
47
47
 
data/lib/haml/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Haml
3
- VERSION = '6.3.1'
3
+ VERSION = '7.0.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.1
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -111,20 +111,6 @@ dependencies:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
- - !ruby/object:Gem::Dependency
115
- name: haml
116
- requirement: !ruby/object:Gem::Requirement
117
- requirements:
118
- - - ">="
119
- - !ruby/object:Gem::Version
120
- version: '5'
121
- type: :development
122
- prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- version: '5'
128
114
  - !ruby/object:Gem::Dependency
129
115
  name: less
130
116
  requirement: !ruby/object:Gem::Requirement
@@ -330,7 +316,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
316
  requirements:
331
317
  - - ">="
332
318
  - !ruby/object:Gem::Version
333
- version: 2.1.0
319
+ version: 3.2.0
334
320
  required_rubygems_version: !ruby/object:Gem::Requirement
335
321
  requirements:
336
322
  - - ">="