Bard::Rails
bard-rails is a meta gem that only requires other gems that are in use in all of BARD's Rails projects:
- bard: CLI tool for deployment and etc
- bard-rake: rake tasks for testing and db management
- bard-static: zero-conf static pages and mockups
- bard-exception_notification: exception emails from web requests, jobs, and rake tasks, plus
rake exception_notification:test - bard-staging_banner: visual page annotation for staging environment, including links to view "sent" emails
- bard-file_field: a modern replacement for
- slim-rails: our preferred templating language
- labelled_form: some nice label shortcuts for the Rails form builder
- rack-disable_css_animations: automatically remove CSS animations in the test environment, for more reliable tests
Choosing how to restart Puma on deploy
A phased restart (USR1) has no user impact, but it keeps the Puma master, so it can't pick up a new Ruby, a new Puma, a changed config/puma.rb, or a new version of any gem the master loaded. To let the master record what it booted with, add this to config/puma.rb:
extra_runtime_dependencies ["bard-rails"]
plugin :bard_railsThen ask which restart the deploy needs:
require "bard/rails/puma_manifest"
case Bard::RailsGem::PumaManifest.restart_kind
when :full then sh "systemctl --user restart app.target" # new Ruby, or no manifest yet
when :hot then sh "bin/server restart" # the master holds something that changed
when :phased then sh "systemctl --user reload app.target"
endInstallation
Add this line to your application's Gemfile:
gem 'bard-rails'Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bard-rails.
License
The gem is available as open source under the terms of the MIT License.