mirror of
https://github.com/samsonjs/http-cookie.git
synced 2026-04-27 14:57:46 +00:00
Hide load_yaml, renaming to require_yaml.
This commit is contained in:
parent
2a9476707c
commit
f4cd8ffb58
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue