Class: Makit::Cli::Generators::Templates::Ruby::Rakefile

Inherits:
Object
  • Object
show all
Defined in:
lib/makit/cli/generators/templates/ruby/rakefile.rb

Overview

Template for Ruby gem Rakefile

Instance Method Summary collapse

Constructor Details

#initialize(project_name) ⇒ Rakefile

Returns a new instance of Rakefile.



10
11
12
# File 'lib/makit/cli/generators/templates/ruby/rakefile.rb', line 10

def initialize(project_name)
  @project_name = project_name
end

Instance Method Details

#renderObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/makit/cli/generators/templates/ruby/rakefile.rb', line 14

def render
  <<~RAKEFILE
    # frozen_string_literal: true

    require "bundler/gem_tasks"
    require "rake/testtask"

    Rake::TestTask.new(:test) do |t|
      t.libs << "test"
      t.libs << "lib"
      t.test_files = FileList["test/**/*_test.rb"]
    end

    task default: :test
  RAKEFILE
end