github-to-canvas 0.1.9 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b94622944d8bc1fca2bf802c4fcb9705c8fb9e51072b363cfe8be85c5304680
|
4
|
+
data.tar.gz: ba10efd6629d42c8bf53d729c4a739f7ee5954c978357382841079020d32386f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc71149053f243875c46622f376a13996b16b892e09153af2d6189652f082d1fa5b4d6d2cd5adb920484f30bb91e303d3d89b50aa3ccacb2a0885570b548ea61
|
7
|
+
data.tar.gz: facf3dbde83c5d033f08aadbcf399d9112364e57da18056da6c0fbd65634df6718fc3ae41c16d7e84252369dbeca57e1b8c151d13f8135ffc0b70273993e68b6
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'rest-client'
|
3
3
|
require 'yaml'
|
4
|
-
require 'byebug'
|
4
|
+
# require 'byebug'
|
5
5
|
class CanvasInterface
|
6
6
|
|
7
7
|
def self.create_course(course_info)
|
@@ -98,11 +98,11 @@ class CanvasInterface
|
|
98
98
|
lesson_info = lesson_info[0] if lesson_info.kind_of?(Array)
|
99
99
|
url = url.sub(/[^\/]+$/, lesson_info["page_id"].to_s)
|
100
100
|
end
|
101
|
-
|
102
101
|
response = RestClient.put(url, payload, headers)
|
103
|
-
rescue
|
102
|
+
rescue Exception => e
|
104
103
|
puts "Something went wrong while pushing lesson #{options[:id]} to course #{options[:course_id]}"
|
105
104
|
puts "Make sure you are working on lessons that are not locked"
|
105
|
+
raise e
|
106
106
|
abort
|
107
107
|
end
|
108
108
|
JSON.parse(response.body)
|
@@ -162,7 +162,7 @@ class RepositoryConverter
|
|
162
162
|
remote = GithubInterface.git_remote(filepath)
|
163
163
|
end
|
164
164
|
raw_remote = remote.gsub("git@github.com:","https://raw.githubusercontent.com/")
|
165
|
-
raw_remote =
|
165
|
+
raw_remote = raw_remote.gsub("https://github.com/","https://raw.githubusercontent.com/")
|
166
166
|
raw_remote = raw_remote.gsub(/\/blob\/master\/.*$/,"")
|
167
167
|
raw_remote = raw_remote.gsub(/\/blob\/main\/.*$/,"")
|
168
168
|
raw_remote = raw_remote.gsub(/.git$/,"")
|