Hide load_yaml, renaming to require_yaml.

This commit is contained in:
Akinori MUSHA 2012-10-22 15:14:19 +09:00
parent 2a9476707c
commit f4cd8ffb58

View file

@ -98,7 +98,7 @@ class HTTP::CookieJar
open(file, 'w') { |f| open(file, 'w') { |f|
case format case format
when :yaml then when :yaml then
load_yaml require_yaml
YAML.dump(jar.jar, f) YAML.dump(jar.jar, f)
when :cookiestxt then when :cookiestxt then
@ -120,7 +120,7 @@ class HTTP::CookieJar
File.open(file) { |f| File.open(file) { |f|
case format case format
when :yaml then when :yaml then
load_yaml require_yaml
@jar = YAML.load(f) @jar = YAML.load(f)
when :cookiestxt then when :cookiestxt then
load_cookiestxt(f) load_cookiestxt(f)
@ -132,7 +132,7 @@ class HTTP::CookieJar
cleanup cleanup
end end
def load_yaml # :nodoc: def require_yaml # :nodoc:
begin begin
require 'psych' require 'psych'
rescue LoadError rescue LoadError
@ -140,6 +140,7 @@ class HTTP::CookieJar
require 'yaml' require 'yaml'
end end
private :require_yaml
# Clear the cookie jar and return self. # Clear the cookie jar and return self.
def clear def clear