
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
faml
Advanced tools
Faster implementation of Haml template language.
Add this line to your application's Gemfile:
gem 'faml'
And then execute:
$ bundle
Or install it yourself as:
$ gem install faml
You can set several options via Faml::Engine.options .
# Render in XHTML format
Faml::Engine.options[:format] = :xhtml
# Disable autoclose
Faml::Engine.options[:autoclose] = []
# Disable auto preserve
Faml::Engine.options[:preserve] = []
Just replace your gem 'haml' with gem 'faml' .
faml is only tested with Rails >= 4.0.
Since middleman has its own renderers, there's no easy way to use faml with middleman currently.
faml provide a tilt interface.
If your framework uses tilt, you can use faml by replacing gem 'haml' with gem 'faml' .
There are several incompatibilities.
See incompatibilities for details generated by spec files.
Hash attributes are only supported to "data" attributes.
With original haml, %span{foo: {bar: 'baz'}} is rendered as <span foo-bar='baz'></span> .
With faml, it's rendered as <span foo='{:bar=>"baz"}'></span> .
Only "data" attributes are converted to hyphenated attributes.
Even with non-Rails project, all string are HTML-escaped.
Only "ugly" mode in original haml is supported.
%div
%div hello
is always rendered as
<div>
<div>hello</div>
</div>
It's equivalent to haml's "ugly" mode.
I won't provide helper methods of Haml::Helpers. If you really need helper methods, please open an issue.
Only preserve helper method is supported by engine option.
You have to set Faml::Engine.options[:extend_helpers] = true to use preserve .
If you find other incompatibility, please report it to me :-p.
I use temple to achieve faster template rendering. It's used by slim template language & engine which is known as fast.
haml_parser template.haml .faml temple template.haml .faml compile template.haml .Although Haml allows arbitrary Ruby hash in the attribute syntax, most attributes are written in hash literal form. All keys are string or symbol literals (i.e., not dynamic values) in typical case.
%div{class: some_helper_method(current_user)}
%a{href: foo_path(@item)}= @item.name
There is an optimization chance if we could know the value is String.
I introduced incompatibility to expand the chance: all attribute values are converted to String by #to_s except for id, class and data .
This will enable us to avoid runtime expensive hash merging and rendering.
The runtime hash merging is implemented by C extension in faml.
Internally, attributes are categolized into three types.
%input{checked: false}%input{checked: helper_method(@record)}%input{helper_method(@record)}git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)FAQs
Unknown package
We found that faml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Googleâs UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.