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
724c6872
Commit
724c6872
authored
Sep 28, 2021
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix url and version mutually exclusive options
Check url and version options are not both in options
parent
80d56118
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
README.rst
README.rst
+1
-1
rubygems.py
rubygems.py
+4
-0
tests/test_rubygems.py
tests/test_rubygems.py
+14
-0
No files found.
README.rst
View file @
724c6872
...
@@ -39,7 +39,7 @@ url
...
@@ -39,7 +39,7 @@ url
version
version
rubygems version, if not specified, recipe will try to find most recent
rubygems version, if not specified, recipe will try to find most recent
version.
version.
Mutually exclusive with url option.
ruby-executable
ruby-executable
A path to a Ruby executable. Gems will be installed using this executable.
A path to a Ruby executable. Gems will be installed using this executable.
...
...
rubygems.py
View file @
724c6872
...
@@ -46,6 +46,10 @@ class Recipe(object):
...
@@ -46,6 +46,10 @@ class Recipe(object):
"Configuration error, 'gems' option is missing"
)
"Configuration error, 'gems' option is missing"
)
self
.
url
=
options
.
get
(
'url'
)
self
.
url
=
options
.
get
(
'url'
)
if
(
self
.
url
and
options
.
get
(
'version'
)):
raise
zc
.
buildout
.
UserError
(
"Configuration error, 'url' and 'version' options are mutually exclusive"
)
# Allow to define specific ruby executable. If not, take just 'ruby'
# Allow to define specific ruby executable. If not, take just 'ruby'
self
.
ruby_executable
=
options
.
get
(
'ruby-executable'
,
'ruby'
)
self
.
ruby_executable
=
options
.
get
(
'ruby-executable'
,
'ruby'
)
...
...
tests/test_rubygems.py
View file @
724c6872
...
@@ -259,6 +259,20 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
...
@@ -259,6 +259,20 @@ class RubyGemsDefaultTestCase(RubyGemsTestCase):
recipe
=
rubygems
.
Recipe
(
buildout
,
name
,
options
)
recipe
=
rubygems
.
Recipe
(
buildout
,
name
,
options
)
recipe
.
install
()
recipe
.
install
()
@
fixture
({
'recipe'
:
{
'gems'
:
'sass'
,
'url'
:
'https://rubygems.org/rubygems/rubygems-%s.zip'
%
RUBYGEMS_DEFAULT_VERSION
,
'version'
:
RUBYGEMS_DEFAULT_VERSION
,
}})
def
test_version_and_url
(
self
,
path
,
patches
,
buildout
,
name
,
options
,
version
):
self
.
assertRaisesRegexp
(
zc
.
buildout
.
UserError
,
"Configuration error, 'url' and 'version' options are mutually exclusive"
,
rubygems
.
Recipe
,
buildout
,
name
,
options
)
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
):
if
len
(
cmd
)
>
3
and
cmd
[
2
]
==
'dependency'
:
if
len
(
cmd
)
>
3
and
cmd
[
2
]
==
'dependency'
:
...
...
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