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