Class: Gemsmith::Skeletons::CLISkeleton

Inherits:
BaseSkeleton show all
Defined in:
lib/gemsmith/skeletons/cli_skeleton.rb

Overview

Configures Command Line Interface (CLI) support.

Instance Method Summary collapse

Methods inherited from BaseSkeleton

create, #initialize

Constructor Details

This class inherits a constructor from Gemsmith::Skeletons::BaseSkeleton

Instance Method Details

#createObject



9
10
11
12
13
14
# File 'lib/gemsmith/skeletons/cli_skeleton.rb', line 9

def create
  return unless enabled?

  cli.template "%gem_name%/bin/%gem_name%.tt", cli.template_options
  cli.template "%gem_name%/lib/%gem_name%/cli.rb.tt", cli.template_options
end

#enabled?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/gemsmith/skeletons/cli_skeleton.rb', line 5

def enabled?
  cli.template_options.key?(:bin) && cli.template_options[:bin]
end