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
a5ad768c
Unverified
Commit
a5ad768c
authored
Dec 31, 2018
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Dec 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4204 from shuujii/fix-yacc-running-multiple-times
Fix Yacc running multiple times.
parents
37d795de
482b2ea0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
lib/mruby/gem.rb
lib/mruby/gem.rb
+12
-9
No files found.
lib/mruby/gem.rb
View file @
a5ad768c
...
@@ -52,6 +52,8 @@ module MRuby
...
@@ -52,6 +52,8 @@ module MRuby
end
end
def
setup
def
setup
return
if
defined?
(
@linker
)
# return if already set up
MRuby
::
Gem
.
current
=
self
MRuby
::
Gem
.
current
=
self
MRuby
::
Build
::
COMMANDS
.
each
do
|
command
|
MRuby
::
Build
::
COMMANDS
.
each
do
|
command
|
instance_variable_set
(
"@
#{
command
}
"
,
@build
.
send
(
command
).
clone
)
instance_variable_set
(
"@
#{
command
}
"
,
@build
.
send
(
command
).
clone
)
...
@@ -334,26 +336,26 @@ module MRuby
...
@@ -334,26 +336,26 @@ module MRuby
end
end
def
generate_gem_table
build
def
generate_gem_table
build
gem_table
=
@ary
.
reduce
({})
{
|
res
,
v
|
res
[
v
.
name
]
=
v
;
res
}
gem_table
=
each_with_object
({})
{
|
spec
,
h
|
h
[
spec
.
name
]
=
spec
}
default_gems
=
[]
default_gems
=
{}
each
do
|
g
|
each
do
|
g
|
g
.
dependencies
.
each
do
|
dep
|
g
.
dependencies
.
each
do
|
dep
|
default_gems
<<
default_gem_params
(
dep
)
unless
gem_table
.
key?
dep
[
:gem
]
default_gems
[
dep
[
:gem
]]
||=
default_gem_params
(
dep
)
end
end
end
end
until
default_gems
.
empty?
until
default_gems
.
empty?
def_gem
=
default_gems
.
pop
def_name
,
def_gem
=
default_gems
.
shift
next
if
gem_table
[
def_name
]
spec
=
build
.
gem
def_gem
[
:default
]
spec
=
gem_table
[
def_name
]
=
build
.
gem
(
def_gem
[
:default
])
fail
"Invalid gem name:
#{
spec
.
name
}
(Expected:
#{
def_
gem
[
:gem
]
}
)"
if
spec
.
name
!=
def_gem
[
:gem
]
fail
"Invalid gem name:
#{
spec
.
name
}
(Expected:
#{
def_
name
}
)"
if
spec
.
name
!=
def_name
spec
.
setup
spec
.
setup
spec
.
dependencies
.
each
do
|
dep
|
spec
.
dependencies
.
each
do
|
dep
|
default_gems
<<
default_gem_params
(
dep
)
unless
gem_table
.
key?
dep
[
:gem
]
default_gems
[
dep
[
:gem
]]
||=
default_gem_params
(
dep
)
end
end
gem_table
[
spec
.
name
]
=
spec
end
end
each
do
|
g
|
each
do
|
g
|
...
@@ -428,7 +430,8 @@ module MRuby
...
@@ -428,7 +430,8 @@ module MRuby
end
end
def
import_include_paths
(
g
)
def
import_include_paths
(
g
)
gem_table
=
@ary
.
reduce
({})
{
|
res
,
v
|
res
[
v
.
name
]
=
v
;
res
}
gem_table
=
each_with_object
({})
{
|
spec
,
h
|
h
[
spec
.
name
]
=
spec
}
g
.
dependencies
.
each
do
|
dep
|
g
.
dependencies
.
each
do
|
dep
|
dep_g
=
gem_table
[
dep
[
:gem
]]
dep_g
=
gem_table
[
dep
[
:gem
]]
# We can do recursive call safely
# We can do recursive call safely
...
...
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