Commit 7fd5bd1a authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Disable documentation generation

Adds option --no-document to install command to reproduce behavior
before commit c58aba06 with Rubygems
version >= 2.0.0 .
parent df762a7a
......@@ -135,6 +135,8 @@ class Recipe(object):
def _install_rubygems(self):
url, version = self._get_latest_rubygems()
if int(version.split(".")[0]) < 2:
raise zc.buildout.UserError("Rubygems version must be >= 2.0.0")
srcdir = os.path.join(self.buildout['buildout']['parts-directory'],
'rubygems-' + version)
options = {
......@@ -201,6 +203,7 @@ class Recipe(object):
self.ruby_executable,
gem_executable,
'install',
'--no-document',
'--bindir=%s' % bindir,
]
......
......@@ -24,7 +24,7 @@ def touch(path):
class fixture(object):
def __init__(self, options=None, version='1.0'):
def __init__(self, options=None, version='2.0.0'):
self.options = options or {}
self.version = version
......@@ -61,7 +61,7 @@ class fixture(object):
('download', 'rubygems.Download'),
))
self.patches['urlopen'].return_value = BytesIO(
b'https://rubygems.org/rubygems/rubygems-1.0.zip'
b'https://rubygems.org/rubygems/rubygems-2.0.0.zip'
)
self.makedirs((
......@@ -103,8 +103,8 @@ class RubyGemsTests(unittest.TestCase):
args = patches['download'].mock_calls[0][1]
self.assertEqual(args[2], {
'url': 'https://rubygems.org/rubygems/rubygems-1.0.zip',
'destination': str(path / 'rubygems-1.0'),
'url': 'https://rubygems.org/rubygems/rubygems-2.0.0.zip',
'destination': str(path / 'rubygems-2.0.0'),
})
# Two check_output calls to install rubygems and specified gem
......@@ -118,7 +118,7 @@ class RubyGemsTests(unittest.TestCase):
args = patches['check_output'].mock_calls[1][1]
self.assertEqual(args[0], [
'ruby', None, 'install',
'ruby', None, 'install', '--no-document',
'--bindir=%s/rubygems/bin' % path,
'sass', '--'
])
......@@ -162,13 +162,13 @@ class RubyGemsTests(unittest.TestCase):
@fixture({'recipe': {
'gems': 'sass',
'url': 'https://rubygems.org/rubygems/rubygems-1.0.zip',
'url': 'https://rubygems.org/rubygems/rubygems-2.0.0.zip',
}})
def test_version_from_url(self, path, patches, buildout, name, options):
recipe = rubygems.Recipe(buildout, name, options)
recipe.install()
@fixture({'recipe': {'gems': 'sass', 'version': '1.0'}})
@fixture({'recipe': {'gems': 'sass', 'version': '2.0.0'}})
def test_version(self, path, patches, buildout, name, options):
recipe = rubygems.Recipe(buildout, name, options)
recipe.install()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment