Skip to content
CAI
Software that uses CAICheck a score

haml/haml-rails

63.4

Adequate · 20 September 2026

183

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby gem that integrates the Haml template engine with the Rails framework. It provides generators to create Haml-based views for controllers, mailers, scaffolds, and authentication, replacing default ERB templates. Additionally, it includes tools to batch-convert existing ERB files to Haml and ensures reliable template cache invalidation.

How it got here

2010 — Rails 6-8 compatibility and generator expansion

9 changes.

The project focused on extending haml-rails compatibility to support Rails versions 6 through 8.1, including updates to dependency requirements and template cache handling. Significant work was done to expand generator capabilities, adding support for HAML in controllers, mailers, and scaffolds while ensuring these generated templates align with modern Rails conventions.

2014–2026 — Haml integration and migration tools

5 changes.

This period focused on expanding Haml support within Rails by adding generators and rake tasks to convert existing ERB layouts and views to Haml. It also introduced Haml scaffold templates for Rails 6.0 and authentication views, alongside tests to ensure reliable dependency tracking and caching behavior.

Features

Add HAML conversion rake task with overwrite and cleanup options

A new \haml:erb2haml\ rake task is available to batch-convert \.erb\ views in \app/views\ to \.haml\. The task detects existing \.haml\ files with the same base name and prompts the user to overwrite them, unless the \HAML\_RAILS\_OVERWRITE\_HAML\ environment variable is set to \false\. After conversion, it prompts to delete the original \.erb\ files, unless the \HAML\_RAILS\_DELETE\_ERB\ environment variable is set to \true\.

lib/tasks · high confidence

Add HAML templates for authentication views

Introduces a new HAML-based authentication generator that provides HAML templates for the session (sign-in), password reset request, and password update views, allowing users to generate authentication UI using HAML syntax instead of the default ERB.

lib/generators/haml/authentication · high confidence

Added HAML controller generator

A new generator has been added that allows users to create controllers with HAML view templates instead of the default ERB. This is implemented by extending the existing ERB controller generator and overriding the template handler to use HAML, along with providing the corresponding HAML view template.

lib/generators/haml/controller, lib/generators/haml/mailer · high confidence

Added Haml scaffold templates for Rails 6.0

New Haml view templates (\_form, edit, index, new, show) have been added for the Rails 6.0 scaffold generator. These templates generate Haml syntax for standard CRUD views, including support for password fields, file attachments, and error handling, ensuring that scaffolding produces Haml code compatible with Rails 6.0 conventions.

(repo-wide) · high confidence

Added Rails generator to convert application layout from ERB to Haml

Users can now run \rails g haml:application\_layout convert\ to automatically convert the default \app/views/layouts/application.html.erb\ file into Haml format (\application.html.haml\). The generator invokes the \html2haml\ command-line tool, handles path escaping to support spaces in file paths, and provides clear success or error messages regarding the conversion status and existing files.

lib/rails · high confidence

Haml mailer generator now produces layout and text templates

The Haml mailer generator has been updated to create both HTML and text email templates, including dedicated layout files (layout.html.haml and layout.text.haml) alongside the view templates. This ensures that generated mailers now include proper structural layouts for both MIME types, aligning with standard Rails mailer conventions while using Haml syntax.

lib/generators/haml/mailer/templates · high confidence

Behavioural changes

HAML scaffold generator now produces HAML templates and supports Rails 7 partials

The HAML scaffold generator has been updated to replace the default ERB templates with HAML equivalents, ensuring that generated views (index, edit, show, new, and \_form) are written in HAML syntax. Additionally, the generator now detects the Rails version and conditionally includes a partial template for Rails 7 and above, improving compatibility with newer Rails scaffold structures.

lib/generators/haml/scaffold · high confidence

Rails 6 compatibility and improved template cache digestion

The haml-rails library now supports Rails 6 by explicitly requiring the source annotation extractor and using Gem::Requirement for version checks, while also allowing the gem to be required independently of the Rails engine. For users, this means better compatibility with modern Rails versions and more reliable view template cache digestion, which ensures that Haml partials and renders are correctly tracked for cache invalidation in development and production environments.

lib · high confidence

Updated HAML scaffold templates for Rails 8.1

The HAML scaffold generator now uses templates compatible with Rails 8.1. The default templates have been updated to point to the 8.1 versions, which in turn delegate to the 7.2 implementation. This ensures that newly generated scaffolds (forms, views, and partials) align with the current Rails version's conventions, while older version-specific templates (7.0, 7.1, 8.0) remain available for legacy compatibility.

lib/generators/haml/scaffold/templates · high confidence

Test coverage

Added generator tests for Haml integration; Added test infrastructure for generator integration tests; Added tests for Haml dependency tracking.

Dependencies

Update haml-rails to require Rails 5.1+ and Ruby 2.3+

The haml-rails gem now requires Ruby 2.3 or higher and Rails 5.1 or higher, aligning with the latest supported versions. Dependencies on activesupport, actionpack, and railties are pinned to version 5.1 or above, while the haml dependency is set to 4.0.6 or higher. Development dependencies include html2haml, rails, bundler, and rake. The Gemfile has been updated to conditionally include gems like debug, mutex\_m, base64, bigdecimal, drb, and benchmark based on the Ruby version, ensuring compatibility with newer Ruby environments.

(dependencies) · high confidence

Update haml-rails version to 3.1.0

The library version constant in lib/haml-rails/version.rb has been updated to 3.1.0. This change reflects the current release version of the gem, ensuring that the library reports the correct version number to the application and its dependencies.

lib/haml-rails · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 63.

Lenses

  • Code Health 100
  • Architecture 69
  • Maturity 59
  • Readiness 61
  • Security 100
  • Accessibility 62

Changes since last survey

  • 300 commits — 273 feature/other, 27 fixes

By area

  • (root) — 96 commits
  • (repo) — 73 commits
  • lib/generators — 30 commits
  • .github/workflows — 24 commits
  • test/test_helper.rb — 19 commits
  • lib/haml-rails.rb — 16 commits
  • lib/haml-rails — 14 commits
  • test/lib — 12 commits
  • lib/tasks — 6 commits
  • gemfiles/rails_5_1.gemfile — 3 commits
  • lib/rails — 3 commits
  • lib/.haml-rails.rb.swp — 2 commits
  • gemfiles/rails_4_1.gemfile — 1 commit
  • gemfiles/rails_5_0.gemfile — 1 commit

Notable commits

  • fix: Add regression test for Haml cache dependency detection
  • fix: Added code to remove tmp dir after test suite is completed, fixes bug #79
  • fix: Added code to remove tmp dir after test suite is completed, fixes bug #79
  • fix: FIX bad return
  • fix: Fix "Rails::SourceAnnotationExtractor is not a class/module" in Rails 6
  • fix: Fix CI badge
  • fix: Fix file path on mailer generator
  • fix: Fix misspelling of html in layout.html.haml
  • fix: Fix problen with lost generators and rake tasks
  • fix: Fix version in README
  • fix: Fix warnings with assert_match
  • fix: Fix warnings with assert_match
  • fix: Fix warnings with assert_match
  • fix: Fixed Extra Generated Tabs
  • fix: Merge pull request #103 from serv/bug-space-filepath
  • fix: Merge pull request #146 from somenugget/fix-annotation-error
  • fix: Merge pull request #189 from tagliala/chore/fix-ci-badge
  • fix: Merge pull request #200 from NickSchimek/fix/haml-dependency-tracker-rails-8-1
  • fix: Merge pull request #97 from alanjcfs/layout-html-fix
  • fix: Revert "Add *.swp to ignore list"
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

haml/haml-rails was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit d837c6f09616bbfcd925a31457841c2f649ce37e — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.