Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
b05d736b
Commit
b05d736b
authored
May 29, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update mrblib/*.rb files to conform (some of) Rubocop checks
parent
13a2cc3e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
mrblib/array.rb
mrblib/array.rb
+2
-2
mrblib/hash.rb
mrblib/hash.rb
+2
-2
mrblib/kernel.rb
mrblib/kernel.rb
+1
-1
mrblib/numeric.rb
mrblib/numeric.rb
+4
-4
mrblib/range.rb
mrblib/range.rb
+1
-1
mrblib/string.rb
mrblib/string.rb
+3
-3
No files found.
mrblib/array.rb
View file @
b05d736b
...
...
@@ -34,7 +34,7 @@ class Array
return
to_enum
:each_index
unless
block_given?
idx
=
0
while
(
idx
<
length
)
while
idx
<
length
block
.
call
(
idx
)
idx
+=
1
end
...
...
@@ -75,7 +75,7 @@ class Array
self
[
size
-
1
]
=
nil
# allocate
idx
=
0
while
(
idx
<
size
)
while
idx
<
size
self
[
idx
]
=
(
block
)?
block
.
call
(
idx
):
obj
idx
+=
1
end
...
...
mrblib/hash.rb
View file @
b05d736b
...
...
@@ -10,7 +10,7 @@ class Hash
# hash.
#
# ISO 15.2.13.4.1
def
==
(
hash
)
def
==
(
hash
)
return
true
if
self
.
equal?
(
hash
)
begin
hash
=
hash
.
to_hash
...
...
@@ -54,7 +54,7 @@ class Hash
#
# ISO 15.2.13.4.8
def
delete
(
key
,
&
block
)
if
block
&&
!
self
.
has_key?
(
key
)
if
block
&&
!
self
.
has_key?
(
key
)
block
.
call
(
key
)
else
self
.
__delete
(
key
)
...
...
mrblib/kernel.rb
View file @
b05d736b
...
...
@@ -27,7 +27,7 @@ module Kernel
def
loop
(
&
block
)
return
to_enum
:loop
unless
block
while
(
true
)
while
true
yield
end
rescue
StopIteration
...
...
mrblib/numeric.rb
View file @
b05d736b
...
...
@@ -48,7 +48,7 @@ module Integral
return
to_enum
(
:downto
,
num
)
unless
block_given?
i
=
self
.
to_i
while
(
i
>=
num
)
while
i
>=
num
block
.
call
(
i
)
i
-=
1
end
...
...
@@ -89,7 +89,7 @@ module Integral
return
to_enum
(
:upto
,
num
)
unless
block_given?
i
=
self
.
to_i
while
(
i
<=
num
)
while
i
<=
num
block
.
call
(
i
)
i
+=
1
end
...
...
@@ -106,12 +106,12 @@ module Integral
i
=
if
num
.
kind_of?
Float
then
self
.
to_f
else
self
end
if
step
>
0
while
(
i
<=
num
)
while
i
<=
num
block
.
call
(
i
)
i
+=
step
end
else
while
(
i
>=
num
)
while
i
>=
num
block
.
call
(
i
)
i
+=
step
end
...
...
mrblib/range.rb
View file @
b05d736b
...
...
@@ -32,7 +32,7 @@ class Range
return
self
if
(
val
<=>
last
)
>
0
while
((
val
<=>
last
)
<
0
)
while
(
val
<=>
last
)
<
0
block
.
call
(
val
)
val
=
val
.
succ
end
...
...
mrblib/string.rb
View file @
b05d736b
...
...
@@ -12,7 +12,7 @@ class String
def
each_line
(
&
block
)
# expect that str.index accepts an Integer for 1st argument as a byte data
offset
=
0
while
(
pos
=
self
.
index
(
0x0a
,
offset
)
)
while
pos
=
self
.
index
(
0x0a
,
offset
)
block
.
call
(
self
[
offset
,
pos
+
1
-
offset
])
offset
=
pos
+
1
end
...
...
@@ -106,7 +106,7 @@ class String
# +self+.
def
each_char
(
&
block
)
pos
=
0
while
(
pos
<
self
.
size
)
while
pos
<
self
.
size
block
.
call
(
self
[
pos
])
pos
+=
1
end
...
...
@@ -118,7 +118,7 @@ class String
def
each_byte
(
&
block
)
bytes
=
self
.
bytes
pos
=
0
while
(
pos
<
bytes
.
size
)
while
pos
<
bytes
.
size
block
.
call
(
bytes
[
pos
])
pos
+=
1
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment