lib/daigaku/terminal/courses.rb in daigaku-0.6.0 vs lib/daigaku/terminal/courses.rb in daigaku-1.0.0
- old
+ new
@@ -35,10 +35,10 @@
courses_path = Daigaku.config.courses_path
FileUtils.makedirs(courses_path) unless Dir.exist?(courses_path)
file_name = File.join(courses_path, url.split('/').last)
- File.open(file_name, 'w') { |file| file << open(url).read }
+ File.open(file_name, 'w') { |file| file << URI.open(url).read }
course = Course.unzip(file_name, github_repo: github)
if github
user_and_repo = url.match(MASTER_ZIP_URL).captures.first
store_repo_data(options[:github] || user_and_repo)