https://github.com/winebarrel/minierb
Single binary ERB template processor built with mruby.
https://github.com/winebarrel/minierb
cli erb mruby ruby template
Last synced: 5 months ago
JSON representation
Single binary ERB template processor built with mruby.
- Host: GitHub
- URL: https://github.com/winebarrel/minierb
- Owner: winebarrel
- License: mit
- Archived: true
- Created: 2024-01-28T04:36:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T03:55:34.000Z (about 2 years ago)
- Last Synced: 2025-01-29T07:32:24.710Z (about 1 year ago)
- Topics: cli, erb, mruby, ruby, template
- Language: Ruby
- Homepage:
- Size: 42 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minierb
[](https://github.com/winebarrel/minierb/actions/workflows/ci.yml)
Single binary ERB template processor built with mruby.
## Installation
Download binary from [releases page](https://github.com/winebarrel/minierb/releases/latest).
```sh
$ wget https://github.com/winebarrel/minierb/releases/download/vX.X.X/minierb-XXX-XX.gz
$ gunzip minierb-XXX-XXX.gz
$ mv minierb-XXX-XXX minierb
$ chmod +x minierb
```
## Usage
```sh
$ echo '<%= 1 + 2 %>' | minierb
3
```
```erb
<%-
to = ENV["MAIL_TO"]
priorities = ENV["PRIORITIES"].split(",").map(&:strip)
-%>
From: James
To: <%= to %>
Subject: Addressing Needs
<%= to[/\w+/] %>:
Just wanted to send a quick note assuring that your needs are being
addressed.
I want you to know that my team will keep working on the issues,
especially:
<%# ignore numerous minor requests -- focus on priorities %>
<%- priorities.each do |priority| -%>
* <%= priority %>
<%- end -%>
Thanks for your patience.
James
```
```sh
$ export MAIL_TO="Community Spokesman "
$ export PRIORITIES="Run Ruby Quiz,Document Modules,Answer Questions on Ruby Talk"
$ minierb mail.erb
From: James
To: Community Spokesman
Subject: Addressing Needs
Community:
Just wanted to send a quick note assuring that your needs are being
addressed.
I want you to know that my team will keep working on the issues,
especially:
* Run Ruby Quiz
* Document Modules
* Answer Questions on Ruby Talk
Thanks for your patience.
James
```