From 27ddb6e99848c397a415b785315896ab50308076 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada
Date: Fri, 20 Dec 2019 01:01:17 +0900
Subject: [PATCH 001/878] Warn also numbered parameter like parameters
[Feature #16433]
---
parse.y | 14 ++++++++++----
test/ripper/test_scanner_events.rb | 2 +-
test/ruby/test_syntax.rb | 2 ++
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/parse.y b/parse.y
index 7de84ee70006f3..33c1c89c3d654f 100644
--- a/parse.y
+++ b/parse.y
@@ -11829,19 +11829,25 @@ node_newnode_with_locals(struct parser_params *p, enum node_type type, VALUE a1,
#endif
+static void
+numparam_name(struct parser_params *p, ID id)
+{
+ if (!NUMPARAM_ID_P(id)) return;
+ rb_warn1("`_%d' is used as numbered parameter",
+ WARN_I(NUMPARAM_ID_TO_IDX(id)));
+}
+
static void
arg_var(struct parser_params *p, ID id)
{
+ numparam_name(p, id);
vtable_add(p->lvtbl->args, id);
}
static void
local_var(struct parser_params *p, ID id)
{
- if (NUMPARAM_ID_P(id)) {
- rb_warn1("`_%d' is used as numbered parameter",
- WARN_I(NUMPARAM_ID_TO_IDX(id)));
- }
+ numparam_name(p, id);
vtable_add(p->lvtbl->vars, id);
if (p->lvtbl->used) {
vtable_add(p->lvtbl->used, (ID)p->ruby_sourceline);
diff --git a/test/ripper/test_scanner_events.rb b/test/ripper/test_scanner_events.rb
index ffe2ea1e37b3cc..cef584c157770d 100644
--- a/test/ripper/test_scanner_events.rb
+++ b/test/ripper/test_scanner_events.rb
@@ -31,7 +31,7 @@ def scan(target, str, &error)
alias compile_error on_error
end
end
- lexer.lex.select {|_1,type,_2| type == sym }.map {|_1,_2,tok| tok }
+ lexer.lex.select {|_,type,_| type == sym }.map {|_,_,tok| tok }
end
def test_tokenize
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 286beb7074b95b..b292b248949ca8 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1439,6 +1439,8 @@ def test_numbered_parameter
assert_syntax_error('proc {_1; _1 = nil}', /Can't assign to numbered parameter _1/)
assert_warn(/`_1' is used as numbered parameter/) {eval('proc {_1 = nil}')}
assert_warn(/`_2' is used as numbered parameter/) {eval('_2=1')}
+ assert_warn(/`_3' is used as numbered parameter/) {eval('proc {|_3|}')}
+ assert_warn(/`_4' is used as numbered parameter/) {instance_eval('def x(_4) end')}
assert_raise_with_message(NameError, /undefined local variable or method `_1'/) {
eval('_1')
}
From 844f1fada6f364dc26bd6eb6de2c4299a69e272a Mon Sep 17 00:00:00 2001
From: git
Date: Fri, 20 Dec 2019 01:37:11 +0900
Subject: [PATCH 002/878] * 2019-12-20 [ci skip]
---
version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.h b/version.h
index 178369ded32048..fa1805ec43d61a 100644
--- a/version.h
+++ b/version.h
@@ -6,7 +6,7 @@
#define RUBY_RELEASE_YEAR 2019
#define RUBY_RELEASE_MONTH 12
-#define RUBY_RELEASE_DAY 19
+#define RUBY_RELEASE_DAY 20
#include "ruby/version.h"
From 3816cd945d68eac7ca8fecbc9d71f878ff3e7b3d Mon Sep 17 00:00:00 2001
From: Kazuhiro NISHIYAMA
Date: Fri, 20 Dec 2019 01:40:00 +0900
Subject: [PATCH 003/878] Add `URI#open` to warning message
---
lib/open-uri.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index c099eba6a0cdc3..c52f67f525c25c 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -15,7 +15,7 @@ def open(name, *rest, **kw, &block) # :nodoc:
(name.respond_to?(:to_str) &&
%r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} =~ name &&
(uri = URI.parse(name)).respond_to?(:open))
- warn('calling URI.open via Kernel#open is deprecated, call URI.open directly', uplevel: 1)
+ warn('calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open', uplevel: 1)
URI.open(name, *rest, **kw, &block)
else
open_uri_original_open(name, *rest, **kw, &block)
From 2898367b3a1de00ca78067cc17dd4d1f8df37778 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada
Date: Fri, 20 Dec 2019 08:18:19 +0900
Subject: [PATCH 004/878] Warn also numbered parameter like methods
---
parse.y | 3 +++
test/ruby/test_syntax.rb | 2 ++
2 files changed, 5 insertions(+)
diff --git a/parse.y b/parse.y
index 33c1c89c3d654f..7247afafa3332f 100644
--- a/parse.y
+++ b/parse.y
@@ -188,6 +188,7 @@ numparam_id_p(ID id)
unsigned int idx = NUMPARAM_ID_TO_IDX(id);
return idx > 0 && idx <= NUMPARAM_MAX;
}
+static void numparam_name(struct parser_params *p, ID id);
#define DVARS_INHERIT ((void*)1)
#define DVARS_TOPSCOPE NULL
@@ -2981,6 +2982,7 @@ primary : literal
}
| k_def fname
{
+ numparam_name(p, get_id($2));
local_push(p, 0);
$$ = p->cur_arg;
p->cur_arg = 0;
@@ -3007,6 +3009,7 @@ primary : literal
}
| k_def singleton dot_or_colon {SET_LEX_STATE(EXPR_FNAME);} fname
{
+ numparam_name(p, get_id($5));
$4 = p->in_def;
p->in_def = 1;
SET_LEX_STATE(EXPR_ENDFN|EXPR_LABEL); /* force for args */
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index b292b248949ca8..5eb69c514422ec 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1441,6 +1441,8 @@ def test_numbered_parameter
assert_warn(/`_2' is used as numbered parameter/) {eval('_2=1')}
assert_warn(/`_3' is used as numbered parameter/) {eval('proc {|_3|}')}
assert_warn(/`_4' is used as numbered parameter/) {instance_eval('def x(_4) end')}
+ assert_warn(/`_5' is used as numbered parameter/) {instance_eval('def _5; end')}
+ assert_warn(/`_6' is used as numbered parameter/) {instance_eval('def self._6; end')}
assert_raise_with_message(NameError, /undefined local variable or method `_1'/) {
eval('_1')
}
From db166290088fb7d39d01f68b9860253893d4f1a7 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada
Date: Fri, 20 Dec 2019 09:19:39 +0900
Subject: [PATCH 005/878] Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
---
basictest/test.rb | 2 +-
compile.c | 2 +-
cont.c | 2 +-
defs/gmake.mk | 2 +-
defs/separated_version.mk | 2 +-
doc/NEWS-2.5.0 | 2 +-
doc/contributing.rdoc | 2 +-
doc/extension.rdoc | 2 +-
doc/syntax/miscellaneous.rdoc | 2 +-
gc.c | 2 +-
include/ruby/backward/cxxanyargs.hpp | 42 +++++++++----------
iseq.c | 4 +-
man/ruby.1 | 2 +-
misc/rb_optparse.zsh | 2 +-
process.c | 2 +-
range.c | 4 +-
regparse.c | 2 +-
sample/drb/old_tuplespace.rb | 2 +-
sample/trick2013/kinaba/remarks.markdown | 2 +-
sample/trick2015/ksk_2/remarks.markdown | 4 +-
spec/ruby/core/argf/binmode_spec.rb | 2 +-
spec/ruby/core/env/delete_spec.rb | 2 +-
spec/ruby/core/file/chmod_spec.rb | 2 +-
spec/ruby/core/integer/comparison_spec.rb | 2 +-
.../core/kernel/singleton_methods_spec.rb | 12 +++---
spec/ruby/core/module/alias_method_spec.rb | 2 +-
spec/ruby/core/module/autoload_spec.rb | 2 +-
spec/ruby/core/string/undump_spec.rb | 2 +-
spec/ruby/core/time/new_spec.rb | 2 +-
spec/ruby/language/regexp/modifiers_spec.rb | 2 +-
.../library/socket/ipsocket/recvfrom_spec.rb | 2 +-
spec/ruby/optional/capi/io_spec.rb | 2 +-
st.c | 2 +-
.../popen_deadlock/test_popen_deadlock.rb | 2 +-
test/ruby/sentence.rb | 2 +-
test/ruby/test_assignment.rb | 2 +-
test/ruby/test_struct.rb | 2 +-
time.c | 2 +-
tool/lib/tracepointchecker.rb | 2 +-
tool/mkconfig.rb | 2 +-
tool/redmine-backporter.rb | 4 +-
vm.c | 6 +--
vm_dump.c | 2 +-
vm_insnhelper.c | 8 ++--
win32/file.c | 2 +-
45 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/basictest/test.rb b/basictest/test.rb
index 10ea28d320701f..25a42982341beb 100755
--- a/basictest/test.rb
+++ b/basictest/test.rb
@@ -1732,7 +1732,7 @@ def shift_test(a)
test_ok(defined?(a))
test_ok(a == nil)
-# multiple asignment
+# multiple assignment
a, b = 1, 2
test_ok(a == 1 && b == 2)
diff --git a/compile.c b/compile.c
index 1e6400448c75c5..98ee34afd02d1d 100644
--- a/compile.c
+++ b/compile.c
@@ -6827,7 +6827,7 @@ delegate_call_p(const rb_iseq_t *iseq, unsigned int argc, const LINK_ANCHOR *arg
}
}
else {
- goto fail; // level != 0 is unsupport
+ goto fail; // level != 0 is unsupported
}
}
else {
diff --git a/cont.c b/cont.c
index 87f1fd0157a598..793bce018bc195 100644
--- a/cont.c
+++ b/cont.c
@@ -2367,7 +2367,7 @@ rb_fiber_pool_initialize(int argc, VALUE* argv, VALUE self)
VALUE size = Qnil, count = Qnil, vm_stack_size = Qnil;
struct fiber_pool * fiber_pool = NULL;
- // Maybe these should be keyworkd arguments.
+ // Maybe these should be keyword arguments.
rb_scan_args(argc, argv, "03", &size, &count, &vm_stack_size);
if (NIL_P(size)) {
diff --git a/defs/gmake.mk b/defs/gmake.mk
index 8ff17d993f8016..226e1066a529bf 100644
--- a/defs/gmake.mk
+++ b/defs/gmake.mk
@@ -90,7 +90,7 @@ sudo-precheck: test yes-test-testframework no-test-testframework
install-prereq: sudo-precheck
yes-test-all no-test-all: install
endif
-# Cross referece needs to parse all files at once
+# Cross reference needs to parse all files at once
love install reinstall: RDOCFLAGS = --force-update
$(srcdir)/missing/des_tables.c: $(srcdir)/missing/crypt.c
diff --git a/defs/separated_version.mk b/defs/separated_version.mk
index f086f4b24a4f7c..72ee093da73663 100644
--- a/defs/separated_version.mk
+++ b/defs/separated_version.mk
@@ -1,6 +1,6 @@
# ******** FOR DEVELEPERS ONLY ********
# Separate version.o into a shared library which varies every
-# revisions, in order to make the rest sharable.
+# revisions, in order to make the rest shareable.
include $(firstword $(wildcard GNUmakefile Makefile))
diff --git a/doc/NEWS-2.5.0 b/doc/NEWS-2.5.0
index 221c0328c10ce5..c891317b61ca45 100644
--- a/doc/NEWS-2.5.0
+++ b/doc/NEWS-2.5.0
@@ -68,7 +68,7 @@ with all sufficient information, see the ChangeLog file or Redmine
* File.rename releases GVL. [Feature #13951]
* File::Stat#atime, File::Stat#mtime and File::Stat#ctime support fractional
second timestamps on Windows 8 and later. [Feature #13726]
- * File::Stat#ino and File.indentical? support ReFS 128bit ino on Windows 8.1
+ * File::Stat#ino and File.identical? support ReFS 128bit ino on Windows 8.1
and later. [Feature #13731]
* File.readable?, File.readable_real?, File.writable?, File.writable_real?,
File.executable?, File.executable_real?, File.mkfifo, File.readlink,
diff --git a/doc/contributing.rdoc b/doc/contributing.rdoc
index 95e5b6dd285e00..68dda66e461204 100644
--- a/doc/contributing.rdoc
+++ b/doc/contributing.rdoc
@@ -389,7 +389,7 @@ When you're ready to commit:
This will open your editor in which you write your commit message.
Use the following style for commit messages:
-* Use a succint subject line.
+* Use a succinct subject line.
* Include reasoning behind the change in the commit message, focusing on why
the change is being made.
* Refer to redmine issue (such as Fixes [Bug #1234] or Implements
diff --git a/doc/extension.rdoc b/doc/extension.rdoc
index 79d25e4249dd1b..79eb96d518005a 100644
--- a/doc/extension.rdoc
+++ b/doc/extension.rdoc
@@ -726,7 +726,7 @@ RUBY_TYPED_FREE_IMMEDIATELY ::
You can specify this flag if the dfree never unlocks Ruby's
internal lock (GVL).
- If this flag is not set, Ruby defers invokation of dfree()
+ If this flag is not set, Ruby defers invocation of dfree()
and invokes dfree() at the same time as finalizers.
RUBY_TYPED_WB_PROTECTED ::
diff --git a/doc/syntax/miscellaneous.rdoc b/doc/syntax/miscellaneous.rdoc
index d5691f8d6083b2..87ec059ae79110 100644
--- a/doc/syntax/miscellaneous.rdoc
+++ b/doc/syntax/miscellaneous.rdoc
@@ -13,7 +13,7 @@ most frequently used with ruby -e.
Ruby does not require any indentation. Typically, ruby programs are indented
two spaces.
-If you run ruby with warnings enabled and have an indentation mis-match, you
+If you run ruby with warnings enabled and have an indentation mismatch, you
will receive a warning.
== +alias+
diff --git a/gc.c b/gc.c
index 0f9361a03cdd86..ab7662b534ad0e 100644
--- a/gc.c
+++ b/gc.c
@@ -86,7 +86,7 @@
#pragma intrinsic(_umul128)
#endif
-/* Expecting this struct to be elminated by function inlinings */
+/* Expecting this struct to be eliminated by function inlinings */
struct optional {
bool left;
size_t right;
diff --git a/include/ruby/backward/cxxanyargs.hpp b/include/ruby/backward/cxxanyargs.hpp
index a2e63f2943e2f6..3585f678b8d77a 100644
--- a/include/ruby/backward/cxxanyargs.hpp
+++ b/include/ruby/backward/cxxanyargs.hpp
@@ -47,7 +47,7 @@ typedef int int_type(ANYARGS);
/// @name Hooking global variables
/// @{
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Getter function.
@@ -63,7 +63,7 @@ rb_define_virtual_variable(const char *q, type *w, void_type *e)
::rb_define_virtual_variable(q, r, t);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Getter function.
@@ -78,7 +78,7 @@ rb_define_virtual_variable(const char *q, rb_gvar_getter_t *w, void_type *e)
::rb_define_virtual_variable(q, w, t);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Getter function.
@@ -93,7 +93,7 @@ rb_define_virtual_variable(const char *q, type *w, rb_gvar_setter_t *e)
::rb_define_virtual_variable(q, r, e);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Variable storage.
@@ -110,7 +110,7 @@ rb_define_hooked_variable(const char *q, VALUE *w, type *e, void_type *r)
::rb_define_hooked_variable(q, w, t, y);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Variable storage.
@@ -126,7 +126,7 @@ rb_define_hooked_variable(const char *q, VALUE *w, rb_gvar_getter_t *e, void_typ
::rb_define_hooked_variable(q, w, e, y);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Define a function-backended global variable.
/// @param[in] q Name of the variable.
/// @param[in] w Variable storage.
@@ -146,7 +146,7 @@ rb_define_hooked_variable(const char *q, VALUE *w, type *e, rb_gvar_setter_t *r)
/// @name Exceptions and tag jumps
/// @{
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Old way to implement iterators.
/// @param[in] q A function that can yield.
/// @param[in] w Passed to `q`.
@@ -163,7 +163,7 @@ rb_iterate(VALUE(*q)(VALUE), VALUE w, type *e, VALUE r)
return ::rb_iterate(q, w, t, r);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Call a method with a block.
/// @param[in] q The self.
/// @param[in] w The method.
@@ -181,7 +181,7 @@ rb_block_call(VALUE q, ID w, int e, const VALUE *r, type *t, VALUE y)
return ::rb_block_call(q, w, e, r, u, y);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `rescue` clause.
/// @param[in] q A function that can raise.
/// @param[in] w Passed to `q`.
@@ -204,7 +204,7 @@ rb_rescue(type *q, VALUE w, type *e, VALUE r)
return ::rb_rescue(t, w, y, r);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `rescue` clause.
/// @param[in] q A function that can raise.
/// @param[in] w Passed to `q`.
@@ -232,7 +232,7 @@ rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
return ret;
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `ensure` clause.
/// @param[in] q A function that can raise.
/// @param[in] w Passed to `q`.
@@ -253,7 +253,7 @@ rb_ensure(type *q, VALUE w, type *e, VALUE r)
return ::rb_ensure(t, w, y, r);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `Kernel#catch`.
/// @param[in] q The "tag" string.
/// @param[in] w A function that can throw.
@@ -272,7 +272,7 @@ rb_catch(const char *q, type *w, VALUE e)
return ::rb_catch(q, r, e);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief An equivalent of `Kernel#catch`.
/// @param[in] q The "tag" object.
/// @param[in] w A function that can throw.
@@ -295,7 +295,7 @@ rb_catch_obj(VALUE q, type *w, VALUE e)
/// @name Procs, Fibers and Threads
/// @{
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Creates a @ref rb_cFiber instance.
/// @param[in] q The fiber body.
/// @param[in] w Passed to `q`.
@@ -311,7 +311,7 @@ rb_fiber_new(type *q, VALUE w)
return ::rb_fiber_new(e, w);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Creates a @ref rb_cProc instance.
/// @param[in] q The proc body.
/// @param[in] w Passed to `q`.
@@ -327,7 +327,7 @@ rb_proc_new(type *q, VALUE w)
return ::rb_proc_new(e, w);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Creates a @ref rb_cThread instance.
/// @param[in] q The thread body.
/// @param[in] w Passed to `q`.
@@ -348,7 +348,7 @@ rb_thread_create(type *q, void *w)
/// @name Hash and st_table
/// @{
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given table.
/// @param[in] q A table to scan.
/// @param[in] w A function to iterate.
@@ -366,7 +366,7 @@ st_foreach(st_table *q, int_type *w, st_data_t e)
return ::st_foreach(q, r, e);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given table.
/// @param[in] q A table to scan.
/// @param[in] w A function to iterate.
@@ -384,7 +384,7 @@ st_foreach_check(st_table *q, int_type *w, st_data_t e, st_data_t)
return ::st_foreach_check(q, t, e, 0);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given table.
/// @param[in] q A table to scan.
/// @param[in] w A function to iterate.
@@ -400,7 +400,7 @@ st_foreach_safe(st_table *q, int_type *w, st_data_t e)
::st_foreach_safe(q, r, e);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over the given hash.
/// @param[in] q A hash to scan.
/// @param[in] w A function to iterate.
@@ -416,7 +416,7 @@ rb_hash_foreach(VALUE q, int_type *w, VALUE e)
::rb_hash_foreach(q, r, e);
}
-RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprected")
+RUBY_CXX_DEPRECATED("Use of ANYARGS in this function is deprecated")
/// @brief Iteration over each instance variable of the object.
/// @param[in] q An object.
/// @param[in] w A function to iterate.
diff --git a/iseq.c b/iseq.c
index f5f84378821699..cbf62176bd6467 100644
--- a/iseq.c
+++ b/iseq.c
@@ -932,7 +932,7 @@ iseq_load(VALUE data, const rb_iseq_t *parent, VALUE opt)
iseq_type = iseq_type_from_sym(type);
if (iseq_type == (enum iseq_type)-1) {
- rb_raise(rb_eTypeError, "unsupport type: :%"PRIsVALUE, rb_sym2str(type));
+ rb_raise(rb_eTypeError, "unsupported type: :%"PRIsVALUE, rb_sym2str(type));
}
node_id = rb_hash_aref(misc, ID2SYM(rb_intern("node_id")));
@@ -3404,7 +3404,7 @@ iseqw_s_load_from_binary_extra_data(VALUE self, VALUE str)
* To lookup the lineno of insn4, calculate rank("10100001", 8) = 3, so
* the line (B) is the entry in question.
*
- * A naive implementatoin of succinct bit-vector works really well
+ * A naive implementation of succinct bit-vector works really well
* not only for large size but also for small size. However, it has
* tiny overhead for very small size. So, this implementation consist
* of two parts: one part is the "immediate" table that keeps rank result
diff --git a/man/ruby.1 b/man/ruby.1
index 4dd19054d3c4f0..1888312d261fa0 100644
--- a/man/ruby.1
+++ b/man/ruby.1
@@ -419,7 +419,7 @@ Disables (or enables) all features.
.El
.Pp
.It Fl -dump Ns = Ns Ar target
-Dump some informations.
+Dump some information.
.Pp
Prints the specified target.
.Ar target
diff --git a/misc/rb_optparse.zsh b/misc/rb_optparse.zsh
index d53170c5f78be9..7407e87c03a5a8 100755
--- a/misc/rb_optparse.zsh
+++ b/misc/rb_optparse.zsh
@@ -13,7 +13,7 @@
#
# (3) restart zsh.
#
-# (4) geneate completion files once.
+# (4) generate completion files once.
# generate-complete-function/ruby/optparse COMMAND1
# generate-complete-function/ruby/optparse COMMAND2
#
diff --git a/process.c b/process.c
index ad303203fd4e09..60d1523fde392a 100644
--- a/process.c
+++ b/process.c
@@ -6472,7 +6472,7 @@ proc_setmaxgroups(VALUE obj, VALUE val)
int ngroups_max = get_sc_ngroups_max();
if (ngroups <= 0)
- rb_raise(rb_eArgError, "maxgroups %d shold be positive", ngroups);
+ rb_raise(rb_eArgError, "maxgroups %d should be positive", ngroups);
if (ngroups > RB_MAX_GROUPS)
ngroups = RB_MAX_GROUPS;
diff --git a/range.c b/range.c
index f701c16e6d62ce..b4fab53eac06b9 100644
--- a/range.c
+++ b/range.c
@@ -1610,12 +1610,12 @@ static VALUE
range_count(int argc, VALUE *argv, VALUE range)
{
if (argc != 0) {
- /* It is odd for instace (1...).count(0) to return Infinity. Just let
+ /* It is odd for instance (1...).count(0) to return Infinity. Just let
* it loop. */
return rb_call_super(argc, argv);
}
else if (rb_block_given_p()) {
- /* Likewise it is odd for instace (1...).count {|x| x == 0 } to return
+ /* Likewise it is odd for instance (1...).count {|x| x == 0 } to return
* Infinity. Just let it loop. */
return rb_call_super(argc, argv);
}
diff --git a/regparse.c b/regparse.c
index 5f118900de4127..a96c8c2fa7d673 100644
--- a/regparse.c
+++ b/regparse.c
@@ -4663,7 +4663,7 @@ parse_char_class(Node** np, Node** asc_np, OnigToken* tok, UChar** src, UChar* e
p = psave;
for (i = 1; i < len; i++) {
(void)fetch_token_in_cc(tok, &p, end, env);
- /* no need to check the retun value (already checked above) */
+ /* no need to check the return value (already checked above) */
}
fetched = 0;
}
diff --git a/sample/drb/old_tuplespace.rb b/sample/drb/old_tuplespace.rb
index 8be1542c06a841..2d5310086e9362 100644
--- a/sample/drb/old_tuplespace.rb
+++ b/sample/drb/old_tuplespace.rb
@@ -31,7 +31,7 @@ def match(tuple)
def initialize
@que = {}
@waiting = {}
- @que.taint # enable tainted comunication
+ @que.taint # enable tainted communication
@waiting.taint
self.taint
end
diff --git a/sample/trick2013/kinaba/remarks.markdown b/sample/trick2013/kinaba/remarks.markdown
index 73a4ea9875cd02..dcdce7e9ae9e7d 100644
--- a/sample/trick2013/kinaba/remarks.markdown
+++ b/sample/trick2013/kinaba/remarks.markdown
@@ -20,7 +20,7 @@ The algorithm is the obvious loop "32.upto(126){|x| putc x}".
It is not so hard to transform it to use each character *at most once*. The only slight difficulty comes from the constraint that we cannot "declare and then use" variables, because then the code will contain the variable name twice. This restriction is worked around by the $. global variable, the best friend of Ruby golfers.
-The relatively interesting part is to use all the charcters *at least once*. Of course, this is easily accomplished by putting everything into a comment (i.e., #unused...) or to a string literal (%(unused...), note that normal string literals are forbidden since they use quotation marks twice). Hey, but that's not fun at all! I tried to minimize the escapeway.
+The relatively interesting part is to use all the characters *at least once*. Of course, this is easily accomplished by putting everything into a comment (i.e., #unused...) or to a string literal (%(unused...), note that normal string literals are forbidden since they use quotation marks twice). Hey, but that's not fun at all! I tried to minimize the escapeway.
* "@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz". Trash box of unused alphabet. I wish I could have used "gkyz" somewhere else.
diff --git a/sample/trick2015/ksk_2/remarks.markdown b/sample/trick2015/ksk_2/remarks.markdown
index bb9b7057733bc7..187a6804d21e68 100644
--- a/sample/trick2015/ksk_2/remarks.markdown
+++ b/sample/trick2015/ksk_2/remarks.markdown
@@ -199,6 +199,6 @@ succeed to return 0. The meaning of ``\1nn`` in regular expression
seems to depend on the existence of capturing expressions.
In spite of these Ruby's behaviors, we have a good news! The present
-SAT sover does not suffer from the issues because the program cannot
+SAT solver does not suffer from the issues because the program cannot
return solutions in practical time for inputs with variables more than
-40.
\ No newline at end of file
+40.
diff --git a/spec/ruby/core/argf/binmode_spec.rb b/spec/ruby/core/argf/binmode_spec.rb
index c2dd578d957d1e..bdcc6aa30ab197 100644
--- a/spec/ruby/core/argf/binmode_spec.rb
+++ b/spec/ruby/core/argf/binmode_spec.rb
@@ -22,7 +22,7 @@
end
end
- it "puts alls subsequent stream reading through ARGF into binmode" do
+ it "puts all subsequent streams reading through ARGF into binmode" do
argf [@bin_file, @bin_file] do
@argf.binmode
@argf.gets.should == "test\r\n"
diff --git a/spec/ruby/core/env/delete_spec.rb b/spec/ruby/core/env/delete_spec.rb
index b7fe1ee67573b6..f11860b21dd0a6 100644
--- a/spec/ruby/core/env/delete_spec.rb
+++ b/spec/ruby/core/env/delete_spec.rb
@@ -30,7 +30,7 @@
ScratchPad.recorded.should == "foo"
end
- it "does not evaluate the block if the envirionment variable exists" do
+ it "does not evaluate the block if the environment variable exists" do
ENV["foo"] = "bar"
ENV.delete("foo") { |name| fail "Should not happen" }
ENV["foo"].should == nil
diff --git a/spec/ruby/core/file/chmod_spec.rb b/spec/ruby/core/file/chmod_spec.rb
index 86171691f6efeb..5ca15c97486d4b 100644
--- a/spec/ruby/core/file/chmod_spec.rb
+++ b/spec/ruby/core/file/chmod_spec.rb
@@ -105,7 +105,7 @@
File.chmod(0, mock_to_path(@file))
end
- it "throws a TypeError if the given path is not coercable into a string" do
+ it "throws a TypeError if the given path is not coercible into a string" do
-> { File.chmod(0, []) }.should raise_error(TypeError)
end
diff --git a/spec/ruby/core/integer/comparison_spec.rb b/spec/ruby/core/integer/comparison_spec.rb
index 762af51535ccc7..2ff557c7c62abf 100644
--- a/spec/ruby/core/integer/comparison_spec.rb
+++ b/spec/ruby/core/integer/comparison_spec.rb
@@ -174,7 +174,7 @@
(infinity_value <=> Float::MAX.to_i*2).should == 1
end
- it "returns -1 when self is negative and other is Infinty" do
+ it "returns -1 when self is negative and other is Infinity" do
(-Float::MAX.to_i*2 <=> infinity_value).should == -1
end
diff --git a/spec/ruby/core/kernel/singleton_methods_spec.rb b/spec/ruby/core/kernel/singleton_methods_spec.rb
index eb4cede110fe0a..a127a439de2496 100644
--- a/spec/ruby/core/kernel/singleton_methods_spec.rb
+++ b/spec/ruby/core/kernel/singleton_methods_spec.rb
@@ -52,7 +52,7 @@
end
describe :kernel_singleton_methods_supers, shared: true do
- it "returns the names of singleton methods for an object extented with a module" do
+ it "returns the names of singleton methods for an object extended with a module" do
ReflectSpecs.oe.singleton_methods(*@object).should include(:m_pro, :m_pub)
end
@@ -62,11 +62,11 @@
r.should == [:pro, :pub]
end
- it "returns the names of singleton methods for an object extented with two modules" do
+ it "returns the names of singleton methods for an object extended with two modules" do
ReflectSpecs.oee.singleton_methods(*@object).should include(:m_pro, :m_pub, :n_pro, :n_pub)
end
- it "returns the names of singleton methods for an object extented with a module including a module" do
+ it "returns the names of singleton methods for an object extended with a module including a module" do
ReflectSpecs.oei.singleton_methods(*@object).should include(:n_pro, :n_pub, :m_pro, :m_pub)
end
@@ -112,7 +112,7 @@
ReflectSpecs.oee.singleton_methods(*@object).should_not include(:m_pri)
end
- it "does not return private singleton methods for an object extented with a module including a module" do
+ it "does not return private singleton methods for an object extended with a module including a module" do
ReflectSpecs.oei.singleton_methods(*@object).should_not include(:n_pri, :m_pri)
end
@@ -165,11 +165,11 @@
it_behaves_like :kernel_singleton_methods_modules, nil, false
it_behaves_like :kernel_singleton_methods_private_supers, nil, false
- it "returns an empty Array for an object extented with a module" do
+ it "returns an empty Array for an object extended with a module" do
ReflectSpecs.oe.singleton_methods(false).should == []
end
- it "returns an empty Array for an object extented with two modules" do
+ it "returns an empty Array for an object extended with two modules" do
ReflectSpecs.oee.singleton_methods(false).should == []
end
diff --git a/spec/ruby/core/module/alias_method_spec.rb b/spec/ruby/core/module/alias_method_spec.rb
index b14f5430a8b624..662e91011ffddd 100644
--- a/spec/ruby/core/module/alias_method_spec.rb
+++ b/spec/ruby/core/module/alias_method_spec.rb
@@ -14,7 +14,7 @@
@object.double(12).should == @object.public_two(12)
end
- it "creates methods that are == to eachother" do
+ it "creates methods that are == to each other" do
@class.make_alias :uno, :public_one
@object.method(:uno).should == @object.method(:public_one)
end
diff --git a/spec/ruby/core/module/autoload_spec.rb b/spec/ruby/core/module/autoload_spec.rb
index db95704cc71f47..99646023477cf1 100644
--- a/spec/ruby/core/module/autoload_spec.rb
+++ b/spec/ruby/core/module/autoload_spec.rb
@@ -23,7 +23,7 @@
ModuleSpecs::Autoload::Child.autoload?(:InheritedAutoload, false).should be_nil
end
- it "returns the name of the file that will be loaded if recursion is disabled but the autoload is defined on the classs itself" do
+ it "returns the name of the file that will be loaded if recursion is disabled but the autoload is defined on the class itself" do
ModuleSpecs::Autoload::Child.autoload :ChildAutoload, "child_autoload.rb"
ModuleSpecs::Autoload::Child.autoload?(:ChildAutoload, false).should == "child_autoload.rb"
end
diff --git a/spec/ruby/core/string/undump_spec.rb b/spec/ruby/core/string/undump_spec.rb
index e83c53ce89aefe..d45c4bae1b3660 100644
--- a/spec/ruby/core/string/undump_spec.rb
+++ b/spec/ruby/core/string/undump_spec.rb
@@ -38,7 +38,7 @@
].should be_computed_by(:undump)
end
- it "returns a string with unescaped sequencies \" and \\" do
+ it "returns a string with unescaped sequences \" and \\" do
[ ['"\\""' , "\""],
['"\\\\"', "\\"]
].should be_computed_by(:undump)
diff --git a/spec/ruby/core/time/new_spec.rb b/spec/ruby/core/time/new_spec.rb
index 01ee47faa1c0f4..a5cfa2a7dfe574 100644
--- a/spec/ruby/core/time/new_spec.rb
+++ b/spec/ruby/core/time/new_spec.rb
@@ -298,7 +298,7 @@ def zone.local_to_utc(t)
# At loading marshaled data, a timezone name will be converted to a timezone object
# by find_timezone class method, if the method is defined.
- # Similary, that class method will be called when a timezone argument does not have
+ # Similarly, that class method will be called when a timezone argument does not have
# the necessary methods mentioned above.
context "subject's class implements .find_timezone method" do
it "calls .find_timezone to build a time object at loading marshaled data" do
diff --git a/spec/ruby/language/regexp/modifiers_spec.rb b/spec/ruby/language/regexp/modifiers_spec.rb
index 9f3cf8acf8ebc1..2f5522bc8aec6f 100644
--- a/spec/ruby/language/regexp/modifiers_spec.rb
+++ b/spec/ruby/language/regexp/modifiers_spec.rb
@@ -104,7 +104,7 @@ def o.to_s
/./m.match("\n").to_a.should == ["\n"]
end
- it "supports ASII/Unicode modifiers" do
+ it "supports ASCII/Unicode modifiers" do
eval('/(?a)[[:alpha:]]+/').match("a\u3042").to_a.should == ["a"]
eval('/(?d)[[:alpha:]]+/').match("a\u3042").to_a.should == ["a\u3042"]
eval('/(?u)[[:alpha:]]+/').match("a\u3042").to_a.should == ["a\u3042"]
diff --git a/spec/ruby/library/socket/ipsocket/recvfrom_spec.rb b/spec/ruby/library/socket/ipsocket/recvfrom_spec.rb
index 3bcb7b8f02e913..2af86ea70d92fd 100644
--- a/spec/ruby/library/socket/ipsocket/recvfrom_spec.rb
+++ b/spec/ruby/library/socket/ipsocket/recvfrom_spec.rb
@@ -64,7 +64,7 @@
data.size.should == 2
data.first.should == "hel"
- # This does not apply to every platform, dependant on recvfrom(2)
+ # This does not apply to every platform, dependent on recvfrom(2)
# data.last.should == nil
end
end
diff --git a/spec/ruby/optional/capi/io_spec.rb b/spec/ruby/optional/capi/io_spec.rb
index 7947a48eac74b5..4d61fc87557bee 100644
--- a/spec/ruby/optional/capi/io_spec.rb
+++ b/spec/ruby/optional/capi/io_spec.rb
@@ -220,7 +220,7 @@
end
describe "rb_io_check_writable" do
- it "does not raise an exeption if the IO is opened for writing" do
+ it "does not raise an exception if the IO is opened for writing" do
# The MRI function is void, so we use should_not raise_error
-> { @o.rb_io_check_writable(@w_io) }.should_not raise_error
end
diff --git a/st.c b/st.c
index 5d0c00cc0afb54..2b973ea75d2191 100644
--- a/st.c
+++ b/st.c
@@ -714,7 +714,7 @@ st_free_table(st_table *tab)
free(tab);
}
-/* Return byte size of memory allocted for table TAB. */
+/* Return byte size of memory allocated for table TAB. */
size_t
st_memsize(const st_table *tab)
{
diff --git a/test/-ext-/popen_deadlock/test_popen_deadlock.rb b/test/-ext-/popen_deadlock/test_popen_deadlock.rb
index 97892e50083176..e6ba5e7c1aef34 100644
--- a/test/-ext-/popen_deadlock/test_popen_deadlock.rb
+++ b/test/-ext-/popen_deadlock/test_popen_deadlock.rb
@@ -26,7 +26,7 @@ def assert_popen_without_deadlock
end
private :assert_popen_without_deadlock
- # 10 test methods are defined for showing progess reports
+ # 10 test methods are defined for showing progress reports
10.times do |i|
define_method("test_popen_without_deadlock_#{i}") {
assert_popen_without_deadlock
diff --git a/test/ruby/sentence.rb b/test/ruby/sentence.rb
index 28fb5d1cf8eb5b..9bfd7c75992f2d 100644
--- a/test/ruby/sentence.rb
+++ b/test/ruby/sentence.rb
@@ -353,7 +353,7 @@ def Sentence.each(syntax, sym, limit)
# * No rule derives to empty sequence
# * Underivable rule simplified
# * No channel rule
- # * Symbols which has zero or one choices are not appered in rhs.
+ # * Symbols which has zero or one choices are not appeared in rhs.
#
# Note that the rules which can derive empty and non-empty
# sequences are modified to derive only non-empty sequences.
diff --git a/test/ruby/test_assignment.rb b/test/ruby/test_assignment.rb
index bf6602ab1364df..5a6ec97e67244d 100644
--- a/test/ruby/test_assignment.rb
+++ b/test/ruby/test_assignment.rb
@@ -456,7 +456,7 @@ def test_massign
assert(defined?(a))
assert_nil(a)
- # multiple asignment
+ # multiple assignment
a, b = 1, 2
assert_equal 1, a
assert_equal 2, b
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index 884fbe00ed222d..9438160a6ffb00 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -113,7 +113,7 @@ def test_struct_new_with_keyword_init
assert_equal @Struct::KeywordInitTrue.new(a: 1, b: 2).values, @Struct::KeywordInitFalse.new(1, 2).values
assert_equal "#{@Struct}::KeywordInitFalse", @Struct::KeywordInitFalse.inspect
assert_equal "#{@Struct}::KeywordInitTrue(keyword_init: true)", @Struct::KeywordInitTrue.inspect
- # eval is neede to prevent the warning duplication filter
+ # eval is needed to prevent the warning duplication filter
k = eval("Class.new(@Struct::KeywordInitFalse) {def initialize(**) end}")
assert_warn(/The last argument is used as the keyword parameter/) {k.new(a: 1, b: 2)}
k = Class.new(@Struct::KeywordInitTrue) {def initialize(**) end}
diff --git a/time.c b/time.c
index 021421cdbfeaa2..1016537501a4df 100644
--- a/time.c
+++ b/time.c
@@ -5801,7 +5801,7 @@ rb_time_zone_abbreviation(VALUE zone, VALUE time)
* At loading marshaled data, a timezone name will be converted to a timezone
* object by +find_timezone+ class method, if the method is defined.
*
- * Similary, that class method will be called when a timezone argument does
+ * Similarly, that class method will be called when a timezone argument does
* not have the necessary methods mentioned above.
*/
diff --git a/tool/lib/tracepointchecker.rb b/tool/lib/tracepointchecker.rb
index 47822ecef54db5..3254e59357d493 100644
--- a/tool/lib/tracepointchecker.rb
+++ b/tool/lib/tracepointchecker.rb
@@ -80,7 +80,7 @@ def self.start verbose: false, stop_at_failure: false
call_stack.push method
STATE[:count] += 1
- verbose_out :psuh, method if verbose
+ verbose_out :push, method if verbose
}
TRACES << TracePoint.new(*return_events){|tp|
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index bcd53078413831..038fbf64289cf0 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -268,7 +268,7 @@ module RbConfig
CONFIG["UNICODE_EMOJI_VERSION"] = #{$unicode_emoji_version.dump}
EOS
print < "Whats the big deal"
+ * thr.join #=> "What's the big deal"
*
* If we don't call +thr.join+ before the main thread terminates, then all
* other threads including +thr+ will be killed.
@@ -3028,7 +3028,7 @@ Init_VM(void)
* once, like in the following example:
*
* threads = []
- * threads << Thread.new { puts "Whats the big deal" }
+ * threads << Thread.new { puts "What's the big deal" }
* threads << Thread.new { 3.times { puts "Threads are fun!" } }
*
* After creating a few threads we wait for them all to finish
diff --git a/vm_dump.c b/vm_dump.c
index 9ada7a959f1f45..c778e1b4ddac3d 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -349,7 +349,7 @@ vm_stack_dump_each(const rb_execution_context_t *ec, const rb_control_frame_t *c
}
}
else {
- rb_bug("unsupport frame type: %08lx", VM_FRAME_TYPE(cfp));
+ rb_bug("unsupported frame type: %08lx", VM_FRAME_TYPE(cfp));
}
}
#endif
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index e35000e758678f..2ac006a60592aa 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -165,7 +165,7 @@ vm_check_frame_detail(VALUE type, int req_block, int req_me, int req_cref, VALUE
if ((type & VM_FRAME_MAGIC_MASK) == VM_FRAME_MAGIC_DUMMY) {
VM_ASSERT(iseq == NULL ||
- RUBY_VM_NORMAL_ISEQ_P(iseq) /* argument error. it shold be fixed */);
+ RUBY_VM_NORMAL_ISEQ_P(iseq) /* argument error. it should be fixed */);
}
else {
VM_ASSERT(is_cframe == !RUBY_VM_NORMAL_ISEQ_P(iseq));
@@ -226,7 +226,7 @@ vm_check_canary(const rb_execution_context_t *ec, VALUE *sp)
return;
}
else {
- /* we are going to call metods below; squash the canary to
+ /* we are going to call methods below; squash the canary to
* prevent infinite loop. */
sp[0] = Qundef;
}
@@ -1334,7 +1334,7 @@ vm_throw_start(const rb_execution_context_t *ec, rb_control_frame_t *const reg_c
/* do nothing */
}
else {
- rb_bug("isns(throw): unsupport throw type");
+ rb_bug("isns(throw): unsupported throw type");
}
ec->tag->state = state;
@@ -1536,7 +1536,7 @@ rb_vm_search_method_slowpath(struct rb_call_data *cd, VALUE klass)
* - It scans the array from left to right, looking for the expected class
* serial. If it finds that at `cc->class_serial[0]` (this branch
* probability is 98% according to @shyouhei's experiment), just returns
- * true. If it reaches the end of the array without finding anytihng,
+ * true. If it reaches the end of the array without finding anything,
* returns false. This is done in the #1 loop below.
*
* - What needs to be complicated is when the class serial is found at either
diff --git a/win32/file.c b/win32/file.c
index 275520215a8210..9d213700193092 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -552,7 +552,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
/* Determine require buffer size */
size = GetFullPathNameW(buffer, PATH_BUFFER_SIZE, wfullpath_buffer, NULL);
if (size > PATH_BUFFER_SIZE) {
- /* allocate more memory than alloted originally by PATH_BUFFER_SIZE */
+ /* allocate more memory than allotted originally by PATH_BUFFER_SIZE */
wfullpath = ALLOC_N(wchar_t, size);
size = GetFullPathNameW(buffer, size, wfullpath, NULL);
}
From fac60be324260cd834478fedf934e59b97935dbf Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada
Date: Fri, 20 Dec 2019 09:39:50 +0900
Subject: [PATCH 006/878] shell.rb is no longer bundled [ci skip]
---
doc/shell.rd.ja | 335 ------------------------------------------------
1 file changed, 335 deletions(-)
delete mode 100644 doc/shell.rd.ja
diff --git a/doc/shell.rd.ja b/doc/shell.rd.ja
deleted file mode 100644
index a9507fe92a991f..00000000000000
--- a/doc/shell.rd.ja
+++ /dev/null
@@ -1,335 +0,0 @@
- -- shell.rb
- $Release Version: 0.6.0 $
- $Revision$
- by Keiju ISHITSUKA(keiju@ishitsuka.com)
-
-=begin
-
-= 目的
-
-ruby上でsh/cshのようにコマンドの実行及びフィルタリングを手軽に行う.
-sh/cshの制御文はrubyの機能を用いて実現する.
-
-= 主なクラス一覧
-
-== Shell
-
-Shellオブジェクトはカレントディレクトリを持ち, コマンド実行はそこからの
-相対パスになります.
-
---- Shell#cwd
---- Shell#dir
---- Shell#getwd
---- Shell#pwd
-
- カレントディレクトリを返す。
-
---- Shell#system_path
-
- コマンドサーチパスの配列を返す。
-
---- Shell#umask
-
- umaskを返す。
-
-== Filter
-
-コマンドの実行結果はすべてFilterとしてかえります. Enumerableをincludeし
-ています.
-
-= 主なメソッド一覧
-
-== コマンド定義
-
-OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
-
-注) コマンドを定義しなくとも直接実行できるShell#systemコマンドもあります.
-
---- Shell.def_system_command(command, path = command)
-
- Shellのメソッドとしてcommandを登録します.
-
- 例)
- Shell.def_system_command "ls"
- ls を定義
-
- Shell.def_system_command "sys_sort", "sort"
- sortコマンドをsys_sortとして定義
-
---- Shell.undef_system_command(command)
-
- commandを削除します.
-
---- Shell.alias_command(ali, command, *opts) {...}
-
- commandのaliasをします.
-
- 例)
- Shell.alias_command "lsC", "ls", "-CBF", "--show-control-chars"
- Shell.alias_command("lsC", "ls"){|*opts| ["-CBF", "--show-control-chars", *opts]}
-
---- Shell.unalias_command(ali)
-
- commandのaliasを削除します.
-
---- Shell.install_system_commands(pre = "sys_")
-
- system_path上にある全ての実行可能ファイルをShellに定義する. メソッ
- ド名は元のファイル名の頭にpreをつけたものとなる.
-
-== 生成
-
---- Shell.new
-
- プロセスのカレントディレクトリをカレントディレクトリとするShellオ
- ブジェクトを生成します.
-
---- Shell.cd(path)
-
- pathをカレントディレクトリとするShellオブジェクトを生成します.
-
-== プロセス管理
-
---- Shell#jobs
-
- スケジューリングされているjobの一覧を返す.
-
---- Shell#kill sig, job
-
- jobにシグナルsigを送る
-
-== カレントディレクトリ操作
-
---- Shell#cd(path, &block)
---- Shell#chdir
-
- カレントディレクトリをpathにする. イテレータとして呼ばれたときには
- ブロック実行中のみカレントディレクトリを変更する.
-
---- Shell#pushd(path = nil, &block)
---- Shell#pushdir
-
- カレントディレクトリをディレクトリスタックにつみ, カレントディレク
- トリをpathにする. pathが省略されたときには, カレントディレクトリと
- ディレクトリスタックのトップを交換する. イテレータとして呼ばれたと
- きには, ブロック実行中のみpushdする.
-
---- Shell#popd
---- Shell#popdir
-
- ディレクトリスタックからポップし, それをカレントディレクトリにする.
-
-== ファイル/ディレクトリ操作
-
---- Shell#foreach(path = nil, &block)
-
- pathがファイルなら, File#foreach
- pathがディレクトリなら, Dir#foreach
-
---- Shell#open(path, mode)
-
- pathがファイルなら, File#open
- pathがディレクトリなら, Dir#open
-
---- Shell#unlink(path)
-
- pathがファイルなら, File#unlink
- pathがディレクトリなら, Dir#unlink
-
---- Shell#test(command, file1, file2)
---- Shell#[command, file1, file2]
-
- ファイルテスト関数testと同じ.
- 例)
- sh[?e, "foo"]
- sh[:e, "foo"]
- sh["e", "foo"]
- sh[:exists?, "foo"]
- sh["exists?", "foo"]
-
---- Shell#mkdir(*path)
-
- Dir.mkdirと同じ(複数可)
-
---- Shell#rmdir(*path)
-
- Dir.rmdirと同じ(複数可)
-
-== コマンド実行
-
---- System#system(command, *opts)
-
- commandを実行する.
- 例)
- print sh.system("ls", "-l")
- sh.system("ls", "-l") | sh.head > STDOUT
-
---- System#rehash
-
- リハッシュする
-
---- Shell#transact &block
-
- ブロック中ではshellをselfとして実行する.
- 例)
- sh.transact{system("ls", "-l") | head > STDOUT}
-
---- Shell#out(dev = STDOUT, &block)
-
- transactを呼び出しその結果をdevに出力する.
-
-== 内部コマンド
-
---- Shell#echo(*strings)
---- Shell#cat(*files)
---- Shell#glob(patten)
---- Shell#tee(file)
-
- これらは実行すると, それらを内容とするFilterオブジェクトを返します.
-
---- Filter#each &block
-
- フィルタの一行ずつをblockに渡す.
-
---- Filter#<(src)
-
- srcをフィルタの入力とする. srcが, 文字列ならばファイルを, IOであれ
- ばそれをそのまま入力とする.
-
---- Filter#>(to)
-
- srcをフィルタの出力とする. toが, 文字列ならばファイルに, IOであれ
- ばそれをそのまま出力とする.
-
---- Filter#>>(to)
-
- srcをフィルタに追加する. toが, 文字列ならばファイルに, IOであれば
- それをそのまま出力とする.
-
---- Filter#|(filter)
-
- パイプ結合
-
---- Filter#+(filter)
-
- filter1 + filter2 は filter1の出力の後, filter2の出力を行う.
-
---- Filter#to_a
---- Filter#to_s
-
-== 組込みコマンド
-
---- Shell#atime(file)
---- Shell#basename(file, *opt)
---- Shell#chmod(mode, *files)
---- Shell#chown(owner, group, *file)
---- Shell#ctime(file)
---- Shell#delete(*file)
---- Shell#dirname(file)
---- Shell#ftype(file)
---- Shell#join(*file)
---- Shell#link(file_from, file_to)
---- Shell#lstat(file)
---- Shell#mtime(file)
---- Shell#readlink(file)
---- Shell#rename(file_from, file_to)
---- Shell#split(file)
---- Shell#stat(file)
---- Shell#symlink(file_from, file_to)
---- Shell#truncate(file, length)
---- Shell#utime(atime, mtime, *file)
-
- これらはFileクラスにある同名のクラスメソッドと同じです.
-
---- Shell#blockdev?(file)
---- Shell#chardev?(file)
---- Shell#directory?(file)
---- Shell#executable?(file)
---- Shell#executable_real?(file)
---- Shell#exist?(file)/Shell#exists?(file)
---- Shell#file?(file)
---- Shell#grpowned?(file)
---- Shell#owned?(file)
---- Shell#pipe?(file)
---- Shell#readable?(file)
---- Shell#readable_real?(file)
---- Shell#setgid?(file)
---- Shell#setuid?(file)
---- Shell#size(file)/Shell#size?(file)
---- Shell#socket?(file)
---- Shell#sticky?(file)
---- Shell#symlink?(file)
---- Shell#writable?(file)
---- Shell#writable_real?(file)
---- Shell#zero?(file)
-
- これらはFileTestクラスにある同名のクラスメソッドと同じです.
-
---- Shell#syscopy(filename_from, filename_to)
---- Shell#copy(filename_from, filename_to)
---- Shell#move(filename_from, filename_to)
---- Shell#compare(filename_from, filename_to)
---- Shell#safe_unlink(*filenames)
---- Shell#makedirs(*filenames)
---- Shell#install(filename_from, filename_to, mode)
-
- これらはFileToolsクラスにある同名のクラスメソッドと同じです.
-
- その他, 以下のものがエイリアスされています.
-
---- Shell#cmp <- Shell#compare
---- Shell#mv <- Shell#move
---- Shell#cp <- Shell#copy
---- Shell#rm_f <- Shell#safe_unlink
---- Shell#mkpath <- Shell#makedirs
-
-= サンプル
-
-== ex1
-
- sh = Shell.cd("/tmp")
- sh.mkdir "shell-test-1" unless sh.exists?("shell-test-1")
- sh.cd("shell-test-1")
- for dir in ["dir1", "dir3", "dir5"]
- if !sh.exists?(dir)
- sh.mkdir dir
- sh.cd(dir) do
- f = sh.open("tmpFile", "w")
- f.print "TEST\n"
- f.close
- end
- print sh.pwd
- end
- end
-
-== ex2
-
- sh = Shell.cd("/tmp")
- sh.transact do
- mkdir "shell-test-1" unless exists?("shell-test-1")
- cd("shell-test-1")
- for dir in ["dir1", "dir3", "dir5"]
- if !exists?(dir)
- mkdir dir
- cd(dir) do
- f = open("tmpFile", "w")
- f.print "TEST\n"
- f.close
- end
- print pwd
- end
- end
- end
-
-== ex3
-
- sh.cat("/etc/printcap") | sh.tee("tee1") > "tee2"
- (sh.cat < "/etc/printcap") | sh.tee("tee11") > "tee12"
- sh.cat("/etc/printcap") | sh.tee("tee1") >> "tee2"
- (sh.cat < "/etc/printcap") | sh.tee("tee11") >> "tee12"
-
-== ex4
-
- print sh.cat("/etc/passwd").head.collect{|l| l =~ /keiju/}
-
-=end
From e672494cd737b8fea3a186aeb5c2c17d1a18cb96 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA
Date: Fri, 20 Dec 2019 11:50:32 +0900
Subject: [PATCH 007/878] Merge RubyGems 3.1.2
---
lib/rubygems.rb | 2 +-
lib/rubygems/commands/setup_command.rb | 43 ++++++++----
lib/rubygems/test_case.rb | 44 +++++++++++++
test/rubygems/test_gem.rb | 15 ++---
.../test_gem_commands_setup_command.rb | 66 ++++++++++++++++---
test/rubygems/test_gem_installer.rb | 33 +++-------
6 files changed, 145 insertions(+), 58 deletions(-)
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 8eedc97bca1875..57cb70cc2b8030 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -9,7 +9,7 @@
require 'rbconfig'
module Gem
- VERSION = "3.1.1".freeze
+ VERSION = "3.1.2".freeze
end
# Must be first since it unloads the prelude from 1.9.2
diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb
index 7844e9d19957a2..579776df7ea583 100644
--- a/lib/rubygems/commands/setup_command.rb
+++ b/lib/rubygems/commands/setup_command.rb
@@ -17,6 +17,7 @@ def initialize
super 'setup', 'Install RubyGems',
:format_executable => true, :document => %w[ri],
+ :force => true,
:site_or_vendor => 'sitelibdir',
:destdir => '', :prefix => '', :previous_version => '',
:regenerate_binstubs => true
@@ -88,6 +89,11 @@ def initialize
options[:regenerate_binstubs] = value
end
+ add_option '-f', '--[no-]force',
+ 'Forcefully overwrite binstubs' do |value, options|
+ options[:force] = value
+ end
+
add_option('-E', '--[no-]env-shebang',
'Rewrite executables with a shebang',
'of /usr/bin/env') do |value, options|
@@ -199,10 +205,10 @@ def execute
say
say "RubyGems installed the following executables:"
- say @bin_file_names.map { |name| "\t#{name}\n" }
+ say bin_file_names.map { |name| "\t#{name}\n" }
say
- unless @bin_file_names.grep(/#{File::SEPARATOR}gem$/)
+ unless bin_file_names.grep(/#{File::SEPARATOR}gem$/)
say "If `gem` was installed by a previous RubyGems installation, you may need"
say "to remove it by hand."
say
@@ -235,8 +241,6 @@ def execute
end
def install_executables(bin_dir)
- @bin_file_names = []
-
prog_mode = options[:prog_mode] || 0755
executables = { 'gem' => 'bin' }
@@ -249,13 +253,7 @@ def install_executables(bin_dir)
bin_files -= %w[update_rubygems]
bin_files.each do |bin_file|
- bin_file_formatted = if options[:format_executable]
- Gem.default_exec_format % bin_file
- else
- bin_file
- end
-
- dest_file = File.join bin_dir, bin_file_formatted
+ dest_file = target_bin_path(bin_dir, bin_file)
bin_tmp_file = File.join Dir.tmpdir, "#{bin_file}.#{$$}"
begin
@@ -267,7 +265,7 @@ def install_executables(bin_dir)
end
install bin_tmp_file, dest_file, :mode => prog_mode
- @bin_file_names << dest_file
+ bin_file_names << dest_file
ensure
rm bin_tmp_file
end
@@ -429,13 +427,15 @@ def install_default_bundler_gem(bin_dir)
Dir.chdir("bundler") do
built_gem = Gem::Package.build(bundler_spec)
begin
- installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], format_executable: options[:format_executable], install_as_default: true, bin_dir: bin_dir, wrappers: true)
+ installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], format_executable: options[:format_executable], force: options[:force], install_as_default: true, bin_dir: bin_dir, wrappers: true)
installer.install
ensure
FileUtils.rm_f built_gem
end
end
+ bundler_spec.executables.each {|executable| bin_file_names << target_bin_path(bin_dir, executable) }
+
say "Bundler #{bundler_spec.version} installed"
end
@@ -592,7 +592,7 @@ def show_release_notes
history_string = ""
until versions.length == 0 or
- versions.shift < options[:previous_version] do
+ versions.shift <= options[:previous_version] do
history_string += version_lines.shift + text.shift
end
@@ -626,4 +626,19 @@ def regenerate_binstubs
command.invoke(*args)
end
+ private
+
+ def target_bin_path(bin_dir, bin_file)
+ bin_file_formatted = if options[:format_executable]
+ Gem.default_exec_format % bin_file
+ else
+ bin_file
+ end
+ File.join bin_dir, bin_file_formatted
+ end
+
+ def bin_file_names
+ @bin_file_names ||= []
+ end
+
end
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 5ecf2ab1d820df..206497c6512980 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -164,6 +164,50 @@ def vendordir(value)
end
end
+ ##
+ # Sets the bindir entry in RbConfig::CONFIG to +value+ and restores the
+ # original value when the block ends
+ #
+ def bindir(value)
+ bindir = RbConfig::CONFIG['bindir']
+
+ if value
+ RbConfig::CONFIG['bindir'] = value
+ else
+ RbConfig::CONFIG.delete 'bindir'
+ end
+
+ yield
+ ensure
+ if bindir
+ RbConfig::CONFIG['bindir'] = bindir
+ else
+ RbConfig::CONFIG.delete 'bindir'
+ end
+ end
+
+ ##
+ # Sets the EXEEXT entry in RbConfig::CONFIG to +value+ and restores the
+ # original value when the block ends
+ #
+ def exeext(value)
+ exeext = RbConfig::CONFIG['EXEEXT']
+
+ if value
+ RbConfig::CONFIG['EXEEXT'] = value
+ else
+ RbConfig::CONFIG.delete 'EXEEXT'
+ end
+
+ yield
+ ensure
+ if exeext
+ RbConfig::CONFIG['EXEEXT'] = exeext
+ else
+ RbConfig::CONFIG.delete 'EXEEXT'
+ end
+ end
+
# TODO: move to minitest
def refute_path_exists(path, msg = nil)
msg = message(msg) { "Expected path '#{path}' to not exist" }
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index a0debb488c9254..6d223b7d69c0a3 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -1917,16 +1917,11 @@ def ruby_install_name(name)
end
def with_bindir_and_exeext(bindir, exeext)
- orig_bindir = RbConfig::CONFIG['bindir']
- orig_exe_ext = RbConfig::CONFIG['EXEEXT']
-
- RbConfig::CONFIG['bindir'] = bindir
- RbConfig::CONFIG['EXEEXT'] = exeext
-
- yield
- ensure
- RbConfig::CONFIG['bindir'] = orig_bindir
- RbConfig::CONFIG['EXEEXT'] = orig_exe_ext
+ bindir(bindir) do
+ exeext(exeext) do
+ yield
+ end
+ end
end
def with_clean_path_to_ruby
diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb
index 02171ece9db96e..c63f7177c77cf7 100644
--- a/test/rubygems/test_gem_commands_setup_command.rb
+++ b/test/rubygems/test_gem_commands_setup_command.rb
@@ -123,6 +123,18 @@ def test_execute_no_regenerate_binstubs
assert_equal "I changed it!\n", File.read(gem_bin_path)
end
+ def test_execute_informs_about_installed_executables
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ out = @ui.output.split "\n"
+
+ exec_line = out.shift until exec_line == "RubyGems installed the following executables:"
+ assert_equal "\t#{default_gem_bin_path}", out.shift
+ assert_equal "\t#{default_bundle_bin_path}", out.shift
+ end
+
def test_env_shebang_flag
gem_bin_path = gem_install 'a'
write_file gem_bin_path do |io|
@@ -133,10 +145,6 @@ def test_env_shebang_flag
@cmd.options[:env_shebang] = true
@cmd.execute
- gem_exec = sprintf Gem.default_exec_format, 'gem'
- default_gem_bin_path = File.join @install_dir, 'bin', gem_exec
- bundle_exec = sprintf Gem.default_exec_format, 'bundle'
- default_bundle_bin_path = File.join @install_dir, 'bin', bundle_exec
ruby_exec = sprintf Gem.default_exec_format, 'ruby'
if Gem.win_platform?
@@ -212,10 +220,41 @@ def test_install_default_bundler_gem
# TODO: We need to assert to remove same version of bundler on gem_dir directory(It's not site_ruby dir)
- # expect to not remove bundler-* direcotyr.
+ # expect to not remove bundler-* directory.
assert_path_exists 'default/gems/bundler-audit-1.0.0'
end
+ def test_install_default_bundler_gem_with_force_flag
+ @cmd.extend FileUtils
+
+ bin_dir = File.join(@gemhome, 'bin')
+ bundle_bin = File.join(bin_dir, 'bundle')
+
+ write_file bundle_bin do |f|
+ f.puts '#!/usr/bin/ruby'
+ f.puts ''
+ f.puts 'echo "hello"'
+ end
+
+ bindir(bin_dir) do
+ @cmd.options[:force] = true
+
+ @cmd.install_default_bundler_gem bin_dir
+
+ bundler_spec = Gem::Specification.load("bundler/bundler.gemspec")
+ default_spec_path = File.join(Gem.default_specifications_dir, "#{bundler_spec.full_name}.gemspec")
+ spec = Gem::Specification.load(default_spec_path)
+
+ spec.executables.each do |e|
+ if Gem.win_platform?
+ assert_path_exists File.join(bin_dir, "#{e}.bat")
+ end
+
+ assert_path_exists File.join bin_dir, Gem.default_exec_format % e
+ end
+ end
+ end
+
def test_remove_old_lib_files
lib = File.join @install_dir, 'lib'
lib_rubygems = File.join lib, 'rubygems'
@@ -308,11 +347,6 @@ def test_show_release_notes
* Fixed release note display for LANG=C when installing rubygems
* π is tasty
-=== 2.0.2 / 2013-03-06
-
-* Bug fixes:
- * Other bugs fixed
-
EXPECTED
output = @ui.output
@@ -323,4 +357,16 @@ def test_show_release_notes
@ui.outs.set_encoding @default_external if @default_external
end
+ private
+
+ def default_gem_bin_path
+ gem_exec = sprintf Gem.default_exec_format, 'gem'
+ File.join @install_dir, 'bin', gem_exec
+ end
+
+ def default_bundle_bin_path
+ bundle_exec = sprintf Gem.default_exec_format, 'bundle'
+ File.join @install_dir, 'bin', bundle_exec
+ end
+
end unless Gem.java_platform?
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 7a5fb972a40901..731a1ac01de48e 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -104,32 +104,19 @@ def test_check_executable_overwrite
def test_check_executable_overwrite_default_bin_dir
installer = setup_base_installer
- if defined?(RUBY_FRAMEWORK_VERSION)
- orig_RUBY_FRAMEWORK_VERSION = RUBY_FRAMEWORK_VERSION
- Object.send :remove_const, :RUBY_FRAMEWORK_VERSION
- end
- orig_bindir = RbConfig::CONFIG['bindir']
- RbConfig::CONFIG['bindir'] = Gem.bindir
+ bindir(Gem.bindir) do
+ util_conflict_executable false
- util_conflict_executable false
+ ui = Gem::MockGemUi.new "n\n"
+ use_ui ui do
+ e = assert_raises Gem::InstallError do
+ installer.generate_bin
+ end
- ui = Gem::MockGemUi.new "n\n"
- use_ui ui do
- e = assert_raises Gem::InstallError do
- installer.generate_bin
+ conflicted = File.join @gemhome, 'bin', 'executable'
+ assert_match %r%\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z%,
+ e.message
end
-
- conflicted = File.join @gemhome, 'bin', 'executable'
- assert_match %r%\A"executable" from a conflicts with (?:#{Regexp.quote(conflicted)}|installed executable from conflict)\z%,
- e.message
- end
- ensure
- Object.const_set :RUBY_FRAMEWORK_VERSION, orig_RUBY_FRAMEWORK_VERSION if
- orig_RUBY_FRAMEWORK_VERSION
- if orig_bindir
- RbConfig::CONFIG['bindir'] = orig_bindir
- else
- RbConfig::CONFIG.delete 'bindir'
end
end
From e68999c82c4863d33a6f893661fba1b7538c5671 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada
Date: Fri, 20 Dec 2019 12:19:45 +0900
Subject: [PATCH 008/878] Fixed misspellings
Fixed misspellings reported at [Bug #16437], for default gems.
---
lib/irb.rb | 2 +-
lib/irb/extend-command.rb | 2 +-
lib/net/ftp.rb | 2 +-
lib/racc/parser-text.rb | 2 +-
lib/racc/parser.rb | 2 +-
lib/rdoc/rd/block_parser.rb | 2 +-
lib/rdoc/rd/inline_parser.rb | 2 +-
lib/reline/line_editor.rb | 2 +-
lib/tracer.rb | 2 +-
lib/webrick/httpservlet/filehandler.rb | 2 +-
libexec/y2racc | 2 +-
.../mspec/lib/mspec/runner/formatters/specdoc.rb | 2 +-
spec/mspec/lib/mspec/utils/options.rb | 4 ++--
spec/mspec/spec/expectations/should.rb | 2 +-
spec/mspec/spec/expectations/should_spec.rb | 2 +-
spec/mspec/spec/matchers/base_spec.rb | 4 ++--
spec/mspec/spec/matchers/complain_spec.rb | 2 +-
spec/mspec/spec/runner/formatters/dotted_spec.rb | 2 +-
spec/mspec/spec/utils/script_spec.rb | 2 +-
test/date/test_date_parse.rb | 2 +-
.../spell_checking/test_class_name_check.rb | 2 +-
test/logger/test_logdevice.rb | 2 +-
test/openssl/test_config.rb | 16 ++++++++--------
test/racc/assets/nasl.y | 2 +-
test/racc/regress/nasl | 2 +-
.../Markdown Documentation - Basics.text | 4 ++--
test/rdoc/test_rdoc_markdown_test.rb | 4 ++--
test/rdoc/test_rdoc_parser_ruby.rb | 2 +-
28 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/lib/irb.rb b/lib/irb.rb
index f6fc9690f2e41e..a907894fe29f9c 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -319,7 +319,7 @@
# # check if Foo#foo is available
# irb(main):005:0> Foo.instance_methods #=> [:foo, ...]
#
-# # change the active sesssion
+# # change the active session
# irb(main):006:0> fg 2
# # define Foo#bar in the context of Foo
# irb.2(Foo):005:0> def bar
diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb
index fe246606b30f90..de145e962db85d 100644
--- a/lib/irb/extend-command.rb
+++ b/lib/irb/extend-command.rb
@@ -32,7 +32,7 @@ def irb_exit(ret = 0)
# Displays current configuration.
#
- # Modifing the configuration is achieved by sending a message to IRB.conf.
+ # Modifying the configuration is achieved by sending a message to IRB.conf.
def irb_context
IRB.CurrentContext
end
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 2b7d19a66203c1..d1e545c0c8c055 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -1242,7 +1242,7 @@ def abort
# Returns the status (STAT command).
#
# pathname:: when stat is invoked with pathname as a parameter it acts like
- # list but alot faster and over the same tcp session.
+ # list but a lot faster and over the same tcp session.
#
def status(pathname = nil)
line = pathname ? "STAT #{pathname}" : "STAT"
diff --git a/lib/racc/parser-text.rb b/lib/racc/parser-text.rb
index 028af61e4c9195..31b8e2c01ff4d6 100644
--- a/lib/racc/parser-text.rb
+++ b/lib/racc/parser-text.rb
@@ -199,7 +199,7 @@ class Parser
else
require 'racc/cparse'
end
- # Racc_Runtime_Core_Version_C = (defined in extention)
+ # Racc_Runtime_Core_Version_C = (defined in extension)
Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
unless new.respond_to?(:_racc_do_parse_c, true)
raise LoadError, 'old cparse.so'
diff --git a/lib/racc/parser.rb b/lib/racc/parser.rb
index dd446d1aa178c6..56b4af9deab2d4 100644
--- a/lib/racc/parser.rb
+++ b/lib/racc/parser.rb
@@ -197,7 +197,7 @@ class Parser
else
require 'racc/cparse'
end
- # Racc_Runtime_Core_Version_C = (defined in extention)
+ # Racc_Runtime_Core_Version_C = (defined in extension)
Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
unless new.respond_to?(:_racc_do_parse_c, true)
raise LoadError, 'old cparse.so'
diff --git a/lib/rdoc/rd/block_parser.rb b/lib/rdoc/rd/block_parser.rb
index 37b35a59248ea8..f7353268625f53 100644
--- a/lib/rdoc/rd/block_parser.rb
+++ b/lib/rdoc/rd/block_parser.rb
@@ -2,7 +2,7 @@
#
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.4.14
-# from Racc grammer file "".
+# from Racc grammar file "".
#
require 'racc/parser.rb'
diff --git a/lib/rdoc/rd/inline_parser.rb b/lib/rdoc/rd/inline_parser.rb
index 85e4215964a8bb..f73b81ba9de3fc 100644
--- a/lib/rdoc/rd/inline_parser.rb
+++ b/lib/rdoc/rd/inline_parser.rb
@@ -2,7 +2,7 @@
#
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.4.14
-# from Racc grammer file "".
+# from Racc grammar file "".
#
require 'racc/parser.rb'
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 42a2b5b519ac14..0ddafb420b48c2 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -553,7 +553,7 @@ def editing_mode
preposing, target, postposing = retrieve_completion_block
list = list.select { |i|
if i and not Encoding.compatible?(target.encoding, i.encoding)
- raise Encoding::CompatibilityError, "#{target.encoding.name} is not comaptible with #{i.encoding.name}"
+ raise Encoding::CompatibilityError, "#{target.encoding.name} is not compatible with #{i.encoding.name}"
end
if @config.completion_ignore_case
i&.downcase&.start_with?(target.downcase)
diff --git a/lib/tracer.rb b/lib/tracer.rb
index 8011ad239909db..c1540b8d233d42 100644
--- a/lib/tracer.rb
+++ b/lib/tracer.rb
@@ -241,7 +241,7 @@ def Tracer.off
end
##
- # Register an event handler p which is called everytime a line
+ # Register an event handler p which is called every time a line
# in +file_name+ is executed.
#
# Example:
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb
index 601882ef4cc007..7cac05d818f3bd 100644
--- a/lib/webrick/httpservlet/filehandler.rb
+++ b/lib/webrick/httpservlet/filehandler.rb
@@ -214,7 +214,7 @@ def initialize(server, root, options={}, default=Config::FileHandler)
def service(req, res)
# if this class is mounted on "/" and /~username is requested.
- # we're going to override path informations before invoking service.
+ # we're going to override path information before invoking service.
if defined?(Etc) && @options[:UserDir] && req.script_name.empty?
if %r|^(/~([^/]+))| =~ req.path_info
script_name, user = $1, $2
diff --git a/libexec/y2racc b/libexec/y2racc
index 38bd3669a2387f..7933f94153dc8a 100755
--- a/libexec/y2racc
+++ b/libexec/y2racc
@@ -6,7 +6,7 @@
#
# This program is free software.
# You can distribute/modify this program under the terms of
-# the GNU LGPL, Lesser General Public Lisence version 2.1.
+# the GNU LGPL, Lesser General Public License version 2.1.
# For details of the GNU LGPL, see the file "COPYING".
#
diff --git a/spec/mspec/lib/mspec/runner/formatters/specdoc.rb b/spec/mspec/lib/mspec/runner/formatters/specdoc.rb
index 35092018f623e6..d3a5c3d729d2a9 100644
--- a/spec/mspec/lib/mspec/runner/formatters/specdoc.rb
+++ b/spec/mspec/lib/mspec/runner/formatters/specdoc.rb
@@ -24,7 +24,7 @@ def before(state)
# the sequential number of the exception raised. If
# there has already been an exception raised while
# evaluating this example, it prints another +it+
- # block description string so that each discription
+ # block description string so that each description
# string has an associated 'ERROR' or 'FAILED'
def exception(exception)
print "\n- #{exception.it}" if exception?
diff --git a/spec/mspec/lib/mspec/utils/options.rb b/spec/mspec/lib/mspec/utils/options.rb
index af9a9b3f0e8dea..3e3f708a2fdf8a 100644
--- a/spec/mspec/lib/mspec/utils/options.rb
+++ b/spec/mspec/lib/mspec/utils/options.rb
@@ -94,7 +94,7 @@ def match?(opt)
@options.find { |o| o.match? opt }
end
- # Processes an option. Calles the #on_extra block (or default) for
+ # Processes an option. Calls the #on_extra block (or default) for
# unrecognized options. For registered options, possibly fetches an
# argument and invokes the option's block if it is not nil.
def process(argv, entry, opt, arg)
@@ -414,7 +414,7 @@ def obj.load
end
def interrupt
- on("--int-spec", "Control-C interupts the current spec only") do
+ on("--int-spec", "Control-C interrupts the current spec only") do
config[:abort] = false
end
end
diff --git a/spec/mspec/spec/expectations/should.rb b/spec/mspec/spec/expectations/should.rb
index 24b1cf2bf8570f..48503b1631b9ee 100644
--- a/spec/mspec/spec/expectations/should.rb
+++ b/spec/mspec/spec/expectations/should.rb
@@ -41,7 +41,7 @@ def finish
:sym.should be_kind_of(Symbol)
end
- it "causes a failue to be recorded" do
+ it "causes a failure to be recorded" do
1.should == 2
end
diff --git a/spec/mspec/spec/expectations/should_spec.rb b/spec/mspec/spec/expectations/should_spec.rb
index 2c896f1c3bf790..b8bda8f86f670e 100644
--- a/spec/mspec/spec/expectations/should_spec.rb
+++ b/spec/mspec/spec/expectations/should_spec.rb
@@ -13,7 +13,7 @@
it "records failures" do
@out.should include <<-EOS
1)
-MSpec expectation method #should causes a failue to be recorded FAILED
+MSpec expectation method #should causes a failure to be recorded FAILED
Expected 1 == 2
to be truthy but was false
EOS
diff --git a/spec/mspec/spec/matchers/base_spec.rb b/spec/mspec/spec/matchers/base_spec.rb
index 4694d754f7dafc..762822bf097fc9 100644
--- a/spec/mspec/spec/matchers/base_spec.rb
+++ b/spec/mspec/spec/matchers/base_spec.rb
@@ -52,7 +52,7 @@
end
end
-describe SpecPositiveOperatorMatcher, "< operater" do
+describe SpecPositiveOperatorMatcher, "< operator" do
it "provides a failure message that 'Expected x to be less than y'" do
lambda {
SpecPositiveOperatorMatcher.new(5) < 4
@@ -64,7 +64,7 @@
end
end
-describe SpecPositiveOperatorMatcher, "<= operater" do
+describe SpecPositiveOperatorMatcher, "<= operator" do
it "provides a failure message that 'Expected x to be less than or equal to y'" do
lambda {
SpecPositiveOperatorMatcher.new(5) <= 4
diff --git a/spec/mspec/spec/matchers/complain_spec.rb b/spec/mspec/spec/matchers/complain_spec.rb
index 83ecb70622447c..90f94c36842b04 100644
--- a/spec/mspec/spec/matchers/complain_spec.rb
+++ b/spec/mspec/spec/matchers/complain_spec.rb
@@ -8,7 +8,7 @@
ComplainMatcher.new(nil).matches?(proc).should == true
end
- it "maches when executing the proc results in the expected output to $stderr" do
+ it "matches when executing the proc results in the expected output to $stderr" do
proc = lambda { warn "Que haces?" }
ComplainMatcher.new("Que haces?\n").matches?(proc).should == true
ComplainMatcher.new("Que pasa?\n").matches?(proc).should == false
diff --git a/spec/mspec/spec/runner/formatters/dotted_spec.rb b/spec/mspec/spec/runner/formatters/dotted_spec.rb
index 1e9b06f6e1f320..5af2ff55f8c4f9 100644
--- a/spec/mspec/spec/runner/formatters/dotted_spec.rb
+++ b/spec/mspec/spec/runner/formatters/dotted_spec.rb
@@ -91,7 +91,7 @@
@formatter.exception?.should be_true
end
- it "addes the exception to the list of exceptions" do
+ it "adds the exception to the list of exceptions" do
@formatter.exceptions.should == []
@formatter.exception @error
@formatter.exception @failure
diff --git a/spec/mspec/spec/utils/script_spec.rb b/spec/mspec/spec/utils/script_spec.rb
index e3188ab5ff5901..3cc85fa1e22f5b 100644
--- a/spec/mspec/spec/utils/script_spec.rb
+++ b/spec/mspec/spec/utils/script_spec.rb
@@ -406,7 +406,7 @@ class MSSClass < MSpecScript; end
@script = MSpecScript.new
end
- it "accumlates the values returned by #entries" do
+ it "accumulates the values returned by #entries" do
@script.should_receive(:entries).and_return(["file1"], ["file2"])
@script.files(["a", "b"]).should == ["file1", "file2"]
end
diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb
index 660d083799fc30..9f92635387b78d 100644
--- a/test/date/test_date_parse.rb
+++ b/test/date/test_date_parse.rb
@@ -208,7 +208,7 @@ def test__parse
[['08-DEC-0088',false],[88,12,8,nil,nil,nil,nil,nil,nil], __LINE__],
[['08-DEC-0088',true],[88,12,8,nil,nil,nil,nil,nil,nil], __LINE__],
- # swaped vms
+ # swapped vms
[['DEC-08-1988',false],[1988,12,8,nil,nil,nil,nil,nil,nil], __LINE__],
[['JAN-31-1999',false],[1999,1,31,nil,nil,nil,nil,nil,nil], __LINE__],
[['JAN-31--1999',false],[-1999,1,31,nil,nil,nil,nil,nil,nil], __LINE__],
diff --git a/test/did_you_mean/spell_checking/test_class_name_check.rb b/test/did_you_mean/spell_checking/test_class_name_check.rb
index 388dbe89a7044e..ffe7a4c31ba657 100644
--- a/test/did_you_mean/spell_checking/test_class_name_check.rb
+++ b/test/did_you_mean/spell_checking/test_class_name_check.rb
@@ -70,7 +70,7 @@ def test_does_not_suggest_user_input
# This is a weird require, but in a multi-threaded condition, a constant may
# be loaded between when a NameError occurred and when the spell checker
- # attemps to find a possible suggestion. The manual require here simulates
+ # attempts to find a possible suggestion. The manual require here simulates
# a race condition a single test.
require_relative '../fixtures/book'
diff --git a/test/logger/test_logdevice.rb b/test/logger/test_logdevice.rb
index eaea4c85227270..2a01dab17f129c 100644
--- a/test/logger/test_logdevice.rb
+++ b/test/logger/test_logdevice.rb
@@ -51,7 +51,7 @@ def test_initialize
ensure
logdev.close
end
- # create logfile whitch is already exist.
+ # create logfile which is already exist.
logdev = d(@filename)
begin
assert_predicate(logdev.dev, :sync)
diff --git a/test/openssl/test_config.rb b/test/openssl/test_config.rb
index 8096375c072abf..3606c67d65cf4b 100644
--- a/test/openssl/test_config.rb
+++ b/test/openssl/test_config.rb
@@ -61,14 +61,14 @@ def test_s_parse_format
[default1 default2]\t\t # space is allowed in section name
fo =b ar # space allowed in value
[emptysection]
- [doller ]
+ [dollar ]
foo=bar
bar = $(foo)
baz = 123$(default::bar)456${foo}798
qux = ${baz}
quxx = $qux.$qux
__EOC__
- assert_equal(['default', 'default1 default2', 'doller', 'emptysection', 'foo', 'foo\\bar'], c.sections.sort)
+ assert_equal(['default', 'default1 default2', 'dollar', 'emptysection', 'foo', 'foo\\bar'], c.sections.sort)
assert_equal(['', 'a', 'bar', 'baz', 'd', 'dq', 'dq2', 'esc', 'foo\\bar', 'sq'], c['default'].keys.sort)
assert_equal('c', c['default'][''])
assert_equal('', c['default']['a'])
@@ -84,12 +84,12 @@ def test_s_parse_format
assert_equal('baz', c['foo\\bar']['foo\\bar'])
assert_equal('b ar', c['default1 default2']['fo'])
- # dolloer
- assert_equal('bar', c['doller']['foo'])
- assert_equal('bar', c['doller']['bar'])
- assert_equal('123baz456bar798', c['doller']['baz'])
- assert_equal('123baz456bar798', c['doller']['qux'])
- assert_equal('123baz456bar798.123baz456bar798', c['doller']['quxx'])
+ # dollar
+ assert_equal('bar', c['dollar']['foo'])
+ assert_equal('bar', c['dollar']['bar'])
+ assert_equal('123baz456bar798', c['dollar']['baz'])
+ assert_equal('123baz456bar798', c['dollar']['qux'])
+ assert_equal('123baz456bar798.123baz456bar798', c['dollar']['quxx'])
excn = assert_raise(OpenSSL::ConfigError) do
OpenSSL::Config.parse("foo = $bar")
diff --git a/test/racc/assets/nasl.y b/test/racc/assets/nasl.y
index e68dd699f89ac5..c7b8e465510a24 100644
--- a/test/racc/assets/nasl.y
+++ b/test/racc/assets/nasl.y
@@ -586,7 +586,7 @@ def n(cls, *args)
rescue
puts "An exception occurred during the creation of a #{cls} instance."
puts
- puts "The arguments passed to the constructer were:"
+ puts "The arguments passed to the constructor were:"
puts args
puts
puts @tok.last.context
diff --git a/test/racc/regress/nasl b/test/racc/regress/nasl
index 2904866ee67a41..ea473430012538 100644
--- a/test/racc/regress/nasl
+++ b/test/racc/regress/nasl
@@ -56,7 +56,7 @@ def n(cls, *args)
rescue
puts "An exception occurred during the creation of a #{cls} instance."
puts
- puts "The arguments passed to the constructer were:"
+ puts "The arguments passed to the constructor were:"
puts args
puts
puts @tok.last.context
diff --git a/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text b/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text
index 6c5a6fdb4bfcfd..b499390f2dc50a 100644
--- a/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text
+++ b/test/rdoc/MarkdownTest_1.0.3/Markdown Documentation - Basics.text
@@ -270,7 +270,7 @@ it easy to use Markdown to write about HTML example code:
I strongly recommend against using any `
To specify an entire block of pre-formatted code, indent every line of
diff --git a/test/rdoc/test_rdoc_markdown_test.rb b/test/rdoc/test_rdoc_markdown_test.rb
index fff68818b5f551..0ecd0001361247 100644
--- a/test/rdoc/test_rdoc_markdown_test.rb
+++ b/test/rdoc/test_rdoc_markdown_test.rb
@@ -744,7 +744,7 @@ def test_markdown_documentation_basics
"I strongly recommend against using any `