From f4cd8ffb5815d8f88662bef02c83b2f7380a72bd Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Mon, 22 Oct 2012 15:14:19 +0900 Subject: [PATCH] Hide load_yaml, renaming to require_yaml. --- lib/http/cookie_jar.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/http/cookie_jar.rb b/lib/http/cookie_jar.rb index 533ec72..79f405f 100644 --- a/lib/http/cookie_jar.rb +++ b/lib/http/cookie_jar.rb @@ -98,7 +98,7 @@ class HTTP::CookieJar open(file, 'w') { |f| case format when :yaml then - load_yaml + require_yaml YAML.dump(jar.jar, f) when :cookiestxt then @@ -120,7 +120,7 @@ class HTTP::CookieJar File.open(file) { |f| case format when :yaml then - load_yaml + require_yaml @jar = YAML.load(f) when :cookiestxt then load_cookiestxt(f) @@ -132,7 +132,7 @@ class HTTP::CookieJar cleanup end - def load_yaml # :nodoc: + def require_yaml # :nodoc: begin require 'psych' rescue LoadError @@ -140,6 +140,7 @@ class HTTP::CookieJar require 'yaml' end + private :require_yaml # Clear the cookie jar and return self. def clear