Class: Rubysmith::Builders::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysmith/builders/version.rb

Overview

Builds project skeleton Ruby version file.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, builder: Builder) ⇒ Version

Returns a new instance of Version.



13
14
15
16
# File 'lib/rubysmith/builders/version.rb', line 13

def initialize configuration, builder: Builder
  @configuration = configuration
  @builder = builder
end

Class Method Details

.callObject



11
# File 'lib/rubysmith/builders/version.rb', line 11

def self.call(...) = new(...).call

Instance Method Details

#callObject



18
19
20
21
22
23
# File 'lib/rubysmith/builders/version.rb', line 18

def call
  builder.call(configuration.merge(template_path: "%project_name%/.ruby-version.erb"))
         .render
         .append("\n")
  configuration
end