Class: Trokko::Scaffolders::Dockerfile
- Inherits:
-
Object
- Object
- Trokko::Scaffolders::Dockerfile
- Defined in:
- lib/trokko/scaffolders/dockerfile.rb
Overview
Generating Dockerfile according to configurations
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#ruby_version ⇒ Object
readonly
Returns the value of attribute ruby_version.
-
#thor ⇒ Object
readonly
Returns the value of attribute thor.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(ruby_version:, db:, thor:) ⇒ Dockerfile
constructor
A new instance of Dockerfile.
Constructor Details
#initialize(ruby_version:, db:, thor:) ⇒ Dockerfile
Returns a new instance of Dockerfile.
9 10 11 12 13 |
# File 'lib/trokko/scaffolders/dockerfile.rb', line 9 def initialize(ruby_version:, db:, thor:) @ruby_version = ruby_version @db = db @thor = thor end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
7 8 9 |
# File 'lib/trokko/scaffolders/dockerfile.rb', line 7 def db @db end |
#ruby_version ⇒ Object (readonly)
Returns the value of attribute ruby_version.
7 8 9 |
# File 'lib/trokko/scaffolders/dockerfile.rb', line 7 def ruby_version @ruby_version end |
#thor ⇒ Object (readonly)
Returns the value of attribute thor.
7 8 9 |
# File 'lib/trokko/scaffolders/dockerfile.rb', line 7 def thor @thor end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/trokko/scaffolders/dockerfile.rb', line 15 def generate thor.template( 'templates/Dockerfile.erb', "#{thor.name}/Dockerfile", force: true, context: binding ) end |