Class: Rubysmith::Builders::Caliber

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

Overview

Builds project skeleton with Caliber style support.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration, builder: Builder) ⇒ Caliber

Returns a new instance of Caliber.



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

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

Class Method Details

.callObject



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

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

Instance Method Details

#callObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/rubysmith/builders/caliber.rb', line 18

def call
  return configuration unless configuration.build_caliber

  builder.call(configuration.merge(template_path: "%project_name%/bin/rubocop.erb"))
         .render
         .permit 0o755

  builder.call(configuration.merge(template_path: "%project_name%/.rubocop.yml.erb")).render
  configuration
end