comparison after5.rb @ 67:a421c2fefc32 draft

Fix the argument for FileUtils.mkdir_p()
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 26 Jun 2012 18:41:57 +0900
parents 0ae73ca14d99
children db1502243712
comparison
equal deleted inserted replaced
66:0ae73ca14d99 67:a421c2fefc32
2 # -*- coding: euc-jp -*- 2 # -*- coding: euc-jp -*-
3 # 3 #
4 # Associative Scheduling Table - after5 4 # Associative Scheduling Table - after5
5 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuuji<at>gentei.org] 5 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuuji<at>gentei.org]
6 # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $ 6 # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $
7 # Last modified Mon Jun 25 23:30:32 2012 on firestorm 7 # Last modified Tue Jun 26 18:40:51 2012 on firestorm
8 # See http://www.gentei.org/~yuuji/software/after5/ 8 # See http://www.gentei.org/~yuuji/software/after5/
9 # このスクリプトはEUCで保存してください。 9 # このスクリプトはEUCで保存してください。
10 $hgid = <<_HGID_.split[1..-2].join(" ") 10 $hgid = <<_HGID_.split[1..-2].join(" ")
11 $HGid$ 11 $HGid$
12 _HGID_ 12 _HGID_
1681 File.umask(027) 1681 File.umask(027)
1682 if spoolto && spoolto.is_a?(String) && 1682 if spoolto && spoolto.is_a?(String) &&
1683 proc { 1683 proc {
1684 require 'fileutils' 1684 require 'fileutils'
1685 begin 1685 begin
1686 test(?d, spoolto) or FileUtils.mkdir_p(spoolto, 0750) 1686 test(?d, spoolto) or FileUtils.mkdir_p(spoolto, :mode => 0750)
1687 test(?w, spoolto) 1687 test(?w, spoolto)
1688 rescue 1688 rescue
1689 nil 1689 nil
1690 end}.call && 1690 end}.call &&
1691 (tee=open("|-", "w")) # popen should be done in if-condition 1691 (tee=open("|-", "w")) # popen should be done in if-condition
3049 end 3049 end
3050 } 3050 }
3051 } + \ 3051 } + \
3052 @H.element("td"){ 3052 @H.element("td"){
3053 if ghash['admin'].grep(user)[0] 3053 if ghash['admin'].grep(user)[0]
3054 @H.text("groupname-#{g}", ghash['name'], nil, 20) 3054 @H.text("groupname-#{g}", ghash['name'], nil, 12)
3055 else 3055 else
3056 ghash['name'] 3056 ghash['name']
3057 end + '<br>' + \ 3057 end + '<br>' + \
3058 # If this group is inviteonly and the user is not a member, 3058 # If this group is inviteonly and the user is not a member,
3059 # 3059 # one cannot join.
3060 if memberp && @sc.isadmin(user, g) || 3060 if memberp && @sc.isadmin(user, g) ||
3061 !@sc.getgroupattr(g, 'inviteonly') 3061 !@sc.getgroupattr(g, 'inviteonly')
3062 @H.radio("groupadd-#{g}", "yes", "IN", memberp) + " / " + \ 3062 @H.radio("groupadd-#{g}", "yes", "IN", memberp) + " / " + \
3063 @H.radio("groupadd-#{g}", "no", "OUT", !memberp) 3063 @H.radio("groupadd-#{g}", "no", "OUT", !memberp)
3064 else 3064 else
3071 if memberp # move this user to the beginning of list 3071 if memberp # move this user to the beginning of list
3072 memlist.delete(user) 3072 memlist.delete(user)
3073 memlist.unshift(user) 3073 memlist.unshift(user)
3074 end 3074 end
3075 memlist.collect{|u| 3075 memlist.collect{|u|
3076 @sc.nickname(u) + \ 3076 @H.element("abbr", "title"=>mailaddress(u)) {
3077 @sc.nickname(u)
3078 } + \
3077 ((u == user) ? ("("+@H.text("mail4-#{g}", memberp, 30, 180)+")") : "") 3079 ((u == user) ? ("("+@H.text("mail4-#{g}", memberp, 30, 180)+")") : "")
3078 }.join(", ") 3080 }.join(", ")
3079 } 3081 }
3080 } + \ 3082 } + \
3081 @H.element("td"){ 3083 @H.element("td"){

yatex.org