summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-03-29 17:51:27 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-03-29 19:28:14 -0500
commit1568ea5f53214ae44a2ad31a3fb0f6332129b34a (patch)
treeb1575b962468ee365c94ef7f1f8676c600adc56c
parent755e1a49f29ecc87dbf619310326cc1057adf697 (diff)
downloadbundler-1568ea5f53214ae44a2ad31a3fb0f6332129b34a.tar.gz
[Settings] Use a custom serializer instead of relying upon the YAML module
-rw-r--r--lib/bundler/settings.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 175c9a76db..396c18ac98 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -201,14 +201,21 @@ module Bundler
hash.delete(key) if value.nil?
SharedHelpers.filesystem_access(file) do |p|
FileUtils.mkdir_p(p.dirname)
- require "bundler/psyched_yaml"
- File.open(p, "w") {|f| f.puts YAML.dump(hash) }
+ p.open("w") {|f| f.write(serialize_hash(hash)) }
end
end
value
end
+ def serialize_hash(hash)
+ yaml = String.new("---\n")
+ hash.each do |key, value|
+ yaml << key << ": " << value.to_s.gsub(/\s+/, " ").inspect << "\n"
+ end
+ yaml
+ end
+
def global_config_file
if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
Pathname.new(ENV["BUNDLE_CONFIG"])