Gem Version
Alchemists Style Guide
Circle CI Status

Rubysmith is a command line interface for smithing Ruby projects.

This gem is useful in situations in which you need something more sophisticated than a Bundler Inline script but less complicated than a Ruby Gem as provided by Gemsmith.

Features

Requirements

  1. A UNIX-based system.

  2. Ruby.

  3. RubyGems.

  4. Bundler.

Setup

To install, run:

gem install rubysmith

Usage

Command Line Interface (CLI)

From the command line, type: rubysmith --help

USAGE:
  -b, --build NAME [options]               Build new project.
  -v, --version                            Show gem version.
  -h, --help                               Show this message.
  -c, --config ACTION                      Manage gem configuration: edit or view.

BUILD OPTIONS:
  --[no-]amazing_print                 Add Amazing Print.
  --[no-]bundler-audit                 Add Bundler Audit.
  --[no-]bundler-leak                  Add Bundler Leak.
  --[no-]console                       Add console script.
  --[no-]documentation                 Add documentation.
  --[no-]git                           Add Git.
  --[no-]git-lint                      Add Git Lint.
  --[no-]guard                         Add Guard.
  --[no-]pry                           Add Pry.
  --[no-]reek                          Add Reek.
  --[no-]refinements                   Add Refinements.
  --[no-]rspec                         Add RSpec.
  --[no-]rubocop                       Add Rubocop.
  --[no-]ruby_critic                   Add RubyCritic.
  --[no-]setup                         Add setup script.
  --[no-]simple_cov                    Add SimpleCov.
  --min                                Use minimum/no options.

Building

The core functionality of this gem centers around the --build command with optional customization provided via build options. By default, all build options are enabled. Example:

rubysmith --build demo

Running the above will generate a new demo Ruby project with all options enabled. Should you wish to disable specific options, you can use the --no-* prefix. Example:

rubysmith --build demo --no-pry --no-guard

With the above example, both Pry and Guard support would have been disabled when building the demo project. Taking this a step further, you can also use the --min option to generate a project with bare minimum of options. Example:

rubysmith --build demo --min

The above is essentially the same as building with all options disabled. This is handy in situations where you need to quickly script something up for sharing with others yet still want to avoid using a Bundler Inline script so gem dependencies are not installed each time the code is run.

To have specific options enabled/disabled every time you build a new Ruby project, you can edit your global configuration for making these settings permanent (see below for details).

Configuration

This gem can be configured via a global configuration:

$HOME/.config/rubysmith/configuration.yml

It can also be configured via XDG environment variables.

The default configuration is as follows:

:author:
  :name:
  :email:
  :url:
:documentation:
  :format: "md"
  :license: "mit"
:build:
  :amazing_print: true
  :bundler_audit: true
  :bundler_leak: true
  :console: true
  :documentation: true
  :git: true
  :git_lint: true
  :guard: true
  :minimum: false
  :pry: true
  :reek: true
  :refinements: true
  :rspec: true
  :rubocop: true
  :ruby_critic: true
  :setup: true
  :simple_cov: true
:builders:
  :pragmater:
    :comments:
      - "# frozen_string_literal: true"
    :includes:
      - "**/*.rb"
      - "**/*bin/console"
      - "**/*bin/guard"
      - "**/*bin/rubocop"
      - "**/*Gemfile"
      - "**/*Guardfile"
      - "**/*Rakefile"

Feel free to take this default configuration, modify, and save as your own custom configuration.yml.

Development

To contribute, run:

git clone https://github.com/bkuhlmann/rubysmith.git
cd rubysmith
bin/setup

You can also use the IRB console for direct access to all objects:

bin/console

Tests

To test, run:

bundle exec rake

Versioning

Read Semantic Versioning for details. Briefly, it means:

  • Major (X.y.z) - Incremented for any backwards incompatible public API changes.

  • Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.

  • Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.

Code of Conduct

Please note that this project is released with a CODE OF CONDUCT. By participating in this project you agree to abide by its terms.

Contributions

Read CONTRIBUTING for details.

License

Read LICENSE for details.

History

Read CHANGES for details. Built with Gemsmith.

Credits

Engineered by Brooke Kuhlmann.