[#25430] 1.8 warn nonblocking IO#read and add IO#readpartial — Tanaka Akira <akr@...17n.org>

1.8 に以下の変更を行いたいんですが、どうでしょうか?

29 messages 2005/01/08
[#25445] Re: 1.8 warn nonblocking IO#read and add IO#readpartial — Tanaka Akira <akr@...17n.org> 2005/01/09

In article <20050109063005.3048a4ba.tommy@tmtm.org>,

[#25479] some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

44 messages 2005/01/15
[#25488] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/22

永井@知能.九工大です.

[#25489] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/22

山本です。

[#25490] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/22

永井@知能.九工大です.

[#25517] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/25

山本です。

[#25519] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/25

永井@知能.九工大です.

[#25521] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/25

山本です。

[#25523] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/25

永井@知能.九工大です.

[#25530] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/25

山本です。

[#25537] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/26

永井@知能.九工大です.

[#25545] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/26

永井@知能.九工大です.

[#25546] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/26

山本です。

[#25547] Re: some problems on ext/tk/sample/**/*.rb — "U.Nakamura" <usa@...> 2005/01/26

こんにちは、なかむら(う)です。

[#25548] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/26

山本です。

[#25550] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/26

永井@知能.九工大です.

[#25553] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/26

山本です。

[#25556] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/26

永井@知能.九工大です.

[#25567] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/27

永井@知能.九工大です.

[#25569] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/01/27

山本です。

[#25578] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/28

永井@知能.九工大です.

[#25585] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/28

永井@知能.九工大です.

[#25605] Re: some problems on ext/tk/sample/**/*.rb — Hidetoshi NAGAI <nagai@...> 2005/01/31

永井@知能.九工大です.

[#25609] Re: some problems on ext/tk/sample/**/*.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/02/01

山本です。

[#25500] priority between commandline option and RUBYOPT env variable — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

13 messages 2005/01/25

[#25522] merge tcltklib and tk — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

32 messages 2005/01/25
[#25552] Re: merge tcltklib and tk — nobu@... 2005/01/26

なかだです。

[#25555] Re: merge tcltklib and tk — Hidetoshi NAGAI <nagai@...> 2005/01/26

永井@知能.九工大です.

[#25557] Re: merge tcltklib and tk — nobu@... 2005/01/26

なかだです。

[#25561] Re: merge tcltklib and tk — Hidetoshi NAGAI <nagai@...> 2005/01/27

永井@知能.九工大です.

[#25566] Re: merge tcltklib and tk — Hidetoshi NAGAI <nagai@...> 2005/01/27

永井@知能.九工大です.

[#25590] Can I copy doc/irb/irb.rd.ja to the reference Wiki? — sheepman <sheepman@...>

こんばんは、sheepman です。

16 messages 2005/01/29
[#25591] Re: Can I copy doc/irb/irb.rd.ja to the reference Wiki? — keiju@... (石塚圭樹) 2005/01/29

けいじゅ@いしつかです.

[#25592] irb history saving feature is not in ruby 1.8 — sheepman <sheepman@...> 2005/01/30

こんにちは、sheepman です。

[#25593] Re: irb history saving feature is not in ruby 1.8 — keiju@... (石塚圭樹) 2005/01/30

けいじゅ@いしつかです.

[#25594] Re: irb history saving feature is not in ruby 1.8 — sheepman <sheepman@...> 2005/01/30

こんにちは、sheepman です。

[#25595] Re: irb history saving feature is not in ruby 1.8 — keiju@... (石塚圭樹) 2005/01/30

けいじゅ@いしつかです.

[ruby-dev:25481] warnings from irb and readline

From: nobu@...
Date: 2005-01-16 10:33:36 UTC
List: ruby-dev #25481
なかだです。

irbを-dつきで実行したところ、いくつか警告が出ました。

Exception `LoadError' at /usr/lib/ruby/1.9/tmpdir.rb:12 - No such file to load -- Win32API
removing /tmp/_usr_lib_ruby_1_9_irb_lc_error_rb28469.0...done
/usr/lib/ruby/1.9/irb/ext/history.rb:34: warning: method redefined; discarding old eval_history=
/usr/lib/ruby/1.9/irb/ext/history.rb:36: warning: instance variable @eval_history not initialized

また、タブを打ったときもreadlineから警告が出ます。

/usr/lib/ruby/1.9/irb/input-method.rb:134: warning: instance variable completion_proc not initialized


* ext/readline/readline.c: suppress warnings.

* lib/irb/extend-command.rb (IRB::ContextExtender.def_extend_command):
  ditto.

* lib/irb/ext/history.rb (IRB::Context::set_last_value): ditto.

* lib/irb/ext/history.rb (IRB::Context::eval_history): ditto.

* lib/irb/locale.rb (IRB::Locale::real_load): ditto.

* lib/irb/slex.rb (SLex::Node::create_subnode): remove garbage.


Index: ext/readline/readline.c
===================================================================
RCS file: /cvs/ruby/src/ruby/ext/readline/readline.c,v
retrieving revision 1.19
diff -U2 -p -r1.19 readline.c
--- ext/readline/readline.c	19 Nov 2004 01:38:38 -0000	1.19
+++ ext/readline/readline.c	16 Jan 2005 05:55:24 -0000
@@ -20,4 +20,5 @@ static VALUE mReadline;
 #define COMPLETION_PROC "completion_proc"
 #define COMPLETION_CASE_FOLD "completion_case_fold"
+static ID completion_proc, completion_case_fold;
 
 #ifndef READLINE_42_OR_LATER
@@ -88,5 +89,5 @@ readline_s_set_completion_proc(self, pro
     if (!rb_respond_to(proc, rb_intern("call")))
 	rb_raise(rb_eArgError, "argument must respond to `call'");
-    return rb_iv_set(mReadline, COMPLETION_PROC, proc);
+    return rb_ivar_set(mReadline, completion_proc, proc);
 }
 
@@ -96,5 +97,5 @@ readline_s_get_completion_proc(self)
 {
     rb_secure(4);
-    return rb_iv_get(mReadline, COMPLETION_PROC);
+    return rb_attr_get(mReadline, completion_proc);
 }
 
@@ -105,5 +106,5 @@ readline_s_set_completion_case_fold(self
 {
     rb_secure(4);
-    return rb_iv_set(mReadline, COMPLETION_CASE_FOLD, val);
+    return rb_ivar_set(mReadline, completion_case_fold, val);
 }
 
@@ -113,5 +114,5 @@ readline_s_get_completion_case_fold(self
 {
     rb_secure(4);
-    return rb_iv_get(mReadline, COMPLETION_CASE_FOLD);
+    return rb_attr_get(mReadline, completion_case_fold);
 }
 
@@ -127,9 +128,9 @@ readline_attempted_completion_function(t
     int i, matches;
 
-    proc = rb_iv_get(mReadline, COMPLETION_PROC);
+    proc = rb_attr_get(mReadline, completion_proc);
     if (NIL_P(proc))
 	return NULL;
     rl_attempted_completion_over = 1;
-    case_fold = RTEST(rb_iv_get(mReadline, COMPLETION_CASE_FOLD));
+    case_fold = RTEST(rb_attr_get(mReadline, completion_case_fold));
     ary = rb_funcall(proc, rb_intern("call"), 1, rb_tainted_str_new2(text));
     if (TYPE(ary) != T_ARRAY)
@@ -698,4 +699,7 @@ Init_readline()
     using_history();
 
+    completion_proc = rb_intern(COMPLETION_PROC);
+    completion_case_fold = rb_intern(COMPLETION_CASE_FOLD);
+
     mReadline = rb_define_module("Readline");
     rb_define_module_function(mReadline, "readline",
Index: lib/irb/extend-command.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/irb/extend-command.rb,v
retrieving revision 1.5
diff -U2 -p -r1.5 extend-command.rb
--- lib/irb/extend-command.rb	6 Feb 2004 00:15:16 -0000	1.5
+++ lib/irb/extend-command.rb	16 Jan 2005 05:29:05 -0000
@@ -204,4 +204,5 @@ module IRB
       Context.module_eval %[
         def #{cmd_name}(*opts, &b)
+	  Context.module_eval {remove_method(:#{cmd_name})}
 	  require "#{load_file}"
 	  send :#{cmd_name}, *opts, &b
Index: lib/irb/init.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/irb/init.rb,v
retrieving revision 1.8
diff -U2 -p -r1.8 init.rb
--- lib/irb/init.rb	20 Feb 2004 10:03:40 -0000	1.8
+++ lib/irb/init.rb	16 Jan 2005 05:46:55 -0000
@@ -98,5 +98,5 @@ module IRB
     }
 
-    @CONF[:PROMPT_MODE] = :DEFAULT
+    @CONF[:PROMPT_MODE] = (STDIN.tty? ? :DEFAULT : :NULL)
     @CONF[:AUTO_INDENT] = false
 
@@ -124,9 +124,9 @@ module IRB
       when "-d"
 	$DEBUG = true
-      when "-r"
-	opt = ARGV.shift
+      when /^-r(.+)?/
+	opt = $1 || ARGV.shift
 	@CONF[:LOAD_MODULES].push opt if opt
-      when "-I"
-        opt = ARGV.shift
+      when /^-I(.+)?/
+        opt = $1 || ARGV.shift
         $LOAD_PATH.push opt if opt
       when /^-K(.)/
Index: lib/irb/locale.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/irb/locale.rb,v
retrieving revision 1.6
diff -U2 -p -r1.6 locale.rb
--- lib/irb/locale.rb	24 Jul 2003 05:18:47 -0000	1.6
+++ lib/irb/locale.rb	16 Jan 2005 05:40:04 -0000
@@ -11,5 +11,4 @@
 #
 
-autoload :Tempfile, "tempfile"
 autoload :Kconv, "kconv"
 
@@ -127,13 +126,10 @@ module IRB
 
     def real_load(path, priv)
-      tmp_base = path.tr("./:", "___")
-      lc_file = Tempfile.new(tmp_base)
-      File.foreach(path) do |line|
-	line = self.String(line)
-	lc_file.print(line)
+      src = self.String(File.read(path))
+      if priv
+	eval("self", TOPLEVEL_BINDING).extend(Module.new {eval(src, nil, path)})
+      else
+	eval(src, TOPLEVEL_BINDING, path)
       end
-      lc_file.close
-      toplevel_load lc_file.path, priv
-      lc_file.close(true)
     end
     private :real_load
Index: lib/irb/slex.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/irb/slex.rb,v
retrieving revision 1.7
diff -U2 -p -r1.7 slex.rb
--- lib/irb/slex.rb	28 Mar 2004 14:10:39 -0000	1.7
+++ lib/irb/slex.rb	16 Jan 2005 05:30:56 -0000
@@ -117,5 +117,4 @@ class SLex
       if chrs.empty?
 	if @postproc
-	  p node
 	  SLex.fail ErrNodeAlreadyExists
 	else
Index: lib/irb/ext/history.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/irb/ext/history.rb,v
retrieving revision 1.1
diff -U2 -p -r1.1 history.rb
--- lib/irb/ext/history.rb	9 Jul 2002 11:17:17 -0000	1.1
+++ lib/irb/ext/history.rb	16 Jan 2005 05:26:25 -0000
@@ -23,5 +23,5 @@ module IRB
 
       @workspace.evaluate self, "_ = IRB.CurrentContext.last_value"
-      if @eval_history #and !@eval_history_values.equal?(llv)
+      if (@eval_history ||= nil) #and !@eval_history_values.equal?(llv)
  	@eval_history_values.push @line_no, @last_value
  	@workspace.evaluate self, "__ = IRB.CurrentContext.instance_eval{@eval_history_values}"
@@ -34,5 +34,5 @@ module IRB
     def eval_history=(no)
       if no
-	if @eval_history 
+	if (@eval_history ||= nil)
 	  @eval_history_values.size(no)
 	else


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next