Class: Trokko::Scaffolders::Entrypoint

Inherits:
Object
  • Object
show all
Defined in:
lib/trokko/scaffolders/entrypoint.rb

Overview

Generating entrypoint.sh file according to configurations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(thor:) ⇒ Entrypoint

Returns a new instance of Entrypoint.



9
10
11
# File 'lib/trokko/scaffolders/entrypoint.rb', line 9

def initialize(thor:)
  @thor = thor
end

Instance Attribute Details

#thorObject (readonly)

Returns the value of attribute thor.



7
8
9
# File 'lib/trokko/scaffolders/entrypoint.rb', line 7

def thor
  @thor
end

Instance Method Details

#generateObject



13
14
15
16
17
18
19
20
# File 'lib/trokko/scaffolders/entrypoint.rb', line 13

def generate
  thor.template(
    'templates/entrypoint.sh.erb',
    "#{thor.name}/entrypoint.sh",
    force: true,
    context: binding
  )
end