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
c87666ef
Commit
c87666ef
authored
Aug 12, 2015
by
Tobias Bengfort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rubygems url
parent
635dc747
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
rubygems.py
rubygems.py
+3
-3
tests/test_rubygems.py
tests/test_rubygems.py
+4
-4
No files found.
rubygems.py
View file @
c87666ef
...
...
@@ -117,13 +117,13 @@ class Recipe(object):
return
(
self
.
url
,
version
)
if
self
.
version
:
return
(
'http
://production.cf.
rubygems.org/rubygems/'
return
(
'http
s://
rubygems.org/rubygems/'
'rubygems-%s.zip'
%
self
.
version
,
self
.
version
)
f
=
urllib
.
request
.
urlopen
(
'http://rubygems.org/pages/download'
)
f
=
urllib
.
request
.
urlopen
(
'http
s
://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'http
s://
rubygems.org/rubygems/'
r'rubygems-([0-9.]+).zip'
,
s
)
if
r
:
url
=
r
.
group
(
0
)
...
...
tests/test_rubygems.py
View file @
c87666ef
...
...
@@ -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'
'http
s://
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
,
(
'http
s
://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'
'http
s://
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'
:
'http
s://
rubygems.org/rubygems/rubygems-1.0.zip'
,
}})
def
test_version_from_url
(
self
,
path
,
patches
,
buildout
,
name
,
options
):
recipe
=
rubygems
.
Recipe
(
buildout
,
name
,
options
)
...
...
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