[前][次][番号順一覧][スレッド一覧]

ruby-changes:39767

From: shugo <ko1@a...>
Date: Sun, 13 Sep 2015 09:47:30 +0900 (JST)
Subject: [ruby-changes:39767] shugo:r51848 (trunk): * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang,

shugo	2015-09-13 09:47:01 +0900 (Sun, 13 Sep 2015)

  New Revision: 51848

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51848

  Log:
    * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang,
      media_type, charset): new methods to return standard facts.

  Modified files:
    trunk/ChangeLog
    trunk/lib/net/ftp.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51847)
+++ ChangeLog	(revision 51848)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Sep 13 09:38:51 2015  Shugo Maeda  <shugo@r...>
+
+	* 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  <ko1@a...>
 
 	* vm_insnhelper.c (vm_call_iseq_setup_normal): do not clear local
Index: lib/net/ftp.rb
===================================================================
--- lib/net/ftp.rb	(revision 51847)
+++ lib/net/ftp.rb	(revision 51848)
@@ -781,6 +781,14 @@ module Net https://github.com/ruby/ruby/blob/trunk/lib/net/ftp.rb#L781
         @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).

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]