Class: Makit::Cli::Generators::Templates::Dotnet::Gitignore

Inherits:
Object
  • Object
show all
Defined in:
lib/makit/cli/generators/templates/dotnet_templates.rb

Overview

Template generator for .NET project .gitignore files

Generates a .gitignore file with common .NET build artifacts and IDE-specific files that should not be committed to version control. Includes bin/, obj/, and various Visual Studio cache files.

Examples:

gitignore = Gitignore.new("MyProject")
ignore_content = gitignore.render

Instance Method Summary collapse

Constructor Details

#initialize(project_name) ⇒ Gitignore

Initialize a new .gitignore template generator

Parameters:

  • project_name (String)

    the name of the .NET project (unused but kept for consistency)



146
147
148
# File 'lib/makit/cli/generators/templates/dotnet_templates.rb', line 146

def initialize(project_name)
  @project_name = project_name
end

Instance Method Details

#renderString

Render the .gitignore file content

Returns:

  • (String)

    the complete .gitignore content for .NET projects



153
154
155
156
157
158
159
160
161
# File 'lib/makit/cli/generators/templates/dotnet_templates.rb', line 153

def render
  <<~GITIGNORE
    bin/
    obj/
    *.user
    *.suo
    *.cache
  GITIGNORE
end