herb 0.1.0 → 0.1.1
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/README.md +8 -4
- data/ext/herb/nodes.c +1 -1
- data/herb.gemspec +1 -1
- data/lib/herb/cli.rb +3 -2
- data/lib/herb/token.rb +1 -1
- data/lib/herb/version.rb +1 -1
- data/src/include/version.h +1 -1
- data/src/main.c +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65973631dd5b45bb927fb6a60a84eb46f649054c07f14883ead07975a28c0de0
|
4
|
+
data.tar.gz: e01a0da35101184f8c38ab4fbf38d1d0fc9c54fe2ce690a462bacca2e86c207d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d17d15332dd4b2fe81cf9a0c209efbc14ed94988e033221ec8be9c9c51e744cac0efd2bdb8d1187dca8cc555f03d5892dc7194a0765cff7fee7031226314b60c
|
7
|
+
data.tar.gz: 2a662061b9127b5976593d7a19fc1b255ed693abaeaa5b567a8273d33589941bc97a264d7d52045496f2372af9b37e0a36862394c86787a30bb0b26ff6fbf1e7
|
data/README.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
|
1
|
+
<div align="center">
|
2
|
+
<img alt="Herb HTML+ERB parser" height="256px" src="https://github.com/user-attachments/assets/d0714ee1-ca33-4aa4-aaa9-d632ba79d54a">
|
3
|
+
</div>
|
2
4
|
|
3
|
-
|
5
|
+
<h2 align="center">Herb</h2>
|
4
6
|
|
5
|
-
|
7
|
+
<h4 align="center">HTML + ERB (HTML Embedded Ruby)</h4>
|
8
|
+
|
9
|
+
<div align="center">Powerful and seamless HTML-aware ERB parsing and tooling.</div>
|
6
10
|
|
7
11
|
## Contributing
|
8
12
|
|
@@ -71,7 +75,7 @@ The `herb` executable exposes a few commands for interacting with `.html.erb` fi
|
|
71
75
|
❯ ./herb
|
72
76
|
./herb [command] [options]
|
73
77
|
|
74
|
-
Herb 🌿 Powerful and seamless HTML-aware ERB parsing.
|
78
|
+
Herb 🌿 Powerful and seamless HTML-aware ERB parsing and tooling.
|
75
79
|
|
76
80
|
./herb lex [file] - Lex a file
|
77
81
|
./herb lex_json [file] - Lex a file and return the result as json.
|
data/ext/herb/nodes.c
CHANGED
@@ -415,7 +415,7 @@ static VALUE rb_erb_content_node_from_c_struct(AST_ERB_CONTENT_NODE_T* erb_conte
|
|
415
415
|
VALUE erb_content_node_tag_opening = rb_token_from_c_struct(erb_content_node->tag_opening);
|
416
416
|
VALUE erb_content_node_content = rb_token_from_c_struct(erb_content_node->content);
|
417
417
|
VALUE erb_content_node_tag_closing = rb_token_from_c_struct(erb_content_node->tag_closing);
|
418
|
-
/* #<Herb::Template::AnalyzedRubyField:
|
418
|
+
/* #<Herb::Template::AnalyzedRubyField:0x00007ffffed7b760 @name="analyzed_ruby", @options={kind: nil}> */
|
419
419
|
VALUE erb_content_node_analyzed_ruby = Qnil;
|
420
420
|
VALUE erb_content_node_parsed = (erb_content_node->parsed) ? Qtrue : Qfalse;
|
421
421
|
VALUE erb_content_node_valid = (erb_content_node->valid) ? Qtrue : Qfalse;
|
data/herb.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.authors = ["Marco Roth"]
|
13
13
|
spec.email = ["marco.roth@intergga.ch"]
|
14
14
|
|
15
|
-
spec.summary = "Powerful and seamless HTML-aware ERB parsing."
|
15
|
+
spec.summary = "Powerful and seamless HTML-aware ERB parsing and tooling."
|
16
16
|
spec.description = spec.summary
|
17
17
|
spec.homepage = "https://herb-tools.dev"
|
18
18
|
spec.license = "MIT"
|
data/lib/herb/cli.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "optparse"
|
4
|
-
require "lz_string"
|
5
4
|
|
6
5
|
class Herb::CLI
|
7
6
|
attr_accessor :json, :silent
|
@@ -76,7 +75,7 @@ class Herb::CLI
|
|
76
75
|
▐▛▀▜▌▐▛▀▀▘▐▛▀▚▖▐▛▀▚▖
|
77
76
|
▐▌ ▐▌▐▙▄▄▖▐▌ ▐▌▐▙▄▞▘
|
78
77
|
|
79
|
-
Herb 🌿 Powerful and seamless HTML-aware ERB parsing.
|
78
|
+
Herb 🌿 Powerful and seamless HTML-aware ERB parsing and tooling.
|
80
79
|
|
81
80
|
Usage:
|
82
81
|
bundle exec herb [command] [options]
|
@@ -117,6 +116,8 @@ class Herb::CLI
|
|
117
116
|
puts Herb.extract_html(file_content)
|
118
117
|
exit(0)
|
119
118
|
when "playground"
|
119
|
+
require "lz_string"
|
120
|
+
|
120
121
|
if Dir.pwd.include?("/herb")
|
121
122
|
system(%(npx concurrently "nx dev playground" "sleep 1 && open http://localhost:5173##{LZString::UriSafe.compress(file_content)}"))
|
122
123
|
exit(0)
|
data/lib/herb/token.rb
CHANGED
data/lib/herb/version.rb
CHANGED
data/src/include/version.h
CHANGED
data/src/main.c
CHANGED
@@ -36,7 +36,7 @@ int main(const int argc, char* argv[]) {
|
|
36
36
|
if (argc < 2) {
|
37
37
|
printf("./herb [command] [options]\n\n");
|
38
38
|
|
39
|
-
printf("Herb 🌿 Powerful and seamless HTML-aware ERB parsing.\n\n");
|
39
|
+
printf("Herb 🌿 Powerful and seamless HTML-aware ERB parsing and tooling.\n\n");
|
40
40
|
|
41
41
|
printf("./herb lex [file] - Lex a file\n");
|
42
42
|
printf("./herb lex_json [file] - Lex a file and return the result as json.\n");
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: herb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Roth
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-04-
|
10
|
+
date: 2025-04-20 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
|
-
description: Powerful and seamless HTML-aware ERB parsing.
|
12
|
+
description: Powerful and seamless HTML-aware ERB parsing and tooling.
|
13
13
|
email:
|
14
14
|
- marco.roth@intergga.ch
|
15
15
|
executables:
|
@@ -148,5 +148,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
requirements: []
|
149
149
|
rubygems_version: 3.6.2
|
150
150
|
specification_version: 4
|
151
|
-
summary: Powerful and seamless HTML-aware ERB parsing.
|
151
|
+
summary: Powerful and seamless HTML-aware ERB parsing and tooling.
|
152
152
|
test_files: []
|