html_slice 0.2.4 → 0.2.5

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: 47ec58956a24443617b6ec8ace88ef81b7bcbe835bef1708995b824f8080645c
4
- data.tar.gz: ee26639d56eb776d55ab9284833ff92fe681383c410a6e5f0c7d7c8cf8cc2af7
3
+ metadata.gz: 15e5d2ae2bdf50596a619f5fd7a4252146b749ee9c51606741c96cfc49bab2d0
4
+ data.tar.gz: ed9d95769f41c8cfc8193ae6c21cfcd02619bb67c54170757e7a5e7ed8f2ea23
5
5
  SHA512:
6
- metadata.gz: aa31246b60c626d96704dcc4bc358dafbeef40a9e68f6b59afad184bc7127f13be3e5f9dd17b0daa7b999d95147aa19a238e864ff710ebc7b5f14d686deb763a
7
- data.tar.gz: 653305df476ebde0cf5e370eb0fb43a8b4e8e329dcf1319a8271d7c1f4edc8fecb04630ee6b676851a5d113ed55ea774ba8fbddc75cb605f9582eb18ef34bb95
6
+ metadata.gz: ab59522b9c479992f00386c9b93a77ffd7322e89a9a91f2a9faa2a4ec0c5fd30705e513b13f65b51de6d023f6a0631d6c03cb2165e9d50de51dd15f56d19cb84
7
+ data.tar.gz: 57a60eefdf900156c4e34c15557e2468f26c3482644669200aee1ebda6a0dcf26cb59437a8a647ea40db70bd352ffe611327347fd62ab25fe68f3c85916fa5bc
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HtmlSlice
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
data/lib/html_slice.rb CHANGED
@@ -23,6 +23,16 @@ module HtmlSlice
23
23
  DEFAULT_SLICE = :default
24
24
  ATTRIBUTE_CACHE = {}
25
25
 
26
+ def self.slice(slice_id = DEFAULT_SLICE, wrap: ["", ""], &block)
27
+ @class ||= Class.new { include HtmlSlice }.new
28
+ @class.html_slice(slice_id, wrap: wrap, &block)
29
+ end
30
+
31
+ def self.layout(slice_id = DEFAULT_SLICE, &block)
32
+ @class ||= Class.new { include HtmlSlice }.new
33
+ @class.html_layout(slice_id, &block)
34
+ end
35
+
26
36
  def html_layout(slice_id = DEFAULT_SLICE, &block)
27
37
  html_slice(slice_id, wrap: ["<!DOCTYPE html><html>", "</html>"], &block)
28
38
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html_slice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - henrique-ft
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 2025-12-21 00:00:00.000000000 Z
11
+ date: 2026-04-13 00:00:00.000000000 Z
11
12
  dependencies: []
12
13
  description: Enable Ruby classes the ability to generate reusable pieces of html
13
14
  email:
@@ -18,10 +19,12 @@ extra_rdoc_files: []
18
19
  files:
19
20
  - lib/html_slice.rb
20
21
  - lib/html_slice/version.rb
22
+ homepage:
21
23
  licenses: []
22
24
  metadata:
23
25
  source_code_uri: https://github.com/henrique-ft/html_slice
24
26
  changelog_uri: https://github.com/henrique-ft/html_slice/blob/master/CHANGELOG.md
27
+ post_install_message:
25
28
  rdoc_options: []
26
29
  require_paths:
27
30
  - lib
@@ -36,7 +39,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
36
39
  - !ruby/object:Gem::Version
37
40
  version: '0'
38
41
  requirements: []
39
- rubygems_version: 3.6.6
42
+ rubygems_version: 3.3.3
43
+ signing_key:
40
44
  specification_version: 4
41
45
  summary: Enable Ruby classes the ability to generate reusable pieces of html
42
46
  test_files: []