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
Xavier Thompson
rubygemsrecipe
Commits
905b5dc7
Commit
905b5dc7
authored
Sep 28, 2021
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix version comparison
This will avoid bugs if one day major version becomes greater than 9.
parent
724c6872
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
rubygems.py
rubygems.py
+1
-1
tests/test_rubygems.py
tests/test_rubygems.py
+6
-1
No files found.
rubygems.py
View file @
905b5dc7
...
@@ -274,7 +274,7 @@ class Recipe(object):
...
@@ -274,7 +274,7 @@ class Recipe(object):
def get_dependency_list(self, gem_dict, gem_executable, version):
def get_dependency_list(self, gem_dict, gem_executable, version):
gem_search_pattern = '^' + gem_dict['gemname'].replace('.',r'
\
.
'
) + '$'
gem_search_pattern = '^' + gem_dict['gemname'].replace('.',r'
\
.
'
) + '$'
if
version[0] < '3'
:
if
int(version.split("
.
")[0]) < 3
:
gem_search_pattern = '/' + gem_search_pattern + '/'
gem_search_pattern = '/' + gem_search_pattern + '/'
cmd = [
cmd = [
...
...
tests/test_rubygems.py
View file @
905b5dc7
...
@@ -272,6 +272,11 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
...
@@ -272,6 +272,11 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
rubygems
.
Recipe
,
buildout
,
name
,
options
rubygems
.
Recipe
,
buildout
,
name
,
options
)
)
@
fixture
({
'recipe'
:
{
'gems'
:
'sass'
,
'version'
:
'10.0.0'
}})
def
test_2_digits_version
(
self
,
path
,
patches
,
buildout
,
name
,
options
,
version
):
recipe
=
rubygems
.
Recipe
(
buildout
,
name
,
options
)
recipe
.
update
()
class
deployment_fixture
(
fixture
):
class
deployment_fixture
(
fixture
):
def
mocked_check_output_for_dependencies
(
self
,
cmd
,
**
kwargs
):
def
mocked_check_output_for_dependencies
(
self
,
cmd
,
**
kwargs
):
...
@@ -300,7 +305,7 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
...
@@ -300,7 +305,7 @@ class RubyGemsDeploymentTestCase(RubyGemsTestCase):
gem_dict_list
=
list
(
map
(
recipe
.
get_gem_dict
,
recipe
.
gems
))
gem_dict_list
=
list
(
map
(
recipe
.
get_gem_dict
,
recipe
.
gems
))
for
gem_dict
in
gem_dict_list
:
for
gem_dict
in
gem_dict_list
:
gem_search_pattern
=
'^'
+
gem_dict
[
'gemname'
].
replace
(
'.'
,
r'\
.
') + '
$
'
gem_search_pattern
=
'^'
+
gem_dict
[
'gemname'
].
replace
(
'.'
,
r'\
.
') + '
$
'
if
version[0] < '
3
'
:
if
int(version.split(".")[0]) < 3
:
gem_search_pattern = '
/
' + gem_search_pattern + '
/
'
gem_search_pattern = '
/
' + gem_search_pattern + '
/
'
gem_executable = str(path.joinpath(name, '
bin
', '
gem
'))
gem_executable = str(path.joinpath(name, '
bin
', '
gem
'))
...
...
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