From ca48cc4ad51afe64c8cc14ca5b3be31eee408d93 Mon Sep 17 00:00:00 2001 From: shugo Date: Sun, 13 Sep 2015 00:47:01 +0000 Subject: [PATCH] * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang, media_type, charset): new methods to return standard facts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/net/ftp.rb | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index cf9a59533d..a2a6197f85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Sep 13 09:38:51 2015 Shugo Maeda + + * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang, + media_type, charset): new methods to return standard facts. + Sat Sep 12 19:43:49 2015 Koichi Sasada * vm_insnhelper.c (vm_call_iseq_setup_normal): do not clear local diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index f5d45a80a1..494cd478b1 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -781,6 +781,14 @@ module Net @pathname = pathname end + standard_facts = %w(size modify create type unique perm + lang media-type charset) + standard_facts.each do |factname| + define_method factname.gsub(/-/, "_") do + facts[factname] + end + end + # # Returns +true+ if the entry is a file (i.e., the value of the type # fact is file).