0.01
The project is in a healthy, maintained state
A command line interface for smithing Hanami projects.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.31
~> 2.7
~> 1.0
~> 7.9
~> 3.0
~> 1.13
~> 2.7
~> 11.10
~> 12.10
~> 3.12
~> 0.20
 Project Readme

Hanamismith

Hanamismith is a Command Line Interface (CLI) for smithing Hanami projects. Perfect when you need a professional, configurable, and robust tool for building new project skeletons.

Table of Contents
  • Features
  • Screenshots/Screencasts
  • Requirements
  • Setup
  • Usage
    • Command Line Interface (CLI)
    • Configuration
    • Workflows
    • Aliases
  • Development
  • Tests
  • License
  • Security
  • Code of Conduct
  • Contributions
  • Developer Certificate of Origin
  • Versions
  • Community
  • Credits

Features

  • Built atop Rubysmith for building project skeleton.

  • Uses Hanami for web application development.

  • Uses HTMX for Hypermedia REST so you can write less code and avoid bloated JavaScript stacks.

  • Uses pg coupled with ROM for database management.

  • Uses Rack, specifically: Rack::Attack, Rack::Deflater, and Rack::Static.

  • Uses Puma as the default web server and fully configured for local and production environments.

  • Uses Capybara with Cuprite (driver) for full, headless, feature testing.

  • Uses Dotenv for managing your environment configurations.

  • Provides support for Continuous Integration systems like Circle CI (default) and GitHub Actions.

  • Provides the /up health check endpoint via the Health slice.

  • Configures YJIT so you can deploy with YJIT disabled (i.e. RUBYOPT=--yjit-disable --yjit-exec-mem-size=192) and let the application enable upon boot.

  • Disables IRB console autocomplete when used in production-like environments. You can re-enable IRB autocomplete by setting IRB_USE_AUTOCOMPLETE=true before launching your console in non development or test environments.

Screenshots/Screencasts

Home

The above is a screenshot of a Demo project that was generated locally. For a fully working demonstration application — as built by this gem — check out the Hemo project as shown in this screencast:

Requirements

  1. Ruby.

Setup

To install with security, run:

# 💡 Skip this line if you already have the public certificate installed.
gem cert --add <(curl --compressed --location https://alchemists.io/gems.pem)
gem install hanamismith --trust-policy HighSecurity

To install without security, run:

gem install hanamismith

Usage

Command Line Interface (CLI)

From the command line, type: hanamismith --help

Usage

The core functionality of this gem centers around the build command and associated flags. The build options allow you to further customize the kind of gem you want to build. Most build options are enabled by default. For detailed documentation on all supported flags, see the Rubysmith documentation.

Configuration

This gem can be configured via a global configuration:

$HOME/.config/hanamismith/configuration.yml

It can also be configured via XDG environment variables.

The default configuration is everything provided in the Rubysmith. It is recommended that you provide common URLs for your project which would be all keys found in this section:

project:
  url:
    # Add key/value pairs here.

When these values exist, you’ll benefit from having this information added to your generated project documentation. Otherwise — if these values are empty — they are removed from new project generation entirely.

Workflows

When implementing and testing your project locally, a typical workflow might be:

# Build new project
hanamismith build --name demo

# Run code quality and test coverage checks
cd demo
bin/setup
bin/rake

# Develop (red, green, refactor)
NO_COVERAGE=true retest
git commit  # (repeat until finished with implementation)

# Run: With Overmind (recommended)
overmind start --procfile Procfile.dev

# Run: Without Overmind
bin/hanami server

# Deploy
git push

# Help
bin/hanami --help

Once the server is running you can visit (or ping) the following endpoints:

  • /: The home page.

  • /up: The health status of the application. This will be green (200 OK) when the server is up or red (503 Service Unavailable) when the server is down.

Aliases

For Bash users — or other shell users — you might find these suggested aliases helpful in reducing keystrokes when using this gem:

alias hsb="hanamismith build --name"
alias hse="hanamismith config --edit"
alias hsh="hanamismith --help"

The above is what I use via my Dotfiles project.

Development

To contribute, run:

git clone https://github.com/bkuhlmann/hanamismith
cd hanamismith
bin/setup

You can also use the IRB console for direct access to all objects:

bin/console

Tests

To test, run:

bin/rake

Credits