streamlined 0.3.1 → 0.4.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: 28c0d44d7cf42201f5c0e9b0b422ddfe9df80ad6f21f2312be0fe33a487b6ddd
4
- data.tar.gz: abb694a7eaa29ca21c6681f4f51590e83f0831fbe1fdf257435bcbe733420a88
3
+ metadata.gz: 05f5b1f3f4076db6a1199096cd1da0c78594161b4fadb12bbd5e8777a7d5993f
4
+ data.tar.gz: 1db72d9247ae8d7d5f1b2c49de47c30c8b7341cc50bac7f434386d9ac8eb5555
5
5
  SHA512:
6
- metadata.gz: 36a0cf9af8a3595d35fb970887ad1ddcfa8ca4a90d052c3f32bc17aee00ab1893365529c20c3f928be87c18cb67fa451fe0f18a1e6540e109681b00849b7f8aa
7
- data.tar.gz: c35f3f75ea443343cc1a4d5c763d4e4be861f8cbdeb95a7b87ddd79818ad1a5929249874684e3953682b5b59b1d6525f2f1a06347cb14146d5114648b08b99fa
6
+ metadata.gz: 6539b91a92c00001129658a57d139f19672ea07be9ea54a38d1fa04dc2579e7d98d40d439d49a9d24d9a9207228733f03fb8756651fcfefa0e34acc2054d5e42
7
+ data.tar.gz: 045c5edea6a3f743461ae9fa0a5918867daeb8b59e7ac643576bb3c624a16ed3a1d5e360e1280c8514514c66eff91e01664757b464298912ba7abbf465a43322
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.4.0] — 2024-04-04
6
+
7
+ - Provide Roda plugin to mix in Streamlined helpers.
8
+
5
9
  ## [0.3.1] - 2023-11-10
6
10
 
7
11
  - Ensure false or nil values for attributes avoid rendering attributes at all
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- streamlined (0.3.1)
4
+ streamlined (0.4.0)
5
5
  serbea (>= 2.1)
6
6
  zeitwerk (~> 2.5)
7
7
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Streamlined
2
2
 
3
- Component rendering for Ruby using streamlined procs & heredocs. Rails and Bridgetown both supported.
3
+ HTML fragment and component rendering for Ruby using streamlined procs & heredocs with safety checks via RuboCop. Bridgetown, Roda, and Rails all supported.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,7 +10,7 @@ Add Streamlined to your application's Gemfile by running:
10
10
  bundle add streamlined
11
11
  ```
12
12
 
13
- (If you're using Bridgetown, it's bundled in for Bridgetown 1.4…coming soon)
13
+ (If you're using Bridgetown, it's bundled in for Bridgetown 2.0…coming soon)
14
14
 
15
15
  ## Usage
16
16
 
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Roda
4
+ module RodaPlugins
5
+ module Streamlined
6
+ module CheckForStreamlined
7
+ def self.===(other)
8
+ other.is_a?(Proc) && other.respond_to?(:touched) && other.touched
9
+ end
10
+ end
11
+
12
+ module InstanceMethods
13
+ include ::Streamlined::Helpers
14
+ end
15
+
16
+ def self.load_dependencies(app, _opts = OPTS)
17
+ app.plugin :custom_block_results
18
+ end
19
+
20
+ def self.configure(app, _opts = OPTS)
21
+ app.handle_block_result CheckForStreamlined, &:to_s
22
+ end
23
+ end
24
+
25
+ register_plugin :streamlined, Streamlined
26
+ end
27
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Streamlined
4
- VERSION = "0.3.1"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/streamlined.rb CHANGED
@@ -4,6 +4,7 @@ require "serbea/helpers" # primarily just for HTML safety polyfill
4
4
  require "serbea/pipeline"
5
5
  require "zeitwerk"
6
6
  loader = Zeitwerk::Loader.for_gem
7
+ loader.ignore("#{__dir__}/roda")
7
8
  loader.setup
8
9
 
9
10
  module Streamlined
@@ -11,6 +12,9 @@ module Streamlined
11
12
  end
12
13
 
13
14
  if defined?(Bridgetown)
14
- Bridgetown.initializer :streamlined do # |config|
15
+ Bridgetown.initializer :streamlined do |config|
16
+ config.roda do |app|
17
+ app.plugin :streamlined
18
+ end
15
19
  end
16
20
  end
data/streamlined.gemspec CHANGED
@@ -8,10 +8,10 @@ Gem::Specification.new do |spec|
8
8
  spec.author = "Bridgetown Team"
9
9
  spec.email = "maintainers@bridgetownrb.com"
10
10
 
11
- spec.summary = "Component rendering for Ruby using streamlined procs & heredocs."
11
+ spec.summary = "HTML fragment & component rendering for Ruby using streamlined procs & heredocs."
12
12
  spec.homepage = "https://github.com/bridgetownrb/streamlined"
13
13
  spec.license = "MIT"
14
- spec.required_ruby_version = ">= 3.0"
14
+ spec.required_ruby_version = ">= 3.1"
15
15
  spec.metadata["rubygems_mfa_required"] = "true"
16
16
 
17
17
  # Specify which files should be added to the gem when it is released.
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.3.1
4
+ version: 0.4.0
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-11 00:00:00.000000000 Z
11
+ date: 2024-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serbea
@@ -57,6 +57,7 @@ files:
57
57
  - bin/rake
58
58
  - bin/rubocop
59
59
  - bin/setup
60
+ - lib/roda/plugins/streamlined.rb
60
61
  - lib/streamlined.rb
61
62
  - lib/streamlined/helpers.rb
62
63
  - lib/streamlined/renderable.rb
@@ -75,7 +76,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
76
  requirements:
76
77
  - - ">="
77
78
  - !ruby/object:Gem::Version
78
- version: '3.0'
79
+ version: '3.1'
79
80
  required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  requirements:
81
82
  - - ">="
@@ -85,5 +86,5 @@ requirements: []
85
86
  rubygems_version: 3.3.3
86
87
  signing_key:
87
88
  specification_version: 4
88
- summary: Component rendering for Ruby using streamlined procs & heredocs.
89
+ summary: HTML fragment & component rendering for Ruby using streamlined procs & heredocs.
89
90
  test_files: []