summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--array.c2
-rw-r--r--class.c2
-rw-r--r--eval.c20
-rw-r--r--ext/iconv/iconv.c2
-rw-r--r--ext/openssl/ossl.c2
-rw-r--r--ext/openssl/ossl_asn1.c10
-rw-r--r--ext/openssl/ossl_config.c2
-rw-r--r--ext/openssl/ossl_pkcs7.c2
-rw-r--r--ext/racc/cparse/cparse.c2
-rw-r--r--ext/readline/readline.c2
-rw-r--r--ext/sdbm/init.c2
-rw-r--r--ext/stringio/stringio.c2
-rw-r--r--ext/syslog/syslog.c2
-rw-r--r--ext/tcltklib/tcltklib.c2
-rw-r--r--ext/win32ole/win32ole.c80
-rw-r--r--file.c4
-rw-r--r--hash.c6
-rw-r--r--lib/cgi.rb2
-rw-r--r--lib/csv.rb8
-rw-r--r--lib/delegate.rb3
-rw-r--r--lib/generator.rb4
-rw-r--r--lib/net/http.rb8
-rw-r--r--lib/net/https.rb2
-rw-r--r--lib/net/imap.rb2
-rw-r--r--lib/net/pop.rb4
-rw-r--r--lib/net/smtp.rb6
-rw-r--r--lib/open-uri.rb2
-rw-r--r--lib/ostruct.rb2
-rw-r--r--lib/rational.rb4
-rw-r--r--lib/resolv.rb12
-rw-r--r--lib/singleton.rb20
-rw-r--r--lib/tempfile.rb2
-rw-r--r--lib/wsdl/operation.rb2
-rw-r--r--lib/xmlrpc/parser.rb2
-rw-r--r--re.c4
-rw-r--r--sprintf.c4
-rw-r--r--string.c10
-rw-r--r--struct.c2
-rw-r--r--time.c2
39 files changed, 127 insertions, 124 deletions
diff --git a/array.c b/array.c
index 0f3fc1b202..dfdce5eff5 100644
--- a/array.c
+++ b/array.c
@@ -1774,7 +1774,7 @@ rb_ary_select(argc, argv, ary)
long i;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new2(RARRAY(ary)->len);
for (i = 0; i < RARRAY(ary)->len; i++) {
diff --git a/class.c b/class.c
index fceaaa89a8..ab848e5b7b 100644
--- a/class.c
+++ b/class.c
@@ -1017,7 +1017,7 @@ rb_scan_args(argc, argv, fmt, va_alist)
}
if (argc > i) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)", argc, i);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, i);
}
return argc;
diff --git a/eval.c b/eval.c
index ab55428754..3adf63dfd7 100644
--- a/eval.c
+++ b/eval.c
@@ -3639,7 +3639,7 @@ rb_eval(self, n)
case NODE_ATTRSET:
if (ruby_frame->argc != 1)
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)",
ruby_frame->argc);
result = rb_ivar_set(self, node->nd_vid, ruby_frame->argv[0]);
break;
@@ -4853,7 +4853,7 @@ massign(self, node, val, pcall)
}
if (pcall && list) goto arg_error;
if (node->nd_args) {
- if (node->nd_args == (NODE*)-1) {
+ if ((long)(node->nd_args) == -1) {
/* no check for mere `*' */
}
else if (!list && i<len) {
@@ -5333,7 +5333,7 @@ call_cfunc(func, recv, len, argc, argv)
VALUE *argv;
{
if (len >= 0 && argc != len) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, len);
}
@@ -5484,7 +5484,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
/* for attr get/set */
case NODE_IVAR:
if (argc != 0) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_attr_get(recv, body->nd_vid);
break;
@@ -5547,10 +5547,10 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
i = node->nd_cnt;
if (i > argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, i);
}
- if ((int)node->nd_rest == -1) {
+ if ((long)node->nd_rest == -1) {
int opt = i;
NODE *optnode = node->nd_opt;
@@ -5559,7 +5559,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
optnode = optnode->nd_next;
}
if (opt < argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)",
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
argc, opt);
}
ruby_frame->argc = opt;
@@ -5585,7 +5585,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
}
}
local_vars = ruby_scope->local_vars;
- if ((int)node->nd_rest >= 0) {
+ if ((long)node->nd_rest >= 0) {
VALUE v;
if (argc > 0)
@@ -7196,7 +7196,7 @@ rb_obj_extend(argc, argv, obj)
int i;
if (argc == 0) {
- rb_raise(rb_eArgError, "wrong number of arguments(0 for 1)");
+ rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
}
for (i=0; i<argc; i++) Check_Type(argv[i], T_MODULE);
while (argc--) {
@@ -9096,7 +9096,7 @@ rb_mod_define_method(argc, argv, mod)
}
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
if (RDATA(body)->dmark == (RUBY_DATA_FUNC)bm_mark) {
struct METHOD *method = (struct METHOD *)DATA_PTR(body);
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 3694f9b9ff..096639abe1 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -601,7 +601,7 @@ iconv_s_iconv
struct iconv_env_t arg;
if (argc < 2) /* needs `to' and `from' arguments at least */
- rb_raise(rb_eArgError, "wrong # of arguments (%d for %d)", argc, 2);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, 2);
arg.argc = argc -= 2;
arg.argv = argv + 2;
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index ac98d6f0a6..36a7aa5042 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -63,7 +63,7 @@ ossl_x509_ary2sk0(VALUE ary)
val = rb_ary_entry(ary, i);
if (!rb_obj_is_kind_of(val, cX509Cert)) {
sk_X509_pop_free(sk, X509_free);
- ossl_raise(eOSSLError, "object except X509 cert is in array");
+ ossl_raise(eOSSLError, "object not X509 cert in array");
}
x509 = DupX509CertPtr(val); /* NEED TO DUP */
sk_X509_push(sk, x509);
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index f0d8dda9b8..09ca66f14c 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -567,7 +567,7 @@ ossl_asn1_default_tag(VALUE obj)
return i;
}
}
- ossl_raise(eASN1Error, "not found universal tag for %s",
+ ossl_raise(eASN1Error, "universal tag for %s not found",
rb_class2name(CLASS_OF(obj)));
return -1; /* dummy */
@@ -650,7 +650,7 @@ ossl_asn1data_initialize(VALUE self, VALUE value, VALUE tag, VALUE tag_class)
if(!SYMBOL_P(tag_class))
ossl_raise(eASN1Error, "invalid tag class");
if((SYM2ID(tag_class) == sUNIVERSAL) && NUM2INT(tag) > 31)
- ossl_raise(eASN1Error, "too large tag number for Universal");
+ ossl_raise(eASN1Error, "tag number for Universal too large");
ossl_asn1_set_tag(self, tag);
ossl_asn1_set_value(self, value);
ossl_asn1_set_tag_class(self, tag_class);
@@ -865,13 +865,13 @@ ossl_asn1_initialize(int argc, VALUE *argv, VALUE self)
if(NIL_P(tagging))
tagging = ID2SYM(sEXPLICIT);
if(!SYMBOL_P(tagging))
- ossl_raise(eASN1Error, "invelid tag default");
+ ossl_raise(eASN1Error, "invalid tag default");
if(NIL_P(tag_class))
tag_class = ID2SYM(sCONTEXT_SPECIFIC);
if(!SYMBOL_P(tag_class))
- ossl_raise(eASN1Error, "invelid tag class");
+ ossl_raise(eASN1Error, "invalid tag class");
if(SYM2ID(tagging) == sIMPLICIT && NUM2INT(tag) > 31)
- ossl_raise(eASN1Error, "too large tag number for Universal");
+ ossl_raise(eASN1Error, "tag number for Universal too large");
}
else{
tag = INT2NUM(ossl_asn1_default_tag(self));
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index 655517c4fb..37abff508b 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -147,7 +147,7 @@ ossl_config_initialize(int argc, VALUE *argv, VALUE self)
}
}
#ifdef OSSL_NO_CONF_API
- else rb_raise(rb_eArgError, "wrong number of arguments(0 for 1)");
+ else rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
#else
else _CONF_new_data(conf);
#endif
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index aaa12ac7d7..57825e8bb1 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -358,7 +358,7 @@ ossl_pkcs7_set_detached(VALUE self, VALUE flag)
GetPKCS7(self, p7);
if(flag != Qtrue && flag != Qfalse)
- ossl_raise(ePKCS7Error, "must secify a boolean");
+ ossl_raise(ePKCS7Error, "must specify a boolean");
if(!PKCS7_set_detached(p7, flag == Qtrue ? 1 : 0))
ossl_raise(ePKCS7Error, NULL);
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index c15aaf5900..24c4e36f2b 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -733,7 +733,7 @@ reduce0(val, data, self)
/* calculate transition state */
if (RARRAY(v->state)->len == 0)
- rb_raise(RaccBug, "state stack unexpected empty");
+ rb_raise(RaccBug, "state stack unexpectedly empty");
k2 = num_to_long(LAST_I(v->state));
k1 = num_to_long(reduce_to) - v->nt_base;
D_printf("(goto) k1=%ld\n", k1);
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index cac0b1d11c..78a8b17fe5 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -83,7 +83,7 @@ readline_s_set_completion_proc(self, proc)
VALUE proc;
{
if (!rb_respond_to(proc, rb_intern("call")))
- rb_raise(rb_eArgError, "argument have to respond to `call'");
+ rb_raise(rb_eArgError, "argument must respond to `call'");
return rb_iv_set(mReadline, COMPLETION_PROC, proc);
}
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index f473555840..4352d21f9c 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -227,7 +227,7 @@ fsdbm_select(argc, argv, obj)
struct dbmdata *dbmp;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
GetDBM(obj, dbmp);
dbm = dbmp->di_dbm;
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 46217c7bc8..98d3c08ee5 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -879,7 +879,7 @@ strio_read(argc, argv, self)
}
break;
default:
- rb_raise(rb_eArgError, "wrong number arguments (%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
if (NIL_P(str)) {
str = rb_str_substr(ptr->string, ptr->pos, len);
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index ce386eda30..477489ddfe 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -146,7 +146,7 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
VALUE pri;
if (argc < 2) {
- rb_raise(rb_eArgError, "wrong # of arguments(%d for 2+)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2+)", argc);
}
argc--;
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 1c19ae6cef..63dd593605 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -811,7 +811,7 @@ ip_ruby(clientData, interp, argc, argv)
/* ruby command has 1 arg. */
if (argc != 2) {
- rb_raise(rb_eArgError, "wrong # of arguments (%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
/* get C string from Tcl object */
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 8869ee031d..020105791b 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -73,7 +73,7 @@
#define OLEData_Get_Struct(obj, pole) {\
Data_Get_Struct(obj, struct oledata, pole);\
if(!pole->pDispatch) {\
- rb_raise(rb_eRuntimeError, "Fail to get Dispatch Interface");\
+ rb_raise(rb_eRuntimeError, "failed to get Dispatch Interface");\
}\
}
@@ -769,7 +769,7 @@ ole_val2variant(val, var)
if(pub) free(pub);
if(psab) free(psab);
if(pid) free(pid);
- rb_raise(rb_eRuntimeError, "memory allocate error");
+ rb_raise(rb_eRuntimeError, "memory allocation error");
}
val1 = val;
i = 0;
@@ -907,7 +907,7 @@ ole_variant2val(pvar)
if(pID) free(pID);
if(pLB) free(pLB);
if(pUB) free(pUB);
- rb_raise(rb_eRuntimeError, "memory allocate error");
+ rb_raise(rb_eRuntimeError, "memory allocation error");
}
obj = Qnil;
@@ -1361,7 +1361,7 @@ ole_create_dcom(argc, argv, self)
if (!gole32)
gole32 = LoadLibrary("OLE32");
if (!gole32)
- rb_raise(rb_eRuntimeError, "Fail to load OLE32.");
+ rb_raise(rb_eRuntimeError, "failed to load OLE32.");
if (!gCoCreateInstanceEx)
gCoCreateInstanceEx = (FNCOCREATEINSTANCEEX*)
GetProcAddress(gole32, "CoCreateInstanceEx");
@@ -1388,7 +1388,7 @@ ole_create_dcom(argc, argv, self)
SysFreeString(serverinfo.pwszName);
if (FAILED(hr))
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create DCOM server : `%s' in `%s'",
+ "failed to create DCOM server : `%s' in `%s'",
StringValuePtr(ole),
StringValuePtr(host));
@@ -1415,7 +1415,7 @@ ole_bind_obj(moniker, argc, argv, self)
hr = CreateBindCtx(0, &pBindCtx);
if(FAILED(hr)) {
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create bind context");
+ "failed to create bind context");
}
pbuf = ole_mb2wc(StringValuePtr(moniker), -1);
@@ -1492,7 +1492,7 @@ fole_s_connect(argc, argv, self)
if(FAILED(hr)) {
OLE_RELEASE(pUnknown);
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create WIN32OLE server : `%s'",
+ "failed to create WIN32OLE server : `%s'",
StringValuePtr(svr_name));
}
@@ -1536,12 +1536,12 @@ fole_s_const_load(argc, argv, self)
hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
if(FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
OLE_RELEASE(pTypeInfo);
if(TYPE(klass) != T_NIL) {
@@ -1561,7 +1561,7 @@ fole_s_const_load(argc, argv, self)
hr = LoadTypeLibEx(pBuf, REGKIND_NONE, &pTypeLib);
SysFreeString(pBuf);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
if(TYPE(klass) != T_NIL) {
ole_const_load(pTypeLib, klass, self);
}
@@ -1717,11 +1717,11 @@ fole_s_show_help(argc, argv, self)
helpfile = target;
}
if (TYPE(helpfile) != T_STRING) {
- rb_raise(rb_eTypeError, "1st parametor must be (String|WIN32OLE_TYPE|WIN32OLE_METHOD).");
+ rb_raise(rb_eTypeError, "1st parameter must be (String|WIN32OLE_TYPE|WIN32OLE_METHOD).");
}
hwnd = ole_show_help(helpfile, helpcontext);
if(hwnd == 0) {
- rb_raise(rb_eRuntimeError, "fail to open help file:%s",
+ rb_raise(rb_eRuntimeError, "failed to open help file:%s",
StringValuePtr(helpfile));
}
return Qnil;
@@ -1775,7 +1775,7 @@ fole_initialize(argc, argv, self)
&IID_IDispatch, (void**)&pDispatch);
if(FAILED(hr)) {
ole_raise(hr, eWIN32OLE_RUNTIME_ERROR,
- "Fail to create WIN32OLE object from `%s'",
+ "failed to create WIN32OLE object from `%s'",
StringValuePtr(svr_name));
}
@@ -1876,7 +1876,7 @@ ole_invoke(argc, argv, self, wFlags)
rb_scan_args(argc, argv, "1*", &cmd, &paramS);
OLEData_Get_Struct(self, pole);
if(!pole->pDispatch) {
- rb_raise(rb_eRuntimeError, "Fail to get dispatch interface.");
+ rb_raise(rb_eRuntimeError, "failed to get dispatch interface.");
}
wcmdname = ole_mb2wc(StringValuePtr(cmd), -1);
hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
@@ -2431,7 +2431,7 @@ fole_each(self)
if (FAILED(hr)) {
VariantClear(&result);
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to get IEnum Interface");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to get IEnum Interface");
}
if (V_VT(&result) == VT_UNKNOWN)
@@ -2444,7 +2444,7 @@ fole_each(self)
(void**)&pEnum);
if (FAILED(hr) || !pEnum) {
VariantClear(&result);
- ole_raise(hr, rb_eRuntimeError, "Fail to get IEnum Interface");
+ ole_raise(hr, rb_eRuntimeError, "failed to get IEnum Interface");
}
VariantClear(&result);
@@ -2499,7 +2499,7 @@ ole_method_sub(self, pOwnerTypeInfo, pTypeInfo, name)
VALUE method = Qnil;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs && method == Qnil; i++) {
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, i, &pFuncDesc);
@@ -2538,7 +2538,7 @@ olemethod_from_typeinfo(self, pTypeInfo, name)
VALUE method = Qnil;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
method = ole_method_sub(self, 0, pTypeInfo, name);
if (method != Qnil) {
@@ -2574,7 +2574,7 @@ ole_methods_sub(pOwnerTypeInfo, pTypeInfo, methods, mask)
WORD i;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cFuncs; i++) {
pstr = NULL;
@@ -2615,7 +2615,7 @@ ole_methods_from_typeinfo(pTypeInfo, mask)
VALUE methods = rb_ary_new();
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
ole_methods_sub(0, pTypeInfo, methods, mask);
@@ -2648,7 +2648,7 @@ typeinfo_from_ole(pole, ppti)
HRESULT hr = pole->pDispatch->lpVtbl->GetTypeInfo(pole->pDispatch,
0, lcid, &pTypeInfo);
if(FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetDocumentation(pTypeInfo,
-1,
@@ -2658,7 +2658,7 @@ typeinfo_from_ole(pole, ppti)
hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &i);
OLE_RELEASE(pTypeInfo);
if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
count = pTypeLib->lpVtbl->GetTypeInfoCount(pTypeLib);
for (i = 0; i < count; i++) {
@@ -2773,12 +2773,12 @@ fole_obj_help( self )
hr = pole->pDispatch->lpVtbl->GetTypeInfo( pole->pDispatch, 0, lcid, &pTypeInfo );
if(FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "fail to GetTypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetTypeInfo");
}
hr = pTypeInfo->lpVtbl->GetContainingTypeLib( pTypeInfo, &pTypeLib, &index );
if(FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError, "fail to GetContainingTypeLib");
+ ole_raise(hr, rb_eRuntimeError, "failed to GetContainingTypeLib");
}
hr = pTypeLib->lpVtbl->GetDocumentation( pTypeLib, index,
&bstr, NULL, NULL, NULL);
@@ -3011,7 +3011,7 @@ fole_method_help( self, cmdname )
OLEData_Get_Struct(self, pole);
hr = typeinfo_from_ole(pole, &pTypeInfo);
if(FAILED(hr))
- ole_raise(hr, rb_eRuntimeError, "fail to get ITypeInfo");
+ ole_raise(hr, rb_eRuntimeError, "failed to get ITypeInfo");
method = folemethod_s_allocate(cWIN32OLE_METHOD);
obj = olemethod_from_typeinfo(method, pTypeInfo, cmdname);
OLE_RELEASE(pTypeInfo);
@@ -3046,7 +3046,7 @@ foletype_s_ole_classes(self, typelib)
pbuf = ole_mb2wc(StringValuePtr(file), -1);
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
SysFreeString(pbuf);
ole_classes_from_typelib(pTypeLib, classes);
OLE_RELEASE(pTypeLib);
@@ -3221,7 +3221,7 @@ foletype_initialize(self, typelib, oleclass)
pbuf = ole_mb2wc(StringValuePtr(file), -1);
hr = LoadTypeLibEx(pbuf, REGKIND_NONE, &pTypeLib);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to LoadTypeLibEx");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to LoadTypeLibEx");
SysFreeString(pbuf);
if (oleclass_from_typelib(self, pTypeLib, oleclass) == Qfalse) {
OLE_RELEASE(pTypeLib);
@@ -3414,7 +3414,7 @@ ole_type_major_version(pTypeInfo)
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
ver = INT2FIX(pTypeAttr->wMajorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
@@ -3443,7 +3443,7 @@ ole_type_minor_version(pTypeInfo)
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
ver = INT2FIX(pTypeAttr->wMinorVerNum);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return ver;
@@ -3472,7 +3472,7 @@ ole_type_typekind(pTypeInfo)
HRESULT hr;
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
typekind = INT2FIX(pTypeAttr->typekind);
OLE_RELEASE_TYPEATTR(pTypeInfo, pTypeAttr);
return typekind;
@@ -3622,7 +3622,7 @@ ole_variables(pTypeInfo)
VALUE variables = rb_ary_new();
hr = OLE_GET_TYPEATTR(pTypeInfo, &pTypeAttr);
if (FAILED(hr)) {
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetTypeAttr");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetTypeAttr");
}
for(i = 0; i < pTypeAttr->cVars; i++) {
@@ -3702,7 +3702,7 @@ static ole_variable_ole_type(pTypeInfo, var_index)
VALUE type;
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetVarDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
type = ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), Qnil);
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
return type;
@@ -3731,7 +3731,7 @@ static ole_variable_ole_type_detail(pTypeInfo, var_index)
VALUE type = rb_ary_new();
hr = pTypeInfo->lpVtbl->GetVarDesc(pTypeInfo, var_index, &pVarDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetVarDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetVarDesc");
ole_typedesc2val(pTypeInfo, &(pVarDesc->elemdescVar.tdesc), type);
pTypeInfo->lpVtbl->ReleaseVarDesc(pTypeInfo, pVarDesc);
return type;
@@ -3970,7 +3970,7 @@ ole_method_return_type(pTypeInfo, method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
type = ole_typedesc2val(pTypeInfo, &(pFuncDesc->elemdescFunc.tdesc), Qnil);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
@@ -4002,7 +4002,7 @@ ole_method_return_vtype(pTypeInfo, method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
vt = INT2FIX(pFuncDesc->elemdescFunc.tdesc.vt);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
@@ -4066,7 +4066,7 @@ ole_method_invkind(pTypeInfo, method_index)
VALUE invkind;
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if(FAILED(hr))
- ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "Fail to GetFuncDesc");
+ ole_raise(hr, eWIN32OLE_RUNTIME_ERROR, "failed to GetFuncDesc");
invkind = INT2FIX(pFuncDesc->invkind);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return invkind;
@@ -5269,7 +5269,7 @@ fev_initialize(argc, argv, self)
rb_scan_args(argc, argv, "11", &ole, &itf);
if (!rb_obj_is_kind_of(ole, cWIN32OLE)) {
- rb_raise(rb_eTypeError, "1st parametor must be WIN32OLE object.");
+ rb_raise(rb_eTypeError, "1st parameter must be WIN32OLE object.");
}
if(TYPE(itf) != T_NIL) {
@@ -5285,7 +5285,7 @@ fev_initialize(argc, argv, self)
hr = find_default_source(ole, &iid, &pTypeInfo);
}
if (FAILED(hr)) {
- ole_raise(hr, rb_eRuntimeError, "not found interface");
+ ole_raise(hr, rb_eRuntimeError, "interface not found");
}
OLEData_Get_Struct(ole, pole);
@@ -5296,7 +5296,7 @@ fev_initialize(argc, argv, self)
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
ole_raise(hr, rb_eRuntimeError,
- "fail to query IConnectionPointContainer");
+ "failed to query IConnectionPointContainer");
}
hr = pContainer->lpVtbl->FindConnectionPoint(pContainer,
@@ -5305,7 +5305,7 @@ fev_initialize(argc, argv, self)
OLE_RELEASE(pContainer);
if (FAILED(hr)) {
OLE_RELEASE(pTypeInfo);
- ole_raise(hr, rb_eRuntimeError, "fail to query IConnectionPoint");
+ ole_raise(hr, rb_eRuntimeError, "failed to query IConnectionPoint");
}
pIEV = EVENTSINK_Constructor();
pIEV->m_iid = iid;
diff --git a/file.c b/file.c
index 2ae9be98cf..a236e2aab7 100644
--- a/file.c
+++ b/file.c
@@ -2116,7 +2116,7 @@ rb_file_s_umask(argc, argv)
omask = umask(NUM2INT(argv[0]));
}
else {
- rb_raise(rb_eArgError, "wrong number of argument");
+ rb_raise(rb_eArgError, "wrong number of arguments");
}
return INT2FIX(omask);
}
@@ -2996,7 +2996,7 @@ test_check(n, argc, argv)
int i;
n+=1;
- if (n != argc) rb_raise(rb_eArgError, "wrong number of arguments(%d for %d)", argc, n);
+ if (n != argc) rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", argc, n);
for (i=1; i<n; i++) {
switch (TYPE(argv[i])) {
case T_STRING:
diff --git a/hash.c b/hash.c
index 63797b84e8..2a2ab23e27 100644
--- a/hash.c
+++ b/hash.c
@@ -286,7 +286,7 @@ rb_hash_s_create(argc, argv, klass)
}
if (argc % 2 != 0) {
- rb_raise(rb_eArgError, "odd number args for Hash");
+ rb_raise(rb_eArgError, "odd number of arguments for Hash");
}
hash = hash_alloc(klass);
@@ -803,7 +803,7 @@ rb_hash_select(argc, argv, hash)
VALUE result;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new();
rb_hash_foreach(hash, select_i, result);
@@ -2019,7 +2019,7 @@ env_select(argc, argv)
char **env;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new();
env = GET_ENVIRON(environ);
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 77f7e2880a..e4acfd3138 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -30,7 +30,7 @@
# See http://www.w3.org/CGI/ for more information on the CGI
# protocol.
-raise "Please, use ruby1.5.4 or later." if RUBY_VERSION < "1.5.4"
+raise "Please, use ruby 1.5.4 or later." if RUBY_VERSION < "1.5.4"
require 'English'
diff --git a/lib/csv.rb b/lib/csv.rb
index 205c3385c4..09c638ceaf 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -557,7 +557,7 @@ class CSV
private
def initialize(dev)
- raise RuntimeError.new('do not instanciate this class directly')
+ raise RuntimeError.new('do not instantiate this class directly')
end
def get_row(row)
@@ -709,7 +709,7 @@ class CSV
private
def initialize(dev)
- raise RuntimeError.new('do not instanciate this class directly')
+ raise RuntimeError.new('do not instantiate this class directly')
end
def terminate
@@ -801,7 +801,7 @@ class CSV
# end
# end
#
- class StreamBuf # pure virtual. (do not instanciate it directly)
+ class StreamBuf # pure virtual. (do not instantiate it directly)
# get a char or a partial string from the stream.
# idx: index of a string to specify a start point of a string to get.
@@ -893,7 +893,7 @@ class CSV
return idx_is_eos?(0)
end
- # WARN: Do not instanciate this class directly. Define your own class
+ # WARN: Do not instantiate this class directly. Define your own class
# which derives this class and define 'read' instance method.
def initialize
@buf_list = []
diff --git a/lib/delegate.rb b/lib/delegate.rb
index 6ceaa67d29..cccaea8570 100644
--- a/lib/delegate.rb
+++ b/lib/delegate.rb
@@ -111,6 +111,9 @@ def DelegateClass(superclass)
def __getobj__
@_dc_obj
end
+ def __setobj__(obj)
+ @_dc_obj = obj
+ end
return klass;
end
diff --git a/lib/generator.rb b/lib/generator.rb
index 805e7a2630..a010559b60 100644
--- a/lib/generator.rb
+++ b/lib/generator.rb
@@ -125,7 +125,7 @@ class Generator
# Returns the element at the current position and moves forward.
def next()
if end?
- raise EOFError, "no more element is supplied"
+ raise EOFError, "no more elements available"
end
if @cont_next = callcc { |c| c }
@@ -140,7 +140,7 @@ class Generator
# Returns the element at the current position.
def current()
if @queue.empty?
- raise EOFError, "no more element is supplied"
+ raise EOFError, "no more elements available"
end
@queue.first
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 7abde21670..0b7e20633b 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -121,7 +121,7 @@ module Net # :nodoc:
#
# def fetch( uri_str, limit = 10 )
# # You should choose better exception.
- # raise ArgumentError, 'http redirect too deep' if limit == 0
+ # raise ArgumentError, 'HTTP redirect too deep' if limit == 0
#
# response = Net::HTTP.get_response(URI.parse(uri_str))
# case response
@@ -480,7 +480,7 @@ module Net # :nodoc:
# Finishes HTTP session and closes TCP connection.
# Raises IOError if not started.
def finish
- raise IOError, 'HTTP session not started yet' unless started?
+ raise IOError, 'HTTP session not yet started' unless started?
do_finish
end
@@ -2058,11 +2058,11 @@ e @header.each_key(&block)
end
def stream_check
- raise IOError, 'try to read body out of block' if @socket.closed?
+ raise IOError, 'attempt to read body out of block' if @socket.closed?
end
def procdest(dest, block)
- raise ArgumentError, 'both of arg and block are given for HTTP method' \
+ raise ArgumentError, 'both arg and block given for HTTP method' \
if dest and block
if block
ReadAdapter.new(block)
diff --git a/lib/net/https.rb b/lib/net/https.rb
index 4200be3d62..a22084dc99 100644
--- a/lib/net/https.rb
+++ b/lib/net/https.rb
@@ -123,7 +123,7 @@ module Net
# a Net::HTTP object raises IOError.
def use_ssl=(flag)
flag = (flag ? true : false)
- raise IOError, "use_ssl value changed but session already started" \
+ raise IOError, "use_ssl value changed, but session already started" \
if started? and @use_ssl != flag
if flag and not @ssl_context
@ssl_context = OpenSSL::SSL::SSLContext.new
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 85bef3c391..641d50e41f 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -859,7 +859,7 @@ module Net # :nodoc:
# firewall.
# Errno::ETIMEDOUT:: connection timed out (possibly due to packets
# being dropped by an intervening firewall).
- # Errno::NETUNREACH:: there is no route to that network.
+ # Errno::ENETUNREACH:: there is no route to that network.
# SocketError:: hostname not known or other socket error.
# Net::IMAP::ByeResponseError:: we connected to the host, but they
# immediately said goodbye to us.
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index 4a27bac0b8..21b58aa503 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -293,7 +293,7 @@ module Net
# This method must not be called while POP3 session is opened.
# This method raises POPAuthenticationError if authentication fails.
def auth_only(account, password)
- raise IOError, 'opening already opened POP session' if started?
+ raise IOError, 'opening previously opened POP session' if started?
start(account, password) {
;
}
@@ -449,7 +449,7 @@ module Net
# Finishes a POP3 session and closes TCP connection.
def finish
- raise IOError, 'POP session not started yet' unless started?
+ raise IOError, 'POP session not yet started' unless started?
do_finish
end
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb
index 123d31d205..9a5e84620f 100644
--- a/lib/net/smtp.rb
+++ b/lib/net/smtp.rb
@@ -373,7 +373,7 @@ module Net # :nodoc:
# Finishes the SMTP session and closes TCP connection.
# Raises IOError if not started.
def finish
- raise IOError, 'not started yet' unless started?
+ raise IOError, 'not yet started' unless started?
do_finish
end
@@ -474,7 +474,7 @@ module Net # :nodoc:
def send0( from_addr, to_addrs )
raise IOError, 'closed session' unless @socket
- raise ArgumentError, 'mail destination does not given' if to_addrs.empty?
+ raise ArgumentError, 'mail destination not given' if to_addrs.empty?
if $SAFE > 0
raise SecurityError, 'tainted from_addr' if from_addr.tainted?
to_addrs.each do |to|
@@ -501,7 +501,7 @@ module Net # :nodoc:
private
def check_auth_args( user, secret, authtype )
- raise ArgumentError, 'both of user and secret are required'\
+ raise ArgumentError, 'both user and secret are required'\
unless user and secret
auth_method = "auth_#{authtype || 'cram_md5'}"
raise ArgumentError, "wrong auth type #{authtype}"\
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index 84acdb9984..75ce63a288 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -501,7 +501,7 @@ module URI
if proxy_uri
proxy_uri = URI.parse(proxy_uri)
unless URI::HTTP === proxy_uri
- raise "Non-http proxy URI: #{proxy_uri}"
+ raise "Non-HTTP proxy URI: #{proxy_uri}"
end
name = 'no_proxy'
if no_proxy = ENV[name] || ENV[name.upcase]
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index b0bb775263..464fff0cdf 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -63,7 +63,7 @@ class OpenStruct
len = args.length
if mname =~ /=$/
if len != 1
- raise ArgumentError, "wrong # of arguments (#{len} for 1)", caller(1)
+ raise ArgumentError, "wrong number of arguments (#{len} for 1)", caller(1)
end
if self.frozen?
raise TypeError, "can't modify frozen #{self.class}", caller(1)
diff --git a/lib/rational.rb b/lib/rational.rb
index 38af7b8a81..2019363ac6 100644
--- a/lib/rational.rb
+++ b/lib/rational.rb
@@ -48,7 +48,7 @@ class Rational < Numeric
@RCS_ID='-$Id: rational.rb,v 1.7 1999/08/24 12:49:28 keiju Exp keiju $-'
def Rational.reduce(num, den = 1)
- raise ZeroDivisionError, "denominator is 0" if den == 0
+ raise ZeroDivisionError, "denominator is zero" if den == 0
if den < 0
num = -num
@@ -135,7 +135,7 @@ class Rational < Numeric
den = @denominator * a.numerator
Rational(num, den)
elsif a.kind_of?(Integer)
- raise ZeroDivisionError, "divided by 0" if a == 0
+ raise ZeroDivisionError, "division by zero" if a == 0
self / Rational.new!(a, 1)
elsif a.kind_of?(Float)
Float(self) / a
diff --git a/lib/resolv.rb b/lib/resolv.rb
index edc17c2f19..ad52882582 100644
--- a/lib/resolv.rb
+++ b/lib/resolv.rb
@@ -1157,9 +1157,9 @@ class Resolv
@limit = @index + len
d = yield(len)
if @index < @limit
- raise DecodeError.new("junk exist")
+ raise DecodeError.new("junk exists")
elsif @limit < @index
- raise DecodeError.new("limit exceed")
+ raise DecodeError.new("limit exceeded")
end
@limit = save_limit
return d
@@ -1185,7 +1185,7 @@ class Resolv
raise StandardError.new("unsupported template: '#{byte.chr}' in '#{template}'")
end
}
- raise DecodeError.new("limit exceed") if @limit < @index + len
+ raise DecodeError.new("limit exceeded") if @limit < @index + len
arr = @data.unpack("@#{@index}#{template}")
@index += len
return arr
@@ -1193,7 +1193,7 @@ class Resolv
def get_string
len = @data[@index]
- raise DecodeError.new("limit exceed") if @limit < @index + 1 + len
+ raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len
d = @data[@index + 1, len]
@index += 1 + len
return d
@@ -1554,7 +1554,7 @@ class Resolv
raise ArgumentError.new("IPv4 address with invalid value: " + arg)
end
else
- raise ArgumentError.new("cannot interprete as IPv4 address: #{arg.inspect}")
+ raise ArgumentError.new("cannot interpret as IPv4 address: #{arg.inspect}")
end
end
@@ -1662,7 +1662,7 @@ class Resolv
end
return IPv6.new(address)
else
- raise ArgumentError.new("cannot interprete as IPv6 address: #{arg.inspect}")
+ raise ArgumentError.new("cannot interpret as IPv6 address: #{arg.inspect}")
end
end
diff --git a/lib/singleton.rb b/lib/singleton.rb
index 2954bfa153..18fda0bc58 100644
--- a/lib/singleton.rb
+++ b/lib/singleton.rb
@@ -13,7 +13,7 @@
# a == b # => true
# a.new # NoMethodError - new is private ...
#
-# * ``The instance'' is created at instanciation time, in other
+# * ``The instance'' is created at instantiation time, in other
# words the first call of Klass.instance(), thus
#
# class OtherKlass
@@ -44,11 +44,11 @@
#
# * Klass._load(str) - calling Klass.instance()
#
-# * Klass._instanciate?() - returning ``the instance'' or
+# * Klass._instantiate?() - returning ``the instance'' or
# nil. This hook method puts a second (or nth) thread calling
# Klass.instance() on a waiting loop. The return value
# signifies the successful completion or premature termination
-# of the first, or more generally, current "instanciation thread".
+# of the first, or more generally, current "instantiation thread".
#
#
# The instance method of Singleton are
@@ -103,7 +103,7 @@ class << Singleton
@__instance__ = nil # failed instance creation
end
end
- elsif _instanciate?()
+ elsif _instantiate?()
Thread.critical = false
else
@__instance__ = false
@@ -144,7 +144,7 @@ class << Singleton
end
# waiting-loop hook
- def _instanciate?()
+ def _instantiate?()
while false.equal?(@__instance__)
Thread.critical = false
sleep(0.08) # timeout
@@ -209,7 +209,7 @@ end
-puts "\nThreaded example with exception and customized #_instanciate?() hook"; p
+puts "\nThreaded example with exception and customized #_instantiate?() hook"; p
Thread.abort_on_exception = false
class Ups < SomeSingletonClass
@@ -220,7 +220,7 @@ class Ups < SomeSingletonClass
end
class << Ups
- def _instanciate?
+ def _instantiate?
@enter.push Thread.current[:i]
while false.equal?(@__instance__)
Thread.critical = false
@@ -247,7 +247,7 @@ class << Ups
end
end
- def instanciate_all
+ def instantiate_all
@enter = []
@leave = []
1.upto(9) {|i|
@@ -270,7 +270,7 @@ class << Ups
end
-Ups.instanciate_all
+Ups.instantiate_all
# results in message like
# Before there were 0 Ups instance(s)
# boom - thread #6 failed to create instance
@@ -293,7 +293,7 @@ def Yup.new
end
end
end
-Yup.instanciate_all
+Yup.instantiate_all
puts "\n\n","Customized marshalling"
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index a78b9469db..38a72e1255 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -9,7 +9,7 @@ require 'tmpdir'
# A class for managing temporary files. This library is written to be
# thread safe.
-class Tempfile < SimpleDelegator
+class Tempfile < DelegateClass(File)
MAX_TRY = 10
@@cleanlist = []
diff --git a/lib/wsdl/operation.rb b/lib/wsdl/operation.rb
index be28446d34..228dc85b05 100644
--- a/lib/wsdl/operation.rb
+++ b/lib/wsdl/operation.rb
@@ -119,7 +119,7 @@ private
return parts.dup
end
if parts.length != result.length
- raise RuntimeError.new("Incomplete prarmeterOrder list.")
+ raise RuntimeError.new("Incomplete parameter order list.")
end
result
end
diff --git a/lib/xmlrpc/parser.rb b/lib/xmlrpc/parser.rb
index 357618261e..da214ba1ce 100644
--- a/lib/xmlrpc/parser.rb
+++ b/lib/xmlrpc/parser.rb
@@ -467,7 +467,7 @@ module XMLRPC
else
# is a normal return value
raise "Missing return value!" if parser.params.size == 0
- raise "To many return values. Only one allowed!" if parser.params.size > 1
+ raise "Too many return values. Only one allowed!" if parser.params.size > 1
[true, parser.params[0]]
end
end
diff --git a/re.c b/re.c
index cd379b157e..d761bb2e98 100644
--- a/re.c
+++ b/re.c
@@ -1256,7 +1256,7 @@ match_select(argc, argv, match)
VALUE match;
{
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
else {
struct re_registers *regs = RMATCH(match)->regs;
@@ -1657,7 +1657,7 @@ rb_reg_initialize_m(argc, argv, self)
rb_check_frozen(self);
if (argc == 0 || argc > 3) {
- rb_raise(rb_eArgError, "wrong number of argument");
+ rb_raise(rb_eArgError, "wrong number of arguments");
}
if (TYPE(argv[0]) == T_REGEXP) {
if (argc > 1) {
diff --git a/sprintf.c b/sprintf.c
index 6de45618c8..df586c4a15 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -108,7 +108,7 @@ sign_bits(base, p)
(posarg = -1, GETNTHARG(n))))
#define GETNTHARG(nth) \
- ((nth >= argc) ? (rb_raise(rb_eArgError, "too few argument."), 0) : argv[nth])
+ ((nth >= argc) ? (rb_raise(rb_eArgError, "too few arguments."), 0) : argv[nth])
#define GETASTER(val) do { \
t = p++; \
@@ -716,7 +716,7 @@ rb_f_sprintf(argc, argv)
* the format string may contain `n$'-style argument selector.
*/
if (RTEST(ruby_verbose) && nextarg < argc) {
- rb_raise(rb_eArgError, "too many argument for format string");
+ rb_raise(rb_eArgError, "too many arguments for format string");
}
#endif
rb_str_resize(result, blen);
diff --git a/string.c b/string.c
index b1ea3cd44a..d5a62aadec 100644
--- a/string.c
+++ b/string.c
@@ -1566,7 +1566,7 @@ rb_str_aref_m(argc, argv, str)
return rb_str_substr(str, NUM2LONG(argv[0]), NUM2LONG(argv[1]));
}
if (argc != 1) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
return rb_str_aref(str, argv[0]);
}
@@ -1760,7 +1760,7 @@ rb_str_aset_m(argc, argv, str)
return argv[2];
}
if (argc != 2) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 2)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
}
return rb_str_aset(str, argv[0], argv[1]);
}
@@ -1833,7 +1833,7 @@ rb_str_slice_bang(argc, argv, str)
int i;
if (argc < 1 || 2 < argc) {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 1)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 1)", argc);
}
for (i=0; i<argc; i++) {
buf[i] = argv[i];
@@ -1907,7 +1907,7 @@ rb_str_sub_bang(argc, argv, str)
if (OBJ_TAINTED(repl)) tainted = 1;
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 2)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
}
pat = get_pat(argv[0], 1);
@@ -2011,7 +2011,7 @@ str_gsub(argc, argv, str, bang)
if (OBJ_TAINTED(repl)) tainted = 1;
}
else {
- rb_raise(rb_eArgError, "wrong number of arguments(%d for 2)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)", argc);
}
pat = get_pat(argv[0], 1);
diff --git a/struct.c b/struct.c
index 1a8c44ad02..9bfd3bca03 100644
--- a/struct.c
+++ b/struct.c
@@ -734,7 +734,7 @@ rb_struct_select(argc, argv, s)
long i;
if (argc > 0) {
- rb_raise(rb_eArgError, "wrong number arguments(%d for 0)", argc);
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc);
}
result = rb_ary_new();
for (i = 0; i < RSTRUCT(s)->len; i++) {
diff --git a/time.c b/time.c
index 0fedb94c98..0e9fb2faac 100644
--- a/time.c
+++ b/time.c
@@ -1816,7 +1816,7 @@ time_mdump(time)
tm = gmtime(&t);
if ((tm->tm_year & 0x1ffff) != tm->tm_year)
- rb_raise(rb_eArgError, "too big year to marshal");
+ rb_raise(rb_eArgError, "year too big to marshal");
p = 0x1 << 31 | /* 1 */
tm->tm_year << 14 | /* 17 */