Class: Gemsmith::Skeletons::RspecSkeleton

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

Overview

Configures RSpec 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
15
16
17
18
19
# File 'lib/gemsmith/skeletons/rspec_skeleton.rb', line 9

def create
  return unless enabled?

  cli.template "%gem_name%/lib/%gem_name%/tasks/rspec.rake.tt", cli.template_options
  cli.template "#{rspec_root}/spec_helper.rb.tt", cli.template_options
  cli.template "#{rspec_root}/lib/%gem_name%/%gem_name%_spec.rb.tt", cli.template_options
  cli.template "#{rspec_root}/support/kit/default_config.rb.tt", cli.template_options
  cli.template "#{rspec_root}/support/kit/stderr.rb.tt", cli.template_options
  cli.template "#{rspec_root}/support/kit/stdout.rb.tt", cli.template_options
  cli.template "#{rspec_root}/support/kit/temp_dir.rb.tt", cli.template_options
end

#enabled?Boolean

Returns:

  • (Boolean)


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

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