Class: Rubysmith::Builders::Core
- Inherits:
-
Object
- Object
- Rubysmith::Builders::Core
- Defined in:
- lib/rubysmith/builders/core.rb
Overview
Builds project skeleton core structure and minimum file support.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(configuration, builder: Builder) ⇒ Core
constructor
A new instance of Core.
Constructor Details
Class Method Details
.call ⇒ Object
13 |
# File 'lib/rubysmith/builders/core.rb', line 13 def self.call(...) = new(...).call |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rubysmith/builders/core.rb', line 20 def call builder.call(configuration.merge(template_path: "%project_name%/lib/%project_path%.rb.erb")) .render .replace(" require", "require") .replace(/ (?=(Zeit|loader|end))/, "") .replace("\n \n", "\n\n") .insert_before("module #{module_name}", "#{indentation}# Main namespace.\n") .replace("end\n end", " end\n end") configuration end |