Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

generate ConfigurationFile.ini dynamically from attributes

未关闭
#94 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
ruby
领域
devops

调研方向

从 ./templates/default/ConfigurationFile.ini 开始,将其当前渲染结果与 issue 中的示例环境 JSON 进行比较。验证 @properties 的提供方式,然后确认标量属性会渲染为带引号的值,数组会渲染为以空格分隔的带引号项,并以所示输出作为完成标准。

由索引模型根据 Issue 内容生成。

描述

Handle configuration file creation dynamically from attributes:

./templates/default/ConfigurationFile.ini:

<% @properties.each_pair do |key, value| -%>
  <% if value.is_a? Array -%>
<%= key %>=<%= value.map { |item| %("#{item}") }.join(' ') %>
  <% else -%>
<%= key %>="<%= value %>"
  <% end -%>
<% end -%>

example environment json:

{
  "sql_server": {
    "install": {
      "properties": {
        "key1": "value1",
        "key2": "value2",
        "array": ["item1", "item2", "item3"]
      }
    }
  }
}

end result:

key1="value1"
key2="value2"
array="item1" "item2" "item3"

This way the comments are lost, but also that can be attached if really necessary

主要语言
Ruby
星标
64
派生
116
平均合并
5 小时 30 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sous-chefs/sql_server 的其他 Issue

查看 sous-chefs/sql_server 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。