зеркало из https://github.com/mislav/hub.git
Fix errors due to the toml gem doesn't dump array of table correctly
See https://github.com/jm/toml/issues/31
This commit is contained in:
Родитель
b8a64ac93a
Коммит
b2f2a1291a
|
@ -129,8 +129,11 @@ World Module.new {
|
|||
hub_config = []
|
||||
yield hub_config
|
||||
|
||||
data = { :credentials => hub_config }
|
||||
File.open(config, 'w') { |cfg| cfg << TOML::Generator.new(data).body }
|
||||
# the `toml` gem doesn't work well with array of table (https://github.com/mojombo/toml#array-of-tables)
|
||||
# a temporary solution here to output the right format
|
||||
# see https://github.com/jm/toml/issues/31
|
||||
data = hub_config.map { |c| "[[credentials]]\n#{TOML::Generator.new(c).body}" }.join("\n\n")
|
||||
File.open(config, 'w') { |cfg| cfg << data }
|
||||
end
|
||||
|
||||
define_method(:text_editor_script) do |bash_code|
|
||||
|
|
Загрузка…
Ссылка в новой задаче