Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rubygemsrecipe
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
nexedi
rubygemsrecipe
Commits
931dffec
Commit
931dffec
authored
Sep 14, 2021
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix hardcoded ruby version
parent
c817d701
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
rubygems.py
rubygems.py
+7
-2
tests/test_rubygems.py
tests/test_rubygems.py
+3
-0
No files found.
rubygems.py
View file @
931dffec
...
...
@@ -156,12 +156,12 @@ class Recipe(object):
'
RUBYLIB
': os.environ.get('
RUBYLIB
', ''),
}
env = {
'
GEM_HOME
':
'
%
(
PREFIX
)
s
/
lib
/
ruby
/
gems
/
1.8
'
% s,
'
GEM_HOME
':
('
%
(
PREFIX
)
s
/
lib
/
ruby
/
gems
/
' + self.ruby_version_dir_name)
% s,
'
RUBYLIB
': self._join_paths(
'
%
(
RUBYLIB
)
s
',
'
%
(
PREFIX
)
s
/
lib
',
'
%
(
PREFIX
)
s
/
lib
/
ruby
',
'
%
(
PREFIX
)
s
/
lib
/
site_ruby
/
1.8
'
,
'
%
(
PREFIX
)
s
/
lib
/
site_ruby
/
' + self.ruby_version_dir_name
,
) % s,
'
PATH
': self._join_paths(
'
%
(
PATH
)
s
',
...
...
@@ -173,6 +173,10 @@ class Recipe(object):
env.update({k: (v % env) for k, v in env_override})
return env
def _get_ruby_version_dir_name(self):
cmd = [self.ruby_executable, "'
-
e
", "'puts Gem.user_dir'",]
return self.run(cmd).split('/')[-1]
def get_gem_dict(self, gem_str):
parsed_gem = gem_str.split('==', 1)
gem_dict = {'gemname': parsed_gem[0].strip()}
...
...
@@ -324,6 +328,7 @@ class Recipe(object):
if int(self.version.split("
.
")[0]) < 2:
raise zc.buildout.UserError("
Rubygems
version
must
be
>=
2.0
.
0
")
self.ruby_version_dir_name = self._get_ruby_version_dir_name()
self._install_rubygems()
gem_executable = self.get_gem_executable(self.bindir)
...
...
tests/test_rubygems.py
View file @
931dffec
...
...
@@ -18,6 +18,7 @@ import zc.buildout
import
rubygems
RUBYGEMS_DEFAULT_VERSION
=
'2.0.0'
RUBY_DEFAULT_VERSION
=
'2.2.0'
def
touch
(
path
):
...
...
@@ -38,6 +39,7 @@ class fixture(object):
self
.
to_patch
=
(
(
'check_output'
,
'rubygems.subprocess.check_output'
),
(
'clean_up'
,
'rubygems.Recipe._clean_up'
),
(
'ruby_version'
,
'rubygems.Recipe._get_ruby_version_dir_name'
),
(
'urlopen'
,
'rubygems.urllib.request.urlopen'
),
(
'download'
,
'rubygems.Download'
),
)
...
...
@@ -47,6 +49,7 @@ class fixture(object):
(
'https://rubygems.org/rubygems/rubygems-%s.zip'
%
RUBYGEMS_DEFAULT_VERSION
).
encode
(
'utf-8'
)
)),
'ruby_version'
:
RUBY_DEFAULT_VERSION
,
}
self
.
patch_side_effect_dict
=
{
...
...
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