Class: MKBrut::Segments::Demo

Inherits:
Base
  • Object
show all
Defined in:
lib/mkbrut/segments/demo.rb

Overview

Additional classes and configuration for a new Brut app that provides a more demonstration of the features.

Constant Summary

Constants included from MKBrut

VERSION

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#create!

Constructor Details

#initialize(app_options:, current_dir:, templates_dir:) ⇒ Demo

Returns a new instance of Demo.



7
8
9
10
11
# File 'lib/mkbrut/segments/demo.rb', line 7

def initialize(app_options:, current_dir:, templates_dir:)
  @project_root  = current_dir / app_options.app_name
  @templates_dir = templates_dir / "segments" / "Demo"
  @erb_binding   = ErbBindingDelegate.new(app_options)
end

Class Method Details

.friendly_nameObject



5
# File 'lib/mkbrut/segments/demo.rb', line 5

def self.friendly_name = "Demo features and files"

Instance Method Details

#add!Object



13
14
15
16
17
18
19
20
# File 'lib/mkbrut/segments/demo.rb', line 13

def add!
  operations = copy_files(@templates_dir, @project_root) + 
               other_operations(@project_root)

  operations.each do |operation|
    operation.call
  end
end