rblade 2.0.1 → 2.0.2

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: 5b9e312234e0d768294bf551d6b25f78799140484ab8d48ec5ef2f44114665ca
4
- data.tar.gz: 86d2bc460163f6e3dd15bd67856b73d2e75c61f6da1725d14bdc6e6342b83304
3
+ metadata.gz: fb23406b9206cc5eb7d20f10d700375c1b49c588c2805ae77710aff217ab39f1
4
+ data.tar.gz: '0330179c0e5113c74d0678c54fa08a489820f0d72ea21eb179caa372c7e54a42'
5
5
  SHA512:
6
- metadata.gz: 9df38b9f1bfdceaba790fd422c0a3bd84d687616723f8907ef19a1631f9d241444830090480790d402d929f52edd9274ea6169ddad6119ae4cee570a8a16776b
7
- data.tar.gz: fd351ab727e76e5ee20bccd7b8335966c9ca26f2bcb7fe60a26be5f618b1e12cbfb5588d0904113e05bed677c5abfa6dee70f7775610c0b6e30c9956783fc008
6
+ metadata.gz: c592ebfb01c89d56e996c1e0c7815e50ab2363a2d9badb41a8573067b230796807392789418b81593eecbacfa1160b34843ba6bce102f600acd5ea08ca9a2521
7
+ data.tar.gz: dcb59ca067167dbbe63a4ea86b2fce0d04e25beb4fe728826abc1e19f33613a6d3a472a36896f55bbc0c97979d1c265fa4be8b20e8c0ec62569218099bb62d1a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.0.2 [2025-03-10]
2
+ - Fix issue with empty component attributes
3
+
1
4
  ## 2.0.1 [2025-03-10]
2
5
  - Fix broken gem build
3
6
 
@@ -86,13 +86,15 @@ module RBlade
86
86
  end
87
87
 
88
88
  def process_string_attribute(string)
89
- string.split(/((?<!@)\{\{.*?\}\})/).map do |substring|
89
+ result = string.split(/((?<!@)\{\{.*?\}\})/).map do |substring|
90
90
  if substring.start_with?("{{") && substring.end_with?("}}")
91
91
  "(#{substring[2..-3]}).to_s"
92
- else
92
+ elsif !substring.empty?
93
93
  "'#{RBlade.escape_quotes(substring.gsub(/@\{\{/, "{{"))}'"
94
94
  end
95
- end.join("<<").prepend("+")
95
+ end.compact.join("<<")
96
+
97
+ result.empty? ? "+''" : result.prepend("+")
96
98
  end
97
99
  end
98
100
  end
data/rblade.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rblade"
3
- s.version = "2.0.1"
3
+ s.version = "2.0.2"
4
4
  s.summary = "A component-first templating engine for Rails"
5
5
  s.description = "RBlade is a simple, yet powerful templating engine for Ruby on Rails, inspired by Laravel Blade."
6
6
  s.authors = ["Simon J"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rblade
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon J