Class: Makit::Cli::Generators::Templates::Rust::CargoToml
- Inherits:
-
Object
- Object
- Makit::Cli::Generators::Templates::Rust::CargoToml
- Defined in:
- lib/makit/cli/generators/templates/rust_templates.rb
Overview
Template for generating Cargo.toml configuration file
This template creates the main configuration file for Rust projects, including package metadata and dependencies configuration.
Instance Method Summary collapse
-
#initialize(project_name) ⇒ CargoToml
constructor
Initialize the Cargo.toml template.
-
#render ⇒ String
Render the Cargo.toml file content.
Constructor Details
#initialize(project_name) ⇒ CargoToml
Initialize the Cargo.toml template
17 18 19 |
# File 'lib/makit/cli/generators/templates/rust_templates.rb', line 17 def initialize(project_name) @project_name = project_name end |
Instance Method Details
#render ⇒ String
Render the Cargo.toml file content
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/makit/cli/generators/templates/rust_templates.rb', line 24 def render " [package]\n name = \"\#{@project_name}\"\n version = \"0.1.0\"\n edition = \"2021\"\n\n [dependencies]\n TOML\nend\n" |