0.0
No release in over a year
A simple gem to generate a ruby app
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.10
~> 1.1
~> 2.5
 Project Readme

Description

A simple gem to generate a new ruby application skeleton.

Installation

gem install ruby-app-gen

Simple example

To generate a new ruby application run this:

app-gen generate my-app ~/Work/

This would generate a new ruby application with DB support in ~/Work/my-app.

Features

Zeitwerk used as a code loader

Active Record used as an ORM

SQLite3 used as a default database

Application structure

+- bin
|  +- console
+- db
|  +- config
|     +- database.yml
+- Gemfile
+- lib
|  +- <app-name>
|  |  +- app.rb
|  +- <app-name>.rb
+- Rakefile

bin/console

A bin to run IRB console for the ruby application.

db/config/database.yml

Database config file (only created if --database option was set).

Gemfile

As long as it's using Bundler...

.rb

Declares an application pre-requirements:

  • Initializes APP_ENV and RAKE_ENV environment variables (development by default)

  • Requires gem files

  • Sets up Zeitwerk loader

  • Declares main application module

Rakefile

Contains database-related rake tasks (only created if --database option was set).

For a full list of tasks see:

rake -T

Commands

Generate

Usage:
  app-gen generate APP_NAME PATH

Options:
  [--force]                      # overrides all the application files is exist
  [--database], [--no-database]  # generates DB related files
                                 # Default: true

Help

Commands:
  app-gen generate APP_NAME PATH  # generate a ruby application skeleton
  app-gen help [COMMAND]          # Describe available commands or one specific command