[Experimental] Code reloading for Hanami
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
spec
.gitignore
.hokuci.yml
.rspec
.rubocop.yml
CHANGELOG.md
Gemfile
LICENSE.md
README.md
Rakefile
hanami-reloader.gemspec

README.md

Hanami::Reloader

Experimental code reloading for Hanami.

Usage

1. Setup Hanami project

gem install hanami
hanami new bookshelf && cd bookshelf

2. Prepare Gemfile

Edit Gemfile

  1. Remove shotgun
  2. Add the following lines
group :plugins do
  gem "hanami-reloader", "~> 0.1"
end

3. Setup hanami-reloader

bundle
bundle exec hanami generate reloader

Now you can start the server via bundle exec hanami server.

Upgrade Nodes

If you're upgrading from v0.1.0 to v0.2.0, use .hanami.server.guardfile instead of Guardfile.

Puma usage

If you're using puma, I strongly suggest to use guard-puma alongside with hanami-reloader.

Add guard-puma to your Gemfile:

group :development do
  gem "guard-puma"
end

Then change the group name in .hanami.server.guardfile from "rack" to "puma":

-guard "rack", port: ENV["HANAMI_PORT"] || 2300 do
+guard "puma", port: ENV["HANAMI_PORT"] || 2300 do

Now start the server as usual: bundle exec hanami server

Development

After checking out the repo, run bin/setup to install dependencies. 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 tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jodosha/hanami-reloader.

Copyright

Copyright © 2017-2018 Luca Guidi – Released under MIT License