Skip to content
Boilerplate creates a project with configured structure.
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.bprc.example
README.md
bp

README.md

Boilerplate

Boilerplate creates a project with configured structure.

Install

  1. You should have gem colorize installed:
gem install colorize
  1. Setup your .bprc file in your home directory. You can take a ready sample file for this:
cp .bprc.example .bprc
mv .bprc ~/

.bprc settings file is basically a YAML file. Let's see an example contents of it:

ruby:
  directories:
    - lib
  files:
    - lib/{PROJECT_NAME}.rb
    - main.rb
  snippets:
    lib/{PROJECT_NAME}.rb: >
      class _
        def initialize; end
      end
    main.rb: >
      # require_relative 'lib/'
  commands:
    - echo 'Done!'
  git: false

html:
  directories:
    - img
    - css
  files:
    - index.html
    - css/main.css
  git: false
  • Root nodes ruby and html are considered languages which can be used to initialize a boilerplate.

  • Each language has 4 supported sections:

    • directories - stands for directories to be created
    • files - stands for files to be created
    • snippets - stands for snippets that are going to be written into given files
    • commands - stands for executed shell commands
    • git - whether or not a Git repository will be initialized

    Directory and file names also support template variables. For now it's just one variable - {PROJECT_NAME}.

  1. Run bp command like this:
bp project_name --language [ --git | --no-git ]
  • --language should be one of your .bprc languages. So let's say you have ruby, then you should run bp like this:

    bp ruby_project --ruby
  • --git options initializes a Git repository in a project's folder.

    • --no-git makes the opposite of --git.

    This option overrides your .bprc settings, keep that in mind.

You can’t perform that action at this time.