ruby-changes:35040
From: hsbt <ko1@a...>
Date: Sun, 10 Aug 2014 10:34:58 +0900 (JST)
Subject: [ruby-changes:35040] hsbt:r47122 (trunk): * lib/cgi/session/pstore.rb: separated sample code.
hsbt 2014-08-10 10:34:50 +0900 (Sun, 10 Aug 2014) New Revision: 47122 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47122 Log: * lib/cgi/session/pstore.rb: separated sample code. * lib/open3.rb: ditto. Added files: trunk/sample/cgi-session-pstore.rb trunk/sample/open3.rb Modified files: trunk/ChangeLog trunk/lib/cgi/session/pstore.rb trunk/lib/open3.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 47121) +++ ChangeLog (revision 47122) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Aug 10 10:34:00 2014 SHIBATA Hiroshi <shibata.hiroshi@g...> + + * lib/cgi/session/pstore.rb: separated sample code. + * lib/open3.rb: ditto. + Sun Aug 10 10:03:24 2014 SHIBATA Hiroshi <shibata.hiroshi@g...> * lib/irb/ext/multi-irb.rb: removed commented-out code. Index: sample/open3.rb =================================================================== --- sample/open3.rb (revision 0) +++ sample/open3.rb (revision 47122) @@ -0,0 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/sample/open3.rb#L1 +require 'open3' + +a = Open3.popen3("nroff -man") +Thread.start do + while line = gets + a[0].print line + end + a[0].close +end +while line = a[1].gets + print ":", line +end Index: sample/cgi-session-pstore.rb =================================================================== --- sample/cgi-session-pstore.rb (revision 0) +++ sample/cgi-session-pstore.rb (revision 47122) @@ -0,0 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/sample/cgi-session-pstore.rb#L1 +require 'cgi' +require 'cgi/session/pstore' + +STDIN.reopen("/dev/null") +cgi = CGI.new +session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore) +session['key'] = {'k' => 'v'} +puts session['key'].class +fail unless Hash === session['key'] +puts session['key'].inspect +fail unless session['key'].inspect == '{"k"=>"v"}' Index: lib/open3.rb =================================================================== --- lib/open3.rb (revision 47121) +++ lib/open3.rb (revision 47122) @@ -661,16 +661,3 @@ module Open3 https://github.com/ruby/ruby/blob/trunk/lib/open3.rb#L661 end end - -if $0 == __FILE__ - a = Open3.popen3("nroff -man") - Thread.start do - while line = gets - a[0].print line - end - a[0].close - end - while line = a[1].gets - print ":", line - end -end Index: lib/cgi/session/pstore.rb =================================================================== --- lib/cgi/session/pstore.rb (revision 47121) +++ lib/cgi/session/pstore.rb (revision 47122) @@ -97,15 +97,4 @@ class CGI https://github.com/ruby/ruby/blob/trunk/lib/cgi/session/pstore.rb#L97 end end end - -if $0 == __FILE__ - # :enddoc: - STDIN.reopen("/dev/null") - cgi = CGI.new - session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore) - session['key'] = {'k' => 'v'} - puts session['key'].class - fail unless Hash === session['key'] - puts session['key'].inspect - fail unless session['key'].inspect == '{"k"=>"v"}' -end +# :enddoc: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/