Commit c87666ef authored by Tobias Bengfort's avatar Tobias Bengfort

fix rubygems url

parent 635dc747
......@@ -117,13 +117,13 @@ class Recipe(object):
return (self.url, version)
if self.version:
return ('http://production.cf.rubygems.org/rubygems/'
return ('https://rubygems.org/rubygems/'
'rubygems-%s.zip' % self.version, self.version)
f = urllib.request.urlopen('http://rubygems.org/pages/download')
f = urllib.request.urlopen('https://rubygems.org/pages/download')
s = f.read().decode('utf-8')
f.close()
r = re.search(r'http://production.cf.rubygems.org/rubygems/'
r = re.search(r'https://rubygems.org/rubygems/'
r'rubygems-([0-9.]+).zip', s)
if r:
url = r.group(0)
......
......@@ -60,7 +60,7 @@ class fixture(object):
('hexagonit', 'rubygems.hexagonit.recipe.download.Recipe'),
))
self.patches['urlopen'].return_value = StringIO(
'http://production.cf.rubygems.org/rubygems/rubygems-1.0.zip'
'https://rubygems.org/rubygems/rubygems-1.0.zip'
)
self.makedirs((
......@@ -95,7 +95,7 @@ class RubyGemsTests(unittest.TestCase):
self.assertEqual(patches['urlopen'].call_count, 1)
args = patches['urlopen'].mock_calls[0][1]
self.assertEqual(args, ('http://rubygems.org/pages/download',))
self.assertEqual(args, ('https://rubygems.org/pages/download',))
# One hexagonit.recipe.download call to download rubygems
self.assertEqual(patches['hexagonit'].call_count, 1)
......@@ -103,7 +103,7 @@ class RubyGemsTests(unittest.TestCase):
args = patches['hexagonit'].mock_calls[0][1]
self.assertEqual(args[2], {
'url': (
'http://production.cf.rubygems.org/rubygems/rubygems-1.0.zip'
'https://rubygems.org/rubygems/rubygems-1.0.zip'
),
'destination': str(path),
})
......@@ -163,7 +163,7 @@ class RubyGemsTests(unittest.TestCase):
@fixture({'recipe': {
'gems': 'sass',
'url': 'http://production.cf.rubygems.org/rubygems/rubygems-1.0.zip',
'url': 'https://rubygems.org/rubygems/rubygems-1.0.zip',
}})
def test_version_from_url(self, path, patches, buildout, name, options):
recipe = rubygems.Recipe(buildout, name, options)
......
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