streamlined 0.2.0 → 0.3.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: f9f935f1b1697ca3f91e7f88e06dddc00e11a1ce3a511410eb727709657a9291
4
- data.tar.gz: f4557e6da0e100db9fa2e6c8467c61ead04bc688b3153938fcea420b851cb086
3
+ metadata.gz: 28c0d44d7cf42201f5c0e9b0b422ddfe9df80ad6f21f2312be0fe33a487b6ddd
4
+ data.tar.gz: abb694a7eaa29ca21c6681f4f51590e83f0831fbe1fdf257435bcbe733420a88
5
5
  SHA512:
6
- metadata.gz: 006a5720f453344b5c83c1a1db4a08346b7574b3f3266920c5fd5ce001203b69824d60edca04e2beb7e4dd86230e1ce92f54a7bf0fd84726a48f8bcd7505ea6c
7
- data.tar.gz: e6fac9d8eea670a6cc2f84476a1a05d0279c369ab6deaecaca56fe99116b3b7dc9d73671efa753524ac93dcafd2dac5302e1737ec746353da86d13bf145e6b91
6
+ metadata.gz: 36a0cf9af8a3595d35fb970887ad1ddcfa8ca4a90d052c3f32bc17aee00ab1893365529c20c3f928be87c18cb67fa451fe0f18a1e6540e109681b00849b7f8aa
7
+ data.tar.gz: c35f3f75ea443343cc1a4d5c763d4e4be861f8cbdeb95a7b87ddd79818ad1a5929249874684e3953682b5b59b1d6525f2f1a06347cb14146d5114648b08b99fa
data/.rubocop.yml CHANGED
@@ -7,7 +7,7 @@ inherit_gem:
7
7
  rubocop-bridgetown: .rubocop.yml
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 3.0
10
+ TargetRubyVersion: 3.1
11
11
  NewCops: enable
12
12
 
13
13
  Exclude:
@@ -45,6 +45,9 @@ Metrics/MethodLength:
45
45
  Exclude:
46
46
  - test/**/*.rb
47
47
 
48
+ Naming/BlockForwarding:
49
+ Enabled: false
50
+
48
51
  # Disabled to aid in template readability
49
52
  Style/NestedParenthesizedCalls:
50
53
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.3.1] - 2023-11-10
6
+
7
+ - Ensure false or nil values for attributes avoid rendering attributes at all
8
+
9
+ ## [0.3.0] - 2023-11-07
10
+
11
+ - Fix escaping bug due to bad test
12
+
5
13
  ## [0.2.0] - 2023-11-07
6
14
 
7
15
  - Back out of more complicated `render_in` mechanics
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- streamlined (0.2.0)
4
+ streamlined (0.3.1)
5
5
  serbea (>= 2.1)
6
6
  zeitwerk (~> 2.5)
7
7
 
@@ -81,7 +81,7 @@ GEM
81
81
  unicode-display_width (>= 2.4.0, < 3.0)
82
82
  rubocop-ast (1.30.0)
83
83
  parser (>= 3.2.1.0)
84
- rubocop-bridgetown (0.4.0)
84
+ rubocop-bridgetown (0.4.1)
85
85
  rubocop (~> 1.23)
86
86
  rubocop-performance (~> 1.12)
87
87
  rubocop-minitest (0.20.1)
@@ -44,10 +44,12 @@ module Streamlined
44
44
  # @param prefix_space [Boolean] add a starting space if attributes are present,
45
45
  # useful in tag builders
46
46
  # @return [String]
47
- def html_attributes(options = nil, prefix_space: false, **kwargs)
47
+ def html_attributes(options = nil, prefix_space: false, **kwargs) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
48
48
  options ||= kwargs
49
49
  segments = []
50
50
  options.each do |attr, option|
51
+ next if option == false || option.nil?
52
+
51
53
  attr = dashed(attr)
52
54
  if option.is_a?(Hash)
53
55
  option = option.transform_keys { |key| "#{attr}-#{dashed(key)}" }
@@ -81,7 +83,7 @@ module Streamlined
81
83
  end
82
84
 
83
85
  def text(callback)
84
- (callback.is_a?(Proc) ? html(callback) : callback).to_s.then do |str|
86
+ (callback.is_a?(Proc) ? callback.pipe : callback).to_s.then do |str|
85
87
  next str if str.html_safe?
86
88
 
87
89
  str.encode(xml: :attr).gsub(%r{\A"|"\Z}, "")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Streamlined
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: streamlined
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2023-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serbea