sous-chefs / sous-chefs/sql_server

generate ConfigurationFile.ini dynamically from attributes

Open
#94 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
64
Forks
117
Avg merge
5h 30m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ./templates/default/ConfigurationFile.ini and compare its current rendering with the example environment JSON in the issue. Verify how @properties is supplied, then confirm that scalar attributes render quoted and arrays render as space-separated quoted items, with the shown output as the completion criterion.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
devops
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.