Class: Makit::Cli::Generators::Templates::Rust::MainRs
- Inherits:
-
Object
- Object
- Makit::Cli::Generators::Templates::Rust::MainRs
- Defined in:
- lib/makit/cli/generators/templates/rust_templates.rb
Overview
Template for generating main.rs source file
This template creates the entry point for a Rust application with a simple “Hello, world!” program.
Instance Method Summary collapse
-
#initialize(project_name) ⇒ MainRs
constructor
Initialize the main.rs template.
-
#render ⇒ String
Render the main.rs file content.
Constructor Details
#initialize(project_name) ⇒ MainRs
Initialize the main.rs template
44 45 46 |
# File 'lib/makit/cli/generators/templates/rust_templates.rb', line 44 def initialize(project_name) @project_name = project_name end |
Instance Method Details
#render ⇒ String
Render the main.rs file content
51 52 53 54 55 56 57 |
# File 'lib/makit/cli/generators/templates/rust_templates.rb', line 51 def render <<~RUST fn main() { println!("Hello, world!"); } RUST end |