Skip to content

Commit 51447ca

Browse files
committed
Add HTTP to generic source URLs.
1 parent d778f5f commit 51447ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

import.rake

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ def import_cookbooks_with_versions_and_platforms
4747
row = row.to_hash
4848
category = Category.with_name(row['category_name']).first!
4949

50+
if URI(row['external_url']).is_a?(URI::Generic)
51+
well_formed_external_url = ('http://' + row['external_url'])
52+
end
53+
5054
cookbook = Cookbook.new(
5155
name: row['name'],
5256
maintainer: 'john@example.com',
5357
description: row['description'],
5458
category: category,
55-
external_url: row['external_url'],
59+
source_url: well_formed_external_url || row['external_url'],
5660
download_count: row['download_count'],
5761
deprecated: row['deprecated']
5862
)

0 commit comments

Comments
 (0)