8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/generators/rails_rules/zed_generator.rb', line 8
def copy_files
result = ""
directory_path = "lib/generators/default/templates"
files = [
"1000-rails-general.mdc",
"1001-rails-controllers.mdc",
"1002-rails-models.mdc",
"1003-rails-views.mdc",
"1004-javascript-stimulus.mdc",
"1005-service-objects.mdc",
"1006-testing.mdc",
"1007-tailwindcss.mdc"
]
files.each do |file|
templates_path = File.expand_path("templates", __dir__)
string = File.read(File.join(templates_path, file))
parser = FrontMatterParser::Parser.new(:md).call(string)
result += parser.content
end
create_file TARGET_PATH, result
end
|