summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-22 08:18:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-04-22 08:18:19 +0000
commitf550e69efc38c659575e0bca179475ddb714cddd (patch)
treeac0bd072f77833edcba8d46083d4139e513d7595
parent808e9289e6031eba0241e7be159669f8fd0073a3 (diff)
* parse.y (arg_ambiguous): hopefully better message.
* lib/cgi.rb (CGI::QueryExtension::initialize_query): to_ary git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/cgi.rb20
-rw-r--r--lib/rational.rb4
-rw-r--r--parse.y2
4 files changed, 18 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 0df214d..5d7b08d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Apr 22 09:20:40 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (arg_ambiguous): hopefully better message.
+
+ * lib/cgi.rb (CGI::QueryExtension::initialize_query): to_ary
+
Tue Apr 22 06:06:22 2003 Tanaka Akira <akr@m17n.org>
* lib/resolv.rb (Resolv::DNS::Resource#hash): use XOR to accumulate
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 2e18bfd..7dffdd9 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -941,27 +941,23 @@ convert string charset, and set language to "ja".
end
private :initialize_query
- def [](key)
- value, = @params[key]
- unless value.nil?
- value = value.dup
- def value.to_ary
- [self]
- end
- def value.[](key)
+ class Value < String
+ def [](key)
$stderr.puts <<END
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
END
self
- end
- def value.first
+ end
+ def first
$stderr.puts <<END
CAUTION! cgi['key'] == cgi.params['key'][0] If want Array, use cgi.params['key']
END
self
- end
end
- value
+ end
+
+ def [](key)
+ Value.new(@params[key][0])
end
def keys(*args)
diff --git a/lib/rational.rb b/lib/rational.rb
index e63e8c4..0c784fb 100644
--- a/lib/rational.rb
+++ b/lib/rational.rb
@@ -67,7 +67,9 @@ class Rational < Numeric
def Rational.new!(num, den = 1)
new(num, den)
end
-
+
+ private_class_method :new
+
def initialize(num, den)
if den < 0
num = -num
diff --git a/parse.y b/parse.y
index 8d8ad5e..2ee3338 100644
--- a/parse.y
+++ b/parse.y
@@ -3269,7 +3269,7 @@ here_document(here)
static void
arg_ambiguous()
{
- rb_warning("ambiguous first argument; make sure");
+ rb_warning("ambiguous first argument; put parentheses or even spaces");
}
#define IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)