Class: Trokko::Scaffolders::Gemfile

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

Overview

Generationg Gemfile according to configurations

Instance Attribute Summary collapse

Instance Method Summary collapse

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_versionObject (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

#thorObject (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

#generateObject



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