Getting Started

Installation

AppArchetype can be used as a CLI utility installed into your system, or as an in project component renderer.

CLI Utility Installation

Install the app_archetype gem from RubyGems thus:

gem install 'app_archetype'

Once installed, you’ll need to create a template directory. It is inside this directory that any templates will be saved. It is recommended that your template folder is version controlled so that you can track changes to your templates over time.

mkdir $HOME/Code/templates
cd $HOME/Code/templates && git init

Then, set the ARCHETYPE_TEMPLATE_DIR to the previously created template directory. This will enable AppArchetype to find templates within your set.

# zshrc
echo '# App Archetype:' >> $HOME/.zshrc
echo 'export ARCHETYPE_TEMPLATE_DIR="$HOME/Code/templates"' >> $HOME/.zshrc

# bashrc
echo '# App Archetype:' >> $HOME/.bashrc
echo 'export ARCHETYPE_TEMPLATE_DIR="$HOME/Code/templates"' >> $HOME/.bashrc

Finally you’ll need to set a editor environment variable for viewing files from app archetype:

# zshrc
echo 'export ARCHETYPE_EDITOR="vi"' >> $HOME/.zshrc # sets vim as default editor

# bashrc
echo 'export ARCHETYPE_EDITOR="vi"' >> $HOME/.bashrc # sets vim as default editor

This will permit the archetype open command to function with your preferred text editor.

Ruby project installation

AppArchetype can also function as a code project component renderer for Ruby projects. To install into your app, add the following to your gemfile:

gem 'app_archetype'

And then update your bundle:

bundle install