rblade 1.0.1 → 1.0.3
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 +4 -4
- data/.github/workflows/ruby.yml +38 -0
- data/CHANGELOG.md +7 -0
- data/Rakefile +1 -1
- data/lib/rblade/compiler.rb +2 -1
- data/lib/rblade/component_store.rb +0 -2
- data/lib/rblade/helpers/slot_manager.rb +2 -2
- data/rblade.gemspec +2 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17ad9a35983e35fb1f6e34e57372546913afa14ec6c5d1e4fefee0860dc384ab
|
4
|
+
data.tar.gz: 5d58650e854920e85ea6d6d4df78337495afd842388e194f163c8383144b248d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b7c6a166b2d049859f77f2c396b85e874bdd14d68cb587128cae5131f718637034855cadeb7bf6bef191546982b2a565f80b0745d1266c0fbd5abac7b9fa054
|
7
|
+
data.tar.gz: 0c88c2750047aae8885e88e740f40b16c4797f1590fdf96514d63ed2a9f60291d8868376a9ee8a2894ecfc55edb7c1506a7a7e403c5f4a87f2673aa4e9f9f0b7
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ "main" ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ "main" ]
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: read
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
test:
|
21
|
+
|
22
|
+
runs-on: ubuntu-latest
|
23
|
+
strategy:
|
24
|
+
matrix:
|
25
|
+
ruby-version: ['3.2']
|
26
|
+
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v4
|
29
|
+
- name: Set up Ruby
|
30
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
31
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
32
|
+
# uses: ruby/setup-ruby@v1
|
33
|
+
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
|
34
|
+
with:
|
35
|
+
ruby-version: ${{ matrix.ruby-version }}
|
36
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
37
|
+
- name: Run tests
|
38
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 1.0.3 [2024-08-10]
|
2
|
+
- Add GitHub CI
|
3
|
+
- Add support for the Rails `raw` method for outputting unescaped HTML
|
4
|
+
|
5
|
+
## 1.0.2 [2024-08-09]
|
6
|
+
- Fix non-string `@props` defaults being converted to slots
|
7
|
+
|
1
8
|
## 1.0.1 [2024-08-09]
|
2
9
|
- Automatically detect when properties are used as slots
|
3
10
|
- Change `_required` to `required` in @props
|
data/Rakefile
CHANGED
data/lib/rblade/compiler.rb
CHANGED
@@ -7,6 +7,7 @@ require "rblade/compiler/compiles_statements"
|
|
7
7
|
require "rblade/compiler/tokenizes_components"
|
8
8
|
require "rblade/compiler/tokenizes_statements"
|
9
9
|
require "rblade/helpers/html_string"
|
10
|
+
require "active_support/core_ext/string/output_safety"
|
10
11
|
|
11
12
|
Token = Struct.new(:type, :value)
|
12
13
|
|
@@ -21,7 +22,7 @@ module RBlade
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def self.e string
|
24
|
-
if string.is_a?
|
25
|
+
if string.is_a?(HtmlString) || string.is_a?(ActiveSupport::SafeBuffer)
|
25
26
|
string
|
26
27
|
else
|
27
28
|
h(string)
|
@@ -24,9 +24,9 @@ module RBlade
|
|
24
24
|
@content.respond_to?(method_name)
|
25
25
|
end
|
26
26
|
|
27
|
-
# Wraps var in a slot manager
|
27
|
+
# Wraps var in a slot manager if it's a string
|
28
28
|
def self.wrap var
|
29
|
-
var.is_a?(
|
29
|
+
var.is_a?(String) ? new(var) : var
|
30
30
|
end
|
31
31
|
|
32
32
|
attr_reader :attributes
|
data/rblade.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "rblade"
|
3
|
-
s.version = "1.0.
|
3
|
+
s.version = "1.0.3"
|
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"]
|
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|storage)/}) }
|
9
9
|
s.require_paths = ["lib"]
|
10
10
|
s.homepage = "https://rubygems.org/gems/rblade"
|
11
|
+
s.metadata = {"source_code_uri" => "https://github.com/mwnciau/rblade"}
|
11
12
|
s.license = "MIT"
|
12
13
|
s.required_ruby_version = ">= 3.0.0"
|
13
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rblade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon J
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -73,6 +73,7 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".github/workflows/ruby.yml"
|
76
77
|
- ".gitignore"
|
77
78
|
- ".standard.yml"
|
78
79
|
- CHANGELOG.md
|
@@ -122,7 +123,8 @@ files:
|
|
122
123
|
homepage: https://rubygems.org/gems/rblade
|
123
124
|
licenses:
|
124
125
|
- MIT
|
125
|
-
metadata:
|
126
|
+
metadata:
|
127
|
+
source_code_uri: https://github.com/mwnciau/rblade
|
126
128
|
post_install_message:
|
127
129
|
rdoc_options: []
|
128
130
|
require_paths:
|