haml 5.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb6c73536c5c41a0bdc61a99d45dd465616af8ef38392c6eadee4e82a5150556
4
- data.tar.gz: e932ae5a4187ff9b4b6c4ea09c4d478009408a576282bee619075314dc7d88f7
3
+ metadata.gz: b452821b37a39c122c73b034833f334367ea652bcbc9c8166fb4b146622766a2
4
+ data.tar.gz: 41b11d87fa61bc35507519f25843284e07a6610bcc65e1beef5302590d925556
5
5
  SHA512:
6
- metadata.gz: 99f293970f051c7b007b8e0620bc64ee416868907b20e7ff10985c27920e7d3221c3ac7e6e4d1b51ecb763cf3a6315db886e0f1ca2cd978bb81e5febcf24a10c
7
- data.tar.gz: 37812661dcea2d7de576c38f38df1f4a07231108ef47655cb1ea32f5e2470abe8c9501d1b54a69865d47fb71c9213914d9394fe9372ca8ba601d9bdf33e09a4e
6
+ metadata.gz: c68926aed4f1615985b6da508e8eafb4951162ab1064b94f5d2c17978390d82d2912098bdf74b90acfea1df1a21d711c0e3d14315394ebc7fa60341dd2c61975
7
+ data.tar.gz: 499700814e3f72d7d7f033b80b9cd6b701ef07bcf46f1399ece0cf0dad5ddea6bbdff912775c3cd4e1506735cb7fd85cd1666903e69706968874b80788a2a9a7
@@ -1,5 +1,12 @@
1
1
  # Haml Changelog
2
2
 
3
+ ## 5.1.1
4
+
5
+ Released on May 25, 2019
6
+ ([diff](https://github.com/haml/haml/compare/v5.1.0...v5.1.1)).
7
+
8
+ * Fix NameError bug for that happens on ruby 2.6.1-2.6.3 + haml 5.1.0 + rails 4.2.x + erubi. (Akira Matsuda)
9
+
3
10
  ## 5.1.0
4
11
 
5
12
  Released on May 16, 2019
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/haml.svg)](http://rubygems.org/gems/haml)
4
4
  [![Build Status](https://travis-ci.org/haml/haml.svg?branch=master)](http://travis-ci.org/haml/haml)
5
- [![Code Climate](http://img.shields.io/codeclimate/github/haml/haml.svg)](https://codeclimate.com/github/haml/haml)
5
+ [![Code Climate](https://codeclimate.com/github/haml/haml/badges/gpa.svg)](https://codeclimate.com/github/haml/haml)
6
6
  [![Coverage Status](http://img.shields.io/coveralls/haml/haml.svg)](https://coveralls.io/r/haml/haml)
7
7
  [![Inline docs](http://inch-ci.org/github/haml/haml.png)](http://inch-ci.org/github/haml/haml)
8
8
 
@@ -14,6 +14,14 @@ Gem::Specification.new do |spec|
14
14
  end
15
15
  spec.homepage = 'http://haml.info/'
16
16
  spec.license = "MIT"
17
+ spec.metadata = {
18
+ "bug_tracker_uri" => "https://github.com/haml/haml/issues",
19
+ "changelog_uri" => "https://github.com/haml/haml/blob/master/CHANGELOG.md",
20
+ "documentation_uri" => "http://haml.info/docs.html",
21
+ "homepage_uri" => "http://haml.info",
22
+ "mailing_list_uri" => "https://groups.google.com/forum/?fromgroups#!forum/haml",
23
+ "source_code_uri" => "https://github.com/haml/haml"
24
+ }
17
25
 
18
26
  spec.required_ruby_version = '>= 2.0.0'
19
27
 
@@ -7,7 +7,7 @@ module Haml
7
7
  # @param type [Symbol] :static or :dynamic
8
8
  # @param key [String]
9
9
  # @param value [String] Actual string value for :static type, value's Ruby literal for :dynamic type.
10
- class AttributeValue < Struct.new(:type, :key, :value)
10
+ AttributeValue = Struct.new(:type, :key, :value) do
11
11
  # @return [String] A Ruby literal of value.
12
12
  def to_literal
13
13
  case type
@@ -168,7 +168,7 @@ module Haml
168
168
  end
169
169
 
170
170
  def compile_filter
171
- unless filter = @filters[@node.value[:name]]
171
+ unless (filter = @filters[@node.value[:name]])
172
172
  name = @node.value[:name]
173
173
  if ["maruku", "textile"].include?(name)
174
174
  raise Error.new(Error.message(:install_haml_contrib, name), @node.line - 1)
@@ -338,11 +338,9 @@ END
338
338
  end
339
339
 
340
340
  def validate_ruby(code)
341
- begin
342
- eval("BEGIN {return nil}; #{code}", binding, @options[:filename] || "")
343
- rescue ::SyntaxError # Not to be confused with Haml::SyntaxError
344
- $!
345
- end
341
+ eval("BEGIN {return nil}; #{code}", binding, @options[:filename] || "")
342
+ rescue ::SyntaxError # Not to be confused with Haml::SyntaxError
343
+ $!
346
344
  end
347
345
  end
348
346
  end
@@ -120,7 +120,7 @@ module Haml
120
120
  # @param text [String] The source text for the filter to process
121
121
  # @return [String] The filtered result
122
122
  # @raise [Haml::Error] if it's not overridden
123
- def render(text)
123
+ def render(_text)
124
124
  raise Error.new("#{self.inspect}#render not defined!")
125
125
  end
126
126
 
@@ -131,7 +131,7 @@ module Haml
131
131
  # @param text [String] The source text for the filter to process
132
132
  # @return [String] The filtered result
133
133
  # @raise [Haml::Error] if it or \{#render} isn't overridden
134
- def render_with_options(text, options)
134
+ def render_with_options(text, _options)
135
135
  render(text)
136
136
  end
137
137
 
@@ -179,7 +179,7 @@ module Haml
179
179
  private
180
180
 
181
181
  # @private
182
- class Line < Struct.new(:whitespace, :text, :full, :index, :parser, :eod)
182
+ Line = Struct.new(:whitespace, :text, :full, :index, :parser, :eod) do
183
183
  alias_method :eod?, :eod
184
184
 
185
185
  # @private
@@ -195,7 +195,7 @@ module Haml
195
195
  end
196
196
 
197
197
  # @private
198
- class ParseNode < Struct.new(:type, :line, :value, :parent, :children)
198
+ ParseNode = Struct.new(:type, :line, :value, :parent, :children) do
199
199
  def initialize(*args)
200
200
  super
201
201
  self.children ||= []
@@ -208,12 +208,13 @@ module Haml
208
208
 
209
209
  # @param [String] new - Hash literal including dynamic values.
210
210
  # @param [String] old - Hash literal including dynamic values or Ruby literal of multiple Hashes which MUST be interpreted as method's last arguments.
211
- class DynamicAttributes < Struct.new(:new, :old)
211
+ DynamicAttributes = Struct.new(:new, :old) do
212
+ undef :old=
212
213
  def old=(value)
213
214
  unless value =~ /\A{.*}\z/m
214
215
  raise ArgumentError.new('Old attributes must start with "{" and end with "}"')
215
216
  end
216
- super
217
+ self[:old] = value
217
218
  end
218
219
 
219
220
  # This will be a literal for Haml::Buffer#attributes's last argument, `attributes_hashes`.
@@ -288,7 +289,7 @@ module Haml
288
289
  end
289
290
 
290
291
  def block_keyword(text)
291
- return unless keyword = text.scan(BLOCK_KEYWORD_REGEX)[0]
292
+ return unless (keyword = text.scan(BLOCK_KEYWORD_REGEX)[0])
292
293
  keyword[0] || keyword[1]
293
294
  end
294
295
 
@@ -535,7 +536,7 @@ module Haml
535
536
 
536
537
  # Post-process case statements to normalize the nesting of "when" clauses
537
538
  return unless node.value[:keyword] == "case"
538
- return unless first = node.children.first
539
+ return unless (first = node.children.first)
539
540
  return unless first.type == :silent_script && first.value[:keyword] == "when"
540
541
  return if first.children.empty?
541
542
  # If the case node has a "when" child with children, it's the
@@ -584,9 +585,9 @@ module Haml
584
585
  scanner = StringScanner.new(text)
585
586
  scanner.scan(/\s+/)
586
587
  until scanner.eos?
587
- return unless key = scanner.scan(LITERAL_VALUE_REGEX)
588
+ return unless (key = scanner.scan(LITERAL_VALUE_REGEX))
588
589
  return unless scanner.scan(/\s*=>\s*/)
589
- return unless value = scanner.scan(LITERAL_VALUE_REGEX)
590
+ return unless (value = scanner.scan(LITERAL_VALUE_REGEX))
590
591
  return unless scanner.scan(/\s*(?:,|$)\s*/)
591
592
  attributes[eval(key).to_s] = eval(value).to_s
592
593
  end
@@ -714,7 +715,7 @@ module Haml
714
715
  end
715
716
 
716
717
  def parse_new_attribute(scanner)
717
- unless name = scanner.scan(/[-:\w]+/)
718
+ unless (name = scanner.scan(/[-:\w]+/))
718
719
  return if scanner.scan(/\)/)
719
720
  return false
720
721
  end
@@ -723,8 +724,8 @@ module Haml
723
724
  return name, [:static, true] unless scanner.scan(/=/) #/end
724
725
 
725
726
  scanner.scan(/\s*/)
726
- unless quote = scanner.scan(/["']/)
727
- return false unless var = scanner.scan(/(@@?|\$)?\w+/)
727
+ unless (quote = scanner.scan(/["']/))
728
+ return false unless (var = scanner.scan(/(@@?|\$)?\w+/))
728
729
  return name, [:dynamic, var]
729
730
  end
730
731
 
@@ -34,8 +34,7 @@ module Haml
34
34
  # solved by looking for ::Erubi first.
35
35
  # However, in JRuby, the const_defined? finds it anyway, so we must make sure that it's
36
36
  # not just a reference to ::Erubi.
37
- if defined?(::Erubi) && const_defined?('ActionView::Template::Handlers::ERB::Erubi') &&
38
- ActionView::Template::Handlers::ERB::Erubi != ::Erubi
37
+ if defined?(::Erubi) && (::ActionView::Template::Handlers::ERB.const_get('Erubi') != ::Erubi)
39
38
  require "haml/helpers/safe_erubi_template"
40
39
  Haml::Filters::RailsErb.template_class = Haml::SafeErubiTemplate
41
40
  else
@@ -234,7 +234,7 @@ MSG
234
234
  scanner = StringScanner.new(str.dup.force_encoding(Encoding::ASCII_8BIT))
235
235
  bom = scanner.scan(/\xEF\xBB\xBF/n)
236
236
  return bom unless scanner.scan(/-\s*#\s*/n)
237
- if coding = try_parse_haml_emacs_magic_comment(scanner)
237
+ if (coding = try_parse_haml_emacs_magic_comment(scanner))
238
238
  return bom, coding
239
239
  end
240
240
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Haml
4
- VERSION = "5.1.0"
4
+ VERSION = "5.1.1"
5
5
  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: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-05-16 00:00:00.000000000 Z
14
+ date: 2019-05-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: temple
@@ -163,7 +163,13 @@ files:
163
163
  homepage: http://haml.info/
164
164
  licenses:
165
165
  - MIT
166
- metadata: {}
166
+ metadata:
167
+ bug_tracker_uri: https://github.com/haml/haml/issues
168
+ changelog_uri: https://github.com/haml/haml/blob/master/CHANGELOG.md
169
+ documentation_uri: http://haml.info/docs.html
170
+ homepage_uri: http://haml.info
171
+ mailing_list_uri: https://groups.google.com/forum/?fromgroups#!forum/haml
172
+ source_code_uri: https://github.com/haml/haml
167
173
  post_install_message:
168
174
  rdoc_options: []
169
175
  require_paths:
@@ -179,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
185
  - !ruby/object:Gem::Version
180
186
  version: '0'
181
187
  requirements: []
182
- rubygems_version: 3.0.1
188
+ rubygems_version: 3.0.3
183
189
  signing_key:
184
190
  specification_version: 4
185
191
  summary: An elegant, structured (X)HTML/XML templating engine.