Daiku

Craft lightweight ruby applications

Japanese Carpentry

Installation

$ gem install daiku

Updating daiku

$ gem update daiku

Usage

To generate a basic app, run the new command, passing it the port your local server should listen to incoming requests on. The generated app is whole and complete, and ready to run.

$ daiku new myapp --port 5000
$ cd myapp
$ bundle install
$ bundle exec foreman start
$ open http://localhost:5000

Or as a oneliner:

daiku new myapp --port 5000 && cd myapp && bundle install && bundle exec foreman start

Then visit http://localhost:5000 in your browser.

Options

You can further customize the app that's generated by passing additional options. The built-in help system explains the available options.

$ daiku help new
Usage:
  daiku new APP -p, --port=N

Options:
  -p, --port=N               # Port this app should run on locally.
      [--ruby=RUBY]          # Specify the version of ruby this project should use.
                            # Default: 2.1.5
      [--node=NODE]          # Specify the version of node this project should use (for grunt, etc).
                            # Default: v0.10.33
  -a, [--assets=ASSETS]      # Choose the assets workflow this project uses.
                            # Possible values: grunt
  -e, [--errors=ERRORS]      # Choose the error reporting lib this project uses.
                            # Possible values: honeybadger
  -j, [--jobs=JOBS]          # Choose the background jobs lib this project uses.
                            # Possible values: sidekiq
  -m, [--models=MODELS]      # Choose the data modeling lib this project uses.
                            # Possible values: datamapper, sequel
  -M, [--monitors=MONITORS]  # Choose the monitoring lib this project uses.
                            # Possible values: newrelic
      [--vcr]                # Include `vcr` in this project's BDD stack?
      [--sql]                # SQL or No-SQL? If SQL, assumes postgresql
                            # Default: true
      [--version]

Generate a new application with daiku

Example

Consider the following example:

$ daiku new myapp --port 5000 --models datamapper --assets grunt --errors honeybadger --monitors newrelic --jobs sidekiq --vcr

This will generate the following app:

myapp