Skip to content

Commit

Permalink
Fix errors due to the toml gem doesn't dump array of table correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
owenthereal committed Mar 24, 2014
1 parent b8a64ac commit b2f2a12
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ def edit_hub_config
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|
Expand Down

0 comments on commit b2f2a12

Please sign in to comment.