[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dennou-ruby:000009] [Tips] install,version



���Ȥ���Ǥ�

�פ��դ��� Tips �Ȥ�ή�����Ȥˤ��ޤ����ޤ������󥹥ȡ���ȥС�
�����ˤĤ��ơ�

Ruby �ϴ���Ū�ˤ� 
% ./configure && make && make install 
�ǥ��󥹥ȡ��뤵��ޤ���

�ǥե���ȤǤ� /usr/local �򺬤ûҤȤ���/usr/local/bin/ �˥�
�󥿥ץ꥿ ruby ����/usr/local/lib/ruby/1.3/ �ʲ��˥饤�֥�
�꤬���󥹥ȡ��뤵��ޤ����⤷��ruby�Υ��󥹥ȡ�����κ��û�
���ؤ������Ф����� ./configure ������� 
% ./configure --prefix=$HOME
�Ȥ���ȡ�$HOME �ʲ��˥��󥹥ȡ��뤵��ޤ���configure �μ���
�դ��륪�ץ����� ./configure --help �ǰ������뤳�Ȥ��Ǥ���
����

Ruby�ϸ���1.3���󤬺ǿ����İ���Ǥ������λ����Ǥκǿ��Ǥ�
1.3.7 �Ǥ�����ʬ�� ruby �ΥС��������Τ�ˤ� ruby -v �Ȥ�
���ʬ����ޤ���

% ruby -v
ruby 1.3.7 (1999-08-06) [i386-freebsd3.2]

�������轵��Ruby�ܤΥ������åȤǤ��� 1.4 ����꡼�������ͽ
��Ǥ���������ˤ��衢�ǿ��Ǥ򥤥󥹥ȡ��뤷�Ƥ������Ȥ˱ۤ�
�����ȤϤ���ޤ��󡣺ǿ��Ǥ��Τ뤿��Υ�����ץȤ򤪤ޤ��ˤ�
���Ȥ��ޤ���

# Ruby�˴ؤ�������罸 :-)

-- gotoken

#! /usr/local/bin/ruby

#
# latest-ruby.rb obtains the latest version of ruby
#

require "ftplib"

ftp = FTP.new("ftp.netlab.co.jp", "anonymous")
files = {}
now = Time.now

ftp.list("/pub/lang/ruby/devel").each do |line|
  elm = line.split
  next if file =~ /(^\.\.?$)|man/ || elm.size != 9
  mode, link, owner, group, size, month, date, tory, file = elm
  year, hour, min = if tory =~ /:/
		      [now.year, tory.split(":")[0], tory.split(":")[1]]
		    else
		      [tory, 0, 0]
		    end
  files[file] = Time.gm(year, month, date, hour, min)
end

puts files.to_a.sort{|j,i| 
  i[1] <=> j[1]}.collect{|i| i[1].to_s + " " + i[0]}.shift