github-to-canvas 0.0.31 → 0.0.36
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: a277f51430eb482d411f25b2458151b29509ccf6b5d93ed37a161a43d2d198a0
|
|
4
|
+
data.tar.gz: 345c466354af608b95cc34b5291d7b7966fdca89fba2cc4754efc2da7de868d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7936e708b7afc380dbfe3bb9f1c1b1502193652048ffc24f0549473b2903f00a311776db0c7c458b8ff3465ae08dc8aa8e999c53c38b9727d6036385e129a621
|
|
7
|
+
data.tar.gz: e8013f2e39e4f83be58e17f2ffdb2cce1dd00e28466b4663b3199b64cd78475b650bee6fab0988353f02138053c84569c6950641f59fe7cd0198222c56abbf97
|
data/bin/github-to-canvas
CHANGED
|
@@ -93,10 +93,6 @@ if options[:version]
|
|
|
93
93
|
GithubToCanvas.new(mode: 'version', course: nil)
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
-
if !options[:file_to_convert]
|
|
97
|
-
options[:file_to_convert] = "README.md"
|
|
98
|
-
end
|
|
99
|
-
|
|
100
96
|
if !options[:type]
|
|
101
97
|
if Dir.glob("**/*/").empty?
|
|
102
98
|
options[:type] = "page"
|
|
@@ -114,9 +110,14 @@ if !options[:name]
|
|
|
114
110
|
options[:name] = options[:file_to_convert]
|
|
115
111
|
else
|
|
116
112
|
options[:name] = File.basename(Dir.getwd)
|
|
113
|
+
options[:file_to_convert] = "README.md"
|
|
117
114
|
end
|
|
118
115
|
end
|
|
119
116
|
|
|
117
|
+
if !options[:file_to_convert]
|
|
118
|
+
options[:file_to_convert] = "README.md"
|
|
119
|
+
end
|
|
120
|
+
|
|
120
121
|
if options[:create_lesson]
|
|
121
122
|
GithubToCanvas.new(mode: "create",
|
|
122
123
|
course: options[:course],
|
|
@@ -2,8 +2,9 @@ class CreateCanvasLesson
|
|
|
2
2
|
|
|
3
3
|
def initialize(course, filepath, file_to_convert, branch, name, type, save_to_github, fis_links, remove_header_and_footer)
|
|
4
4
|
name = name.split(/[- _]/).map(&:capitalize).join(' ')
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
begin
|
|
6
|
+
markdown = File.read("#{filepath}/#{file_to_convert}")
|
|
7
|
+
rescue
|
|
7
8
|
puts "#{file_to_convert} not found in current directory. Exiting..."
|
|
8
9
|
abort
|
|
9
10
|
end
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
class UpdateCanvasLesson
|
|
2
2
|
|
|
3
|
-
def initialize(filepath, branch, name, type, save_to_github, fis_links, remove_header_and_footer)
|
|
3
|
+
def initialize(filepath, file_to_convert, branch, name, type, save_to_github, fis_links, remove_header_and_footer)
|
|
4
4
|
name = name.split(/[- _]/).map(&:capitalize).join(' ')
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
begin
|
|
6
|
+
markdown = File.read("#{filepath}/#{file_to_convert}")
|
|
7
|
+
rescue
|
|
7
8
|
puts "#{file_to_convert} not found in current directory. Exiting..."
|
|
8
9
|
abort
|
|
9
10
|
end
|
|
@@ -19,7 +20,7 @@ class UpdateCanvasLesson
|
|
|
19
20
|
canvas_data = CanvasDotfile.read_canvas_data
|
|
20
21
|
canvas_data[:lessons].each { |lesson|
|
|
21
22
|
response = CanvasInterface.update_existing_lesson(lesson[:course_id], lesson[:id], lesson[:type], name, new_html, save_to_github)
|
|
22
|
-
puts "Canvas lesson created. Lesson available at #{response['html_url']}."
|
|
23
|
+
# puts "Canvas lesson created. Lesson available at #{response['html_url']}."
|
|
23
24
|
}
|
|
24
25
|
end
|
|
25
26
|
|